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 100 101 102 103 104 105 106 107 108
|
#!/usr/bin/make -f
.PHONY: clean configure build install binary binary-arch binary-indep
include /usr/share/dpatch/dpatch.make
build-arch: build
build-indep: build
build: build-stamp
install: install-stamp
binary: binary-arch binary-indep
COMMA = ,
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
endif
configure-stamp: patch-stamp
dh_testdir
dh_prep -k
cp /usr/share/misc/config.sub \
/usr/share/misc/config.guess \
config/
aclocal -I . -I config
libtoolize -c
autoheader
automake --add-missing
autoconf
./configure --prefix=/usr \
--mandir=/usr/share/man \
--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
--with-python \
$(shell dpkg-buildflags --export=cmdline)
rm -f python/*.c
touch $@
build-stamp: configure-stamp
dh_testdir
$(MAKE) $(NJOBS)
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
# Running test suite. Errors are being ignored because several tests
# are bound to fail:
# * check_addr: fails because glibc gethostbyname() accepts malformed
# IPs
# * check_ip: fails because test includes binding to a RAW socket
# which requires CAP_NET_ADMIN
# * check_fw: fails because Linux doesn't provide a simple userspace
# fw API (and libdumbnet therefore includes its fw-none module which
# just returns ENOSYS)
-$(MAKE) -C test/check check-am
endif
touch $@
install-stamp: build-stamp
dh_testdir
touch $@
binary-indep:
binary-arch: install-stamp
dh_testdir
dh_testroot
$(MAKE) DESTDIR=$(CURDIR)/debian/libdumbnet1 install
mkdir -p debian/libdumbnet-dev/usr/lib/$(DEB_HOST_MULTIARCH) \
debian/libdumbnet-dev/usr/share/doc/libdumbnet-dev \
debian/libdumbnet-dev/usr/share/man/man1
mkdir -p debian/python-dumbnet/usr/lib
mv debian/libdumbnet1/usr/include \
debian/libdumbnet1/usr/sbin \
debian/libdumbnet1/usr/bin \
debian/libdumbnet-dev/usr/
mv debian/libdumbnet1/usr/share/man/* \
debian/libdumbnet-dev/usr/share/man/
mv debian/libdumbnet1/usr/lib/$(DEB_HOST_MULTIARCH)/libdumbnet.a \
debian/libdumbnet1/usr/lib/$(DEB_HOST_MULTIARCH)/libdumbnet.so \
debian/libdumbnet-dev/usr/lib/$(DEB_HOST_MULTIARCH)/
mv debian/libdumbnet1/usr/lib/python* \
debian/python-dumbnet/usr/lib
cp debian/dumbnet-config.1 debian/libdumbnet-dev/usr/share/man/man1/
ln -s dumbnet-config.1 debian/libdumbnet-dev/usr/share/man/man1/dnet-config.1
ln -s ../libdumbnet1 debian/libdumbnet-dev/usr/share/doc/libdumbnet-dev/docs
ln -s dumbnet-config debian/libdumbnet-dev/usr/bin/dnet-config
dh_installchangelogs
dh_installdocs -plibdumbnet1 TODO README
dh_installdocs -Nlibdumbnet1
dh_python2 -ppython-dumbnet
for E in debian/python-dumbnet/usr/lib/python*; do \
rm -f $$E/site-packages/*egg-info; \
done
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_md5sums
dh_gencontrol
dh_builddeb
clean:
rm -f *-stamp
[ ! -f Makefile ] || $(MAKE) clean maintainer-clean
rm -rf autom4te.cache/ config/config.sub config/config.guess \
configure config/ltmain.sh aclocal.m4 python/*.c \
python/Makefile python/setup.py
find . -\( -name Makefile.in -or -name config.h.in -\) -print0 | xargs -0r -- rm -f
dpatch deapply-all
dh_clean
|