#!/usr/bin/make -f package = gettext CC = gcc CFLAGS = -g -Wall -D_REENTRANT INSTALL_PROGRAM = install INSTALL_SCRIPT = install STRIP = true ATRIP = true ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s STRIP=strip --strip-unneeded --remove-section=.comment --remove-section=.note ATRIP=strip --strip-debug endif DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) # PNET_ARCHS = %alpha%amd64%hppa%i386%ia64%mips%mipsel%powerpc%s390%sparc% # ifneq (,$(findstring %$(DEB_HOST_ARCH)%,$(PNET_ARCHS))) # CSHARP = --enable-csharp=pnet # endif # MONO_ARCHS = %amd64%arm%i386%ia64%lpia%powerpc% # ifneq (,$(findstring %$(DEB_HOST_ARCH)%,$(MONO_ARCHS))) # CSHARP = --enable-csharp=mono # endif CSHARP = --disable-csharp NOJAVA_ARCHS = %none% build: cd debian && $(CC) glibc-test.c debian/a.out ./configure --prefix=/usr $(CSHARP) \ CC="$(CC)" CFLAGS="$(CFLAGS)" \ JAVAC=/usr/lib/jvm/default-java/bin/javac \ CPPFLAGS=-I/usr/include/libxml2 $(MAKE) $(MAKE) install DESTDIR=`pwd`/debian/tmp \ INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \ INSTALL_SCRIPT="$(INSTALL_SCRIPT)" touch build clean: rm -f build [ ! -f Makefile ] || $(MAKE) distclean rm -f `find . -name "*~"` rm -rf debian/tmp debian/files* core debian/substvars debian/a.out cd debian && rm -rf gettext-base gettext gettext-el gettext-doc \ autopoint binary-arch: build debian/rules gettext-base debian/rules gettext binary-indep: build debian/rules gettext-el debian/rules gettext-doc debian/rules autopoint gettext-base: build rm -rf debian/$@ install -d debian/$@/DEBIAN debian/$@/usr/share/doc/$@ cd debian/$@ && install -d usr/share/man/man1 usr/bin usr/lib \ usr/share/lintian/overrides cp -p debian/$@.lintian-overrides \ debian/$@/usr/share/lintian/overrides/$@ cp -p debian/tmp/usr/share/man/man1/gettext.1 \ debian/$@/usr/share/man/man1 cp -p debian/tmp/usr/share/man/man1/ngettext.1 \ debian/$@/usr/share/man/man1 cp -p debian/tmp/usr/share/man/man1/envsubst.1 \ debian/$@/usr/share/man/man1 cp -a debian/tmp/usr/share/man/man3 debian/$@/usr/share/man cd debian/$@/usr/share/man/man3 && \ rm -f dcgettext.3 dcngettext.3 dgettext.3 dngettext.3 cp -p debian/tmp/usr/bin/gettext debian/$@/usr/bin cp -p debian/tmp/usr/bin/ngettext debian/$@/usr/bin cp -p debian/tmp/usr/bin/envsubst debian/$@/usr/bin cp -p debian/tmp/usr/bin/gettext.sh debian/$@/usr/bin cp -a debian/tmp/usr/share/locale debian/$@/usr/share if [ -f debian/tmp/usr/lib/GNU.Gettext.dll ]; then \ cp -p debian/tmp/usr/lib/GNU.Gettext.dll debian/$@/usr/lib; \ fi cp -a debian/tmp/usr/lib/libasprintf.so.0* debian/$@/usr/lib cd debian/$@/usr/lib && chmod 644 libasprintf.so.* $(STRIP) debian/$@/usr/lib/libasprintf.so.* find debian/$@/usr/share/locale | grep gettext-tools | xargs rm ifeq (,$(findstring %$(DEB_HOST_ARCH)%,$(NOJAVA_ARCHS))) install -d debian/$@/usr/share/java cp -p debian/tmp/usr/share/gettext/libintl.jar \ debian/$@/usr/share/java endif cp -p gettext-tools/ABOUT-NLS debian/$@/usr/share/doc/$@ cp -p debian/copyright debian/$@/usr/share/doc/$@ install -m 644 debian/$@.shlibs debian/$@/DEBIAN/shlibs install -m 755 debian/$@.postinst debian/$@/DEBIAN/postinst cp -p ChangeLog debian/$@/usr/share/doc/$@/changelog cp -p debian/changelog debian/$@/usr/share/doc/$@/changelog.Debian cd debian/$@/usr/share/doc/$@ && gzip -9 changelog changelog.Debian gzip -r9 debian/$@/usr/share/man ln -s gettext.3.gz debian/$@/usr/share/man/man3/dcgettext.3.gz ln -s gettext.3.gz debian/$@/usr/share/man/man3/dgettext.3.gz ln -s ngettext.3.gz debian/$@/usr/share/man/man3/dcngettext.3.gz ln -s ngettext.3.gz debian/$@/usr/share/man/man3/dngettext.3.gz sh debian/my-shlibdeps debian/$@/usr/bin/* debian/$@/usr/lib/* dpkg-gencontrol -p$@ -Pdebian/$@ cd debian/$@ && \ md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums find debian/$@/usr/share/locale -type d -empty | xargs -r rmdir find debian/$@/usr/share/locale -type d -empty | xargs -r rmdir chown -R 0:0 debian/$@ chmod -R u+w,go=rX debian/$@ dpkg --build debian/$@ .. gettext: build rm -rf debian/$@ install -d debian/$@/DEBIAN debian/$@/usr/share/doc/$@ cd debian/$@ && install -d usr/share/man usr/share/java \ usr/share/lintian/overrides cd debian && install -m 644 $@.shlibs $@/DEBIAN/shlibs cd debian && install -m 755 postinst $@/DEBIAN cp -p debian/$@.lintian-overrides \ debian/$@/usr/share/lintian/overrides/$@ cp -p gettext-runtime/BUGS gettext-tools/misc/DISCLAIM NEWS README \ debian/copyright debian/$@/usr/share/doc/$@ cp -p debian/README.Debian debian/$@/usr/share/doc/$@ cp -p ChangeLog debian/$@/usr/share/doc/$@/changelog cp -p debian/changelog debian/$@/usr/share/doc/$@/changelog.Debian cd debian/$@/usr/share/doc/$@ && ln -s ../../$(package)/ABOUT-NLS cd debian/$@/usr/share/doc/$@ && gzip -9 changelog changelog.Debian cp -a debian/tmp/usr/bin debian/$@/usr cp -a debian/tmp/usr/lib debian/$@/usr cp -a debian/tmp/usr/include debian/$@/usr cp -a debian/tmp/usr/share/info debian/$@/usr/share cp -a debian/tmp/usr/share/aclocal debian/$@/usr/share cp -a debian/tmp/usr/share/gettext debian/$@/usr/share rm -f debian/$@/usr/lib/gettext/gnu.gettext* rm -f debian/$@/usr/share/gettext/libintl.jar rm -f debian/$@/usr/lib/GNU.Gettext.dll cp -a debian/tmp/usr/share/man/man1 debian/$@/usr/share/man cp -a debian/tmp/usr/share/locale debian/$@/usr/share find debian/$@/usr/share/locale | grep gettext-runtime | xargs rm cd debian/$@/usr/bin && rm -f gettext ngettext envsubst gettext.sh cd debian/$@/usr/lib && rm -f libasprintf.so.* *.la cd debian/$@/usr/share/man/man1 && \ rm -f gettext.1 ngettext.1 envsubst.1 cd debian/$@/usr/lib && chmod 644 libgettextlib* libgettextsrc* \ libgettextpo* $(STRIP) debian/$@/usr/lib/preloadable_libintl.so $(STRIP) debian/$@/usr/lib/libgettextlib*.so $(STRIP) debian/$@/usr/lib/libgettextsrc*.so $(STRIP) debian/$@/usr/lib/libgettextpo.so.* $(ATRIP) debian/$@/usr/lib/libasprintf.a $(ATRIP) debian/$@/usr/lib/libgettextpo.a rm -f debian/$@/usr/bin/autopoint rm -f debian/$@/usr/share/man/man1/autopoint.1 rm -f debian/$@/usr/share/gettext/archive.git.tar.gz gzip -9 debian/$@/usr/share/info/* gzip -r9 debian/$@/usr/share/man sh debian/my-shlibdeps debian/$@/usr/bin/* debian/$@/usr/lib/gettext/* dpkg-gencontrol -p$@ -Pdebian/$@ cd debian/$@ && \ md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums find debian/$@/usr/share/locale -type d -empty | xargs -r rmdir find debian/$@/usr/share/locale -type d -empty | xargs -r rmdir chown -R 0:0 debian/$@ chmod -R u+w,go=rX debian/$@ dpkg --build debian/$@ .. gettext-el: build rm -rf debian/$@ install -d debian/$@/DEBIAN debian/$@/usr/share/doc/$@ cd debian/$@ && install -d \ etc/emacs/site-start.d \ usr/share/emacs/site-lisp/$(package) \ usr/lib/emacsen-common/packages/install \ usr/lib/emacsen-common/packages/remove install -m 644 gettext-tools/misc/po-mode.el \ debian/$@/usr/share/emacs/site-lisp/$(package) install -m 644 gettext-tools/misc/po-compat.el \ debian/$@/usr/share/emacs/site-lisp/$(package) cd debian && install -m 755 install \ $@/usr/lib/emacsen-common/packages/install/$@ cd debian && install -m 755 remove \ $@/usr/lib/emacsen-common/packages/remove/$@ install -m 755 debian/prerm-el debian/$@/DEBIAN/prerm install -m 755 debian/postinst-el debian/$@/DEBIAN/postinst install -m 644 debian/conffiles debian/$@/DEBIAN install -m 644 debian/50gettext.el debian/$@/etc/emacs/site-start.d cp -p debian/copyright debian/$@/usr/share/doc/$@ cp -p ChangeLog debian/$@/usr/share/doc/$@/changelog cp -p debian/changelog debian/$@/usr/share/doc/$@/changelog.Debian cd debian/$@/usr/share/doc/$@ && gzip -9 changelog changelog.Debian dpkg-gencontrol -p$@ -Pdebian/$@ cd debian/$@ && \ md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums chown -R 0:0 debian/$@ chmod -R u+w,go=rX debian/$@ dpkg --build debian/$@ .. gettext-doc: build rm -rf debian/$@ install -d debian/$@/DEBIAN debian/$@/usr/share/doc/$@ install -d debian/$@/usr/share/doc-base install -m 644 debian/$@.doc-base debian/$@/usr/share/doc-base/$@ cp -a debian/tmp/usr/share/doc/gettext/* debian/$@/usr/share/doc/$@ cp -a debian/tmp/usr/share/doc/libasprintf/* debian/$@/usr/share/doc/$@ rm -f debian/$@/usr/share/doc/$@/javadoc2/package-list ln -s $(package)_toc.html debian/$@/usr/share/doc/$@/index.html cp -p debian/copyright debian/$@/usr/share/doc/$@ cp -p ChangeLog debian/$@/usr/share/doc/$@/changelog cp -p debian/changelog debian/$@/usr/share/doc/$@/changelog.Debian cd debian/$@/usr/share/doc/$@ && gzip -9 changelog changelog.Debian dpkg-gencontrol -p$@ -Pdebian/$@ cd debian/$@ && \ md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums chown -R 0:0 debian/$@ chmod -R u+w,go=rX debian/$@ dpkg --build debian/$@ .. autopoint: rm -rf debian/$@ install -d debian/$@/DEBIAN debian/$@/usr/share/doc/$@ cd debian/$@ && install -d usr/bin usr/share/gettext usr/share/man/man1 cp -p debian/tmp/usr/bin/autopoint debian/$@/usr/bin cp -p debian/tmp/usr/share/gettext/archive.git.tar.gz \ debian/$@/usr/share/gettext cp -p debian/tmp/usr/share/man/man1/autopoint.1 \ debian/$@/usr/share/man/man1 gzip -r9 debian/$@/usr/share/man cp -p debian/copyright debian/README.Debian debian/$@/usr/share/doc/$@ cp -p ChangeLog debian/$@/usr/share/doc/$@/changelog cp -p debian/changelog debian/$@/usr/share/doc/$@/changelog.Debian cd debian/$@/usr/share/doc/$@ && gzip -9 changelog changelog.Debian dpkg-gencontrol -p$@ -Pdebian/$@ cd debian/$@ && \ md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums chown -R 0:0 debian/$@ chmod -R u+w,go=rX debian/$@ dpkg --build debian/$@ .. binary: binary-indep binary-arch .PHONY: binary binary-arch binary-indep clean .PHONY: gettext-base gettext gettext-el gettext-doc autopoint