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 90 91 92 93 94 95 96 97 98 99
|
STRIP = strip --remove-section=.comment --remove-section=.note
BUILD_DATE=$(shell dpkg-parsechangelog --show-field Date)
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
build:
$(checkdir)
dh_autoreconf
./configure --prefix=/usr --enable-shared
$(MAKE) install prefix=$(CURDIR)/shared
[ ! -f Makefile ] || $(MAKE) distclean
-rm -f config.log config.cache
./configure --prefix=/usr --enable-static
$(MAKE) install prefix=$(CURDIR)/static
touch build
clean:
$(checkdir)
-rm -f build
[ ! -f Makefile ] || $(MAKE) distclean
-rm -f config.log config.cache
-rm -f `find . -name "*~"`
-rm -rf shared static
-rm -rf debian/tmp debian/files* core debian/substvars
-rm -rf debian/libranlip1c2 debian/libranlip-dev
dh_autoreconf_clean
-rm -rf debian/*debhelper.log
binary-indep: checkroot build
$(checkdir)
-rm -rf debian/tmp
binary-arch: checkroot build
$(checkdir)
-rm -rf debian/tmp
-rm -rf debian/libranlip1c2 debian/libranlip-dev
install -d debian/tmp/DEBIAN debian/libranlip1c2/usr/share/doc/libranlip1c2/examples
cd debian && install -d libranlip1c2 libranlip-dev
cd debian/libranlip1c2 && install -d DEBIAN usr/share/doc usr/lib/ranlip
cd debian/libranlip-dev && install -d DEBIAN usr/share/doc usr/lib/ranlip usr/include/ranlip
cd debian && install -m 644 shlibs libranlip1c2/DEBIAN
cd shared/lib && $(STRIP) --strip-unneeded libranlip.so.1.0.0
cd static/lib && strip --strip-debug libranlip.a
mv shared/lib/libranlip.so.* debian/libranlip1c2/usr/lib/ranlip
mv shared/lib/libranlip.so debian/libranlip-dev/usr/lib/ranlip
sed "s/^libdir=.*/libdir=\'\/usr\/lib\/ranlip\'/" shared/lib/libranlip.la > debian/libranlip-dev/usr/lib/ranlip/libranlip.la
mv static/lib/libranlip.a debian/libranlip-dev/usr/lib/ranlip
sed "s/^#include \"ranlipdist.h\"/#include <ranlip\/ranlipdist.h>/" static/include/ranlip.h > debian/libranlip-dev/usr/include/ranlip/ranlip.h
mv static/include/ranlipdist.h static/include/ranlipproc.h debian/libranlip-dev/usr/include/ranlip
chmod +r debian/libranlip-dev/usr/include/ranlip/*
cp -p debian/copyright debian/libranlip1c2/usr/share/doc/libranlip1c2
cp -p debian/changelog debian/libranlip1c2/usr/share/doc/libranlip1c2/changelog.Debian
cp -p docs/ranlip.ps debian/libranlip1c2/usr/share/doc/libranlip1c2/
cp -p examples/ranliptest* examples/makefile debian/libranlip1c2/usr/share/doc/libranlip1c2/examples
cd debian/libranlip1c2/usr/share/doc/libranlip1c2 && gzip -9n changelog.Debian ranlip.ps examples/*
ln -s libranlip1c2 debian/libranlip-dev/usr/share/doc/libranlip-dev
dpkg-shlibdeps debian/libranlip1c2/usr/lib/ranlip/*
dpkg-gencontrol -isp -plibranlip1c2 -Pdebian/libranlip1c2
cd debian/libranlip1c2 && md5sum `find * -type f ! -regex "DEBIAN/.*"` | LC_ALL=C sort > DEBIAN/md5sums
chown -R root.root debian/libranlip1c2
chmod -x debian/libranlip1c2/usr/lib/ranlip/*
chmod -R go=rX debian/libranlip1c2
find debian/libranlip1c2 -depth -newermt '$(BUILD_DATE)' -print0 | \
xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
dpkg --build debian/libranlip1c2 ..
dpkg-gencontrol -isp -plibranlip-dev -Pdebian/libranlip-dev
cd debian/libranlip-dev && md5sum `find * -type f ! -regex "DEBIAN/.*"` | LC_ALL=C sort > DEBIAN/md5sums
chown -R root.root debian/libranlip-dev
chmod -x debian/libranlip-dev/usr/lib/ranlip/libranlip.a debian/libranlip-dev/usr/lib/ranlip/libranlip.la
chmod -R go=rX debian/libranlip-dev
find debian/libranlip-dev -depth -newermt '$(BUILD_DATE)' -print0 | \
xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
dpkg --build debian/libranlip-dev ..
define checkdir
test -f debian/rules
endef
binary: binary-indep binary-arch
checkroot:
$(checkdir)
test root = "`whoami`"
build-arch: build
build-indep: build
.PHONY: build build-arch build-indep binary binary-arch binary-indep clean checkroot
|