1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
#!/usr/bin/make -f
# Debian package build rules file for twofish
# This is the debhelper compatability version to use.
export DH_COMPAT=4
# if $DEB_BUILD_OPTIONS *doesn't* contain "noopt"
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
OPTIMIZE:=-O2
endif
# Install files to the following directory.
DESTDIR:=debian/libtwofish-dev
build-arch: build-arch-stamp
build-arch-stamp:
dh_testdir
# -D_REENTRANT is required by Debian Policy (Section 11.2)
gcc -c -o twofish.o $(OPTIMIZE) -D_REENTRANT -g twofish.c
ar clq libtwofish.a twofish.o
ranlib libtwofish.a
# test suite
gcc -o twofishtest $(OPTIMIZE) -g main.c -L. -ltwofish
./twofishtest
touch build-arch-stamp
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp
-rm -f twofish.o libtwofish.a twofishtest
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
install -m 755 -d $(DESTDIR)/usr/lib
install -m 644 libtwofish.a $(DESTDIR)/usr/lib
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs
# XXX: hmm, would be nice to have manpages for this library
#dh_installmanpages
dh_installchangelogs
# XXX: nothing to strip yet
#dh_strip
dh_compress
dh_fixperms
dh_installdeb
# 11:33PM|<Overfiend> doogie_: should -dev packages declare package
# dependencies on shared libs based upon the unresolved symbols within
# their static libraries?
# 11:34PM|<Overfiend> nm libtwofish.a | grep ' U '
# 11:34PM|<Overfiend> U memcpy
# 11:34PM|<Overfiend> U memset
# 11:34PM|<doogie_> I think so
# 11:34PM|<doogie_> those are in libc
# 11:34PM|<Overfiend> doogie_: how much you want to bet almost nobody does?
# 11:34PM|<doogie_> I wouldn't want to bet
# 11:34PM|<Overfiend> objdump is helpless to figure out the needed external
# libraries
# 11:35PM|<Overfiend> because of course, the information dpkg-shlibdeps
# looks for isn't in static libs
# dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
build-indep:
# no architecture-indepdent files to build
binary-indep:
# no architecture-indepdent packages to build
build: build-arch build-indep
binary: binary-arch binary-indep
.PHONY: build binary clean install build-arch build-indep binary-arch binary-indep
|