9d2efbf5562ac7005edeb2a11e2c7aaa8fe46cbc
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 # $srcver-$perlver-$debrev
23 LIBPERL_VERSION := $(shell pm_ver=`perl -MExtUtils::MM -e \
24 'print MM->parse_version("bindings/perl/lib/Net/Oping.pm");'`; \
25 pkg_ver=`dpkg-parsechangelog | egrep '^Version:' | cut -d' ' -f2`; \
26 echo -n "$${pkg_ver%-*}-$$pm_ver-$${pkg_ver\#\#*-}")
28 config.status: configure
29 dh_testdir
31 for file in config.guess config.sub; do \
32 mv $$file $$file.upstream; \
33 ln -s /usr/share/misc/$$file .; \
34 done
36 ./configure \
37 --host=$(DEB_HOST_GNU_TYPE) \
38 --build=$(DEB_BUILD_GNU_TYPE) \
39 --prefix=/usr \
40 --mandir=\$${prefix}/share/man \
41 --with-perl-bindings="INSTALLDIRS=vendor" \
42 CFLAGS="$(CFLAGS)"
44 build: build-stamp
46 build-stamp: config.status
47 dh_testdir
49 $(MAKE) LD_RUN_PATH=""
51 touch build-stamp
53 clean:
54 dh_testdir
55 dh_testroot
56 rm -f build-stamp
58 [ ! -f Makefile ] || $(MAKE) distclean
60 for file in config.guess config.sub; do \
61 if [ -e $$file.upstream ]; then \
62 rm -f $$file; \
63 mv $$file.upstream $$file; \
64 fi \
65 done
67 dh_clean
69 # force a rebuild of the manpages
70 rm -f src/mans/*.3 src/mans/*.8
72 install: build
73 dh_testdir
74 dh_testroot
75 dh_clean -k
76 dh_installdirs
78 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
80 chmod u+s debian/tmp/usr/bin/oping
81 mkdir -p debian/oping/usr/share/lintian/overrides/
82 cp debian/oping.overrides debian/oping/usr/share/lintian/overrides/oping
84 binary-indep:
85 # nothing to do here
87 binary-arch: build install
88 dh_testdir
89 dh_testroot
90 dh_installchangelogs -Nlibnet-oping-perl ChangeLog
91 dh_installchangelogs -plibnet-oping-perl bindings/perl/Changes
92 dh_installdocs -A AUTHORS
93 dh_installdocs -A -Nlibnet-oping-perl README
94 dh_installdocs -plibnet-oping-perl bindings/perl/README
95 dh_installman
96 dh_install --sourcedir=debian/tmp --fail-missing
97 dh_perl -plibnet-oping-perl
98 dh_link
99 dh_strip
100 dh_compress
101 dh_fixperms -Xusr/bin/oping
102 dh_makeshlibs
103 dh_installdeb
104 dh_shlibdeps -ldebian/liboping0/usr/lib/
105 dh_gencontrol -Nlibnet-oping-perl
106 dh_gencontrol -plibnet-oping-perl -u-v$(LIBPERL_VERSION)
107 dh_md5sums
108 dh_builddeb
110 binary: binary-indep binary-arch
111 .PHONY: build clean binary-indep binary-arch binary install