diff options
Diffstat (limited to 'debian/rules')
-rw-r--r-- | debian/rules | 232 |
1 files changed, 232 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..6a32cc7 --- /dev/null +++ b/debian/rules @@ -0,0 +1,232 @@ +#!/usr/bin/make -f +# Made with the aid of debmake, by Christoph Lameter, +# based on the sample debian/rules file for GNU hello by Ian Jackson. + +SHELL = /bin/bash + +package=libcompface + +version=1.0.0 #$(shell expr `pwd` : '.*-\([0-9.]*\)') +version_major=1 #$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*') +old_libpath := $(LD_LIBRARY_PATH) +LD_LIBRARY_PATH=shared:$(old_libpath) + + +build: build-libc6 + $(checkdir) + @echo '### Building binaries...' + $(MAKE) LDFLAGS="-s -L$(CURDIR)/shared" + touch build + +build-libc6: + $(checkdir) + @echo LD_LIBRARY_PATH = $(LD_LIBRARY_PATH) + @echo '### Building libc6/glibc2 libraries...' + + -mkdir shared static +# +# First build the shared library +# + cd shared && \ + $(MAKE) -f ../Makefile VPATH=".." srcdir=".." \ + LDFLAGS="-lc"\ + CFLAGS="-O2 -fPIC -pipe -D_BSD_SOURCE -D_REENTRANT" shared && \ + ln -sf $(package).so $(package).so.$(version_major) && \ + ln -sf $(package).so.$(version) $(package).so #&& \ +# strip --strip-unneeded $(package).so.$(version) +# +# Build the static library (it does not need Position Independent Code, +# which reserves one register; thus, without -fPIC we get more efficient +# code). +# + cd static && \ + $(MAKE) -f ../Makefile VPATH=".." srcdir=".." \ + CFLAGS="-O2 -pipe -D_BSD_SOURCE" LDFLAGS="-s" static #&& \ +# strip --strip-debug $(package).a + + touch build-libc6 + +build-libc5: + $(checkdir) + @echo LD_LIBRARY_PATH = $(LD_LIBRARY_PATH) + @echo '### Building libc5 libraries...' + + -cat debian/control.libc5 >> debian/control + -mkdir shared5 static5 +# +# First build the shared library +# + cd shared5 && \ + $(MAKE) -f ../Makefile VPATH=".." srcdir=".." \ + CC=$(avar)-linuxlibc1-gcc\ + LDFLAGS="-lc"\ + CFLAGS="-O2 -fPIC -pipe -D_BSD_SOURCE -D_REENTRANT" shared && \ + ln -sf $(package).so $(package).so.$(version_major) && \ + ln -sf $(package).so.$(version) $(package).so && \ + strip --strip-unneeded $(package).so.$(version) + +# +# Build the static library (it does not need Position Independent Code, +# which reserves one register; thus, without -fPIC we get more efficient +# code). +# + cd static5 && \ + $(MAKE) -f ../Makefile VPATH=".." srcdir=".." \ + CC=$(avar)-linuxlibc1-gcc\ + CFLAGS="-O2 -pipe -D_BSD_SOURCE" LDFLAGS="-s" static && \ + strip --strip-debug $(package).a + + touch build-libc5 + +clean: + $(checkdir) + -rm -rf static shared static5 shared5 + -rm -f build build-* + -make clean + -rm -f `find . -name "*~"` + -rm -rf debian/tmp `find debian/* -type d ! -name CVS` debian/files* core + -rm -f debian/*substvars + -cat debian/control.common > debian/control + -dh_clean + + +binary-indep: checkroot build + $(checkdir) +# There are no architecture-independent files to be uploaded +# generated by this package. If there were any they would be +# made here. + +binary-arch: checkroot build binary-common binary-libc6 + @echo '### Installing architecture dependent files...' +#make install DESTDIR=`pwd`/debian/tmp + + mkdir debian/tmp/usr/share + mkdir debian/tmp/usr/share/doc + mv debian/tmp/usr/man debian/tmp/usr/share/ + mv debian/tmp/usr/doc/compface debian/tmp/usr/share/doc/ + mv debian/tmp/usr/doc/libcompfaceg1 debian/tmp/usr/share/doc/ + cp debian/copyright debian/tmp/usr/share/doc/libcompfaceg1 + cp debian/README.debian debian/tmp/usr/share/doc/libcompfaceg1 + cp debian/changelog debian/tmp/usr/share/doc/libcompfaceg1/changelog.Debian + gzip -9 debian/tmp/usr/share/doc/libcompfaceg1/changelog.Debian + mv debian/tmp/usr/doc/libcompfaceg1-dev debian/tmp/usr/share/doc/ + #gzip -9 debian/tmp/usr/share/man/man1/compface.1 + rm debian/tmp/usr/share/man/man1/uncompface.1 + ln -s compface.1.gz debian/tmp/usr/share/man/man1/uncompface.1.gz +# gzip -9 debian/tmp/usr/share/man/man3/compface.3 + -rm debian/tmp/usr/share/man/man3/uncompface.3 + ln -s compface.3.gz debian/tmp/usr/share/man/man3/uncompface.3.gz + + #debstd + + + #-rm -rf debian/tmp/usr/man + #-rm -rf debian/tmp/usr/doc + #-rm -f debian/tmp/usr/share/doc/libcompface + #-rm -rf debian/tmp/usr/share/doc/libcompfaceg1 + #-rm -rf debian/tmp/usr/lib/libc5-compat + #-rm -rf debian/tmp/usr/share/man/man1 + #-rm -rf debian/tmp/usr/bin + #-rm -rf debian/tmp/usr/$(avar)-linuxlibc1 + #-rm -rf debian/tmp/usr/doc/libcompface + #-rm -rf debian/tmp/usr/share/doc/compface + #-rm -f debian/tmp/usr/share/doc/libcompfaceg1 + #-rm -rf debian/tmp/usr/doc/libcompface1 + #-rm -f debian/tmp/usr/doc/libcompface1-altdev + + dh_installdeb + dh_installdocs + dh_installman + + dh_movefiles + dh_installchangelogs + dh_compress + dh_fixperms + dh_strip + + dh_shlibdeps + dh_md5sums + + #dpkg-gencontrol -plibcompfaceg1-dev -isp + #chown -R root.root debian/tmp + #chmod -R go=rX debian/tmp + #dpkg --build debian/tmp .. + + dh_gencontrol + dh_builddeb + +binary-common: + $(checkdir) + @echo '### Installing common components...' + + -rm -rf debian/tmp `find debian/* -type d` + install -d debian/tmp + + cd debian/tmp && install -d usr/man/man3 usr/man/man1 usr/bin usr/doc/libcompface usr/doc/compface + + install -m644 compface.3 debian/tmp/usr/man/man3/ + install -m644 README debian/tmp/usr/doc/compface + install -m644 debian/copyright debian/tmp/usr/doc/compface + install -m644 debian/changelog debian/tmp/usr/doc/compface/changelog.Debian + gzip -9 debian/tmp/usr/doc/compface/changelog.Debian + + install -m644 compface.1 debian/tmp/usr/man/man1/ + ln -s compface.1 debian/tmp/usr/man/man1/uncompface.1 + install -m744 compface debian/tmp/usr/bin/ + install -m744 uncompface debian/tmp/usr/bin/ + + +binary-libc6: + @echo '### Installing libc6 components...' + + cd debian/tmp && install -d usr/lib usr/include + + install -m644 static/$(package).a debian/tmp/usr/lib/ + install -m644 compface.h debian/tmp/usr/include/ + + -ln -s $(package).so.$(version) debian/tmp/usr/lib/$(package).so + -ln -s $(package).so.$(version) debian/tmp/usr/lib/$(package).so.$(version_major) + + cp shared/$(package).so.$(version) debian/tmp/usr/lib + chmod 644 debian/tmp/usr/lib/$(package).so.$(version) + + -rm -r debian/tmp/usr/doc/libcompface + -mkdir debian/tmp/usr/doc/libcompfaceg1 + -ln -s libcompfaceg1 debian/tmp/usr/doc/libcompface + -ln -s libcompfaceg1 debian/tmp/usr/doc/libcompfaceg1-dev + + +binary-libc5: + @echo '### Installing libc5 components...' + + cd debian/tmp && install -d usr/lib/libc5-compat usr/$(avar)-linuxlibc1/{lib,include} + + install -m644 static5/$(package).a debian/tmp/usr/$(avar)-linuxlibc1/lib/ + install -m644 compface.h debian/tmp/usr/$(avar)-linuxlibc1/include/ + + -ln -s $(package).so.$(version) debian/tmp/usr/lib/libc5-compat/$(package).so + -ln -s $(package).so.$(version) debian/tmp/usr/lib/libc5-compat/$(package).so.$(version_major) + + cp shared5/$(package).so.$(version) debian/tmp/usr/lib/libc5-compat + chmod 644 debian/tmp/usr/lib/libc5-compat/$(package).so.$(version) + + -mkdir debian/tmp/usr/doc/libcompface1 + install -m644 debian/copyright debian/tmp/usr/doc/libcompface1 + install -m644 debian/changelog debian/tmp/usr/doc/libcompface1/changelog.Debian + gzip -9 debian/tmp/usr/doc/libcompface1/changelog.Debian + -ln -s libcompface1 debian/tmp/usr/doc/libcompface1-altdev + + +define checkdir + test -f debian/rules +endef + +# Below here is fairly generic really + +binary: binary-indep binary-arch + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary binary-arch binary-indep clean checkroot |