--- getopt/trunk/Makefile 2005/11/07 22:09:10 259 +++ getopt/trunk/Makefile 2012/07/31 19:53:07 325 @@ -5,9 +5,8 @@ bindir=$(prefix)/bin mandir=$(prefix)/man man1dir=$(mandir)/man1 -libdir=$(prefix)/lib sharedir=$(prefix)/share -getoptdir=$(libdir)/getopt +getoptdir=$(sharedir)/getopt localedir=$(sharedir)/locale # Define this to 0 to use the getopt(3) routines in this package. @@ -16,7 +15,11 @@ # Define this to 1 if you do not have the gettext routines WITHOUT_GETTEXT=0 - +# For creating the archive +PACKAGE=getopt +VERSION=1.1.4 +BASENAME=$(PACKAGE)-$(VERSION) +UNLIKELYNAME=a8vwjfd92 SHELL=/bin/sh @@ -29,7 +32,7 @@ LANGUAGES = cs de es fr it ja nl pt_BR MOFILES:=$(patsubst %,po/%.mo,$(LANGUAGES)) -CPPFLAGS=-DLIBCGETOPT=$(LIBCGETOPT) -DWITH_GETTEXT=$(WITH_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX +CPPFLAGS=-DLIBCGETOPT=$(LIBCGETOPT) -DWITHOUT_GETTEXT=$(WITHOUT_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX -Dprogram_invocation_short_name=\"$(PACKAGE)\" -Dprogram_version=\"$(VERSION)\" ifeq ($(LIBCGETOPT),0) CPPFLAGS+=-I./gnu endif @@ -71,7 +74,7 @@ getopt-test.bash getopt-test.tcsh \ $(DESTDIR)$(getoptdir) -ifeq ($(WITH_GETTEXT),1) +ifeq ($(WITHOUT_GETTEXT),0) all_po: $(MOFILES) install_po: all_po $(INSTALL) -m 755 -d $(DESTDIR)$(localedir) @@ -93,3 +96,12 @@ %.mo: %.po $(MSGFMT) -o $@ $< + +# You need GNU tar for this to work! +.PHONY: package +package: clean + $(RM) -r $(UNLIKELYNAME) + mkdir $(UNLIKELYNAME) + ln -s .. $(UNLIKELYNAME)/$(BASENAME) + cd $(UNLIKELYNAME) && tar cfvzp ../$(BASENAME).tar.gz --exclude='CVS' --exclude='*.tar.gz' --exclude=$(UNLIKELYNAME) $(BASENAME)/* + $(RM) -r $(UNLIKELYNAME)