eec0a6d84a64631aaabd137572dc6ce1adadd97f
1 #!/usr/bin/make -f
2 # debian/rules for liboping
3 #
4 # Written by Sebastian Harl <tokkee@debian.org>
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 CFLAGS = -Wall -g
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17 CFLAGS += -O0
18 else
19 CFLAGS += -O2
20 endif
22 include /usr/share/dpatch/dpatch.make
24 # $srcver-$perlver-$debrev
25 LIBPERL_VERSION := $(shell pm_ver=`perl -MExtUtils::MM -e \
26 'print MM->parse_version("bindings/perl/lib/Net/Oping.pm");'`; \
27 pkg_ver=`dpkg-parsechangelog | egrep '^Version:' | cut -d' ' -f2`; \
28 echo -n "$${pkg_ver%-*}-$$pm_ver-$${pkg_ver\#\#*-}")
30 config.status: configure $(DPATCH_STAMPFN)
31 dh_testdir
33 for file in config.guess config.sub; do \
34 mv $$file $$file.upstream; \
35 ln -s /usr/share/misc/$$file .; \
36 done
38 ./configure \
39 --host=$(DEB_HOST_GNU_TYPE) \
40 --build=$(DEB_BUILD_GNU_TYPE) \
41 --prefix=/usr \
42 --mandir=\$${prefix}/share/man \
43 --with-perl-bindings="INSTALLDIRS=vendor" \
44 CFLAGS="$(CFLAGS)"
46 build: build-stamp
48 build-stamp: config.status
49 dh_testdir
51 $(MAKE) LD_RUN_PATH=""
53 touch build-stamp
55 clean: unpatch
56 dh_testdir
57 dh_testroot
58 rm -f build-stamp
60 [ ! -f Makefile ] || $(MAKE) distclean
62 for file in config.guess config.sub; do \
63 if [ -e $$file.upstream ]; then \
64 rm -f $$file; \
65 mv $$file.upstream $$file; \
66 fi \
67 done
69 dh_clean
71 install: build
72 dh_testdir
73 dh_testroot
74 dh_clean -k
75 dh_installdirs
77 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
79 chmod u+s debian/tmp/usr/bin/oping
80 mkdir -p debian/oping/usr/share/lintian/overrides/
81 cp debian/oping.overrides debian/oping/usr/share/lintian/overrides/oping
83 binary-indep:
84 # nothing to do here
86 binary-arch: build install
87 dh_testdir
88 dh_testroot
89 dh_installchangelogs -Nlibnet-oping-perl ChangeLog
90 dh_installchangelogs -plibnet-oping-perl bindings/perl/Changes
91 dh_installdocs -A AUTHORS
92 dh_installdocs -A -Nlibnet-oping-perl README
93 dh_installdocs -plibnet-oping-perl bindings/perl/README
94 dh_installman
95 dh_install --sourcedir=debian/tmp --fail-missing
96 dh_perl -plibnet-oping-perl
97 dh_link
98 dh_strip
99 dh_compress
100 dh_fixperms -Xusr/bin/oping
101 dh_makeshlibs
102 dh_installdeb
103 dh_shlibdeps -ldebian/liboping0/usr/lib/
104 dh_gencontrol -Nlibnet-oping-perl
105 dh_gencontrol -plibnet-oping-perl -u-v$(LIBPERL_VERSION)
106 dh_md5sums
107 dh_builddeb
109 binary: binary-indep binary-arch
110 .PHONY: build clean binary-indep binary-arch binary install