5c1409c61b82b697d58f59bae6a51e56af1ea8d9
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 install: build
70 dh_testdir
71 dh_testroot
72 dh_clean -k
73 dh_installdirs
75 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
77 chmod u+s debian/tmp/usr/bin/oping
78 mkdir -p debian/oping/usr/share/lintian/overrides/
79 cp debian/oping.overrides debian/oping/usr/share/lintian/overrides/oping
81 binary-indep:
82 # nothing to do here
84 binary-arch: build install
85 dh_testdir
86 dh_testroot
87 dh_installchangelogs -Nlibnet-oping-perl ChangeLog
88 dh_installchangelogs -plibnet-oping-perl bindings/perl/Changes
89 dh_installdocs -A AUTHORS
90 dh_installdocs -A -Nlibnet-oping-perl README
91 dh_installdocs -plibnet-oping-perl bindings/perl/README
92 dh_installman
93 dh_install --sourcedir=debian/tmp --fail-missing
94 dh_perl -plibnet-oping-perl
95 dh_link
96 dh_strip
97 dh_compress
98 dh_fixperms -Xusr/bin/oping
99 dh_makeshlibs
100 dh_installdeb
101 dh_shlibdeps -ldebian/liboping0/usr/lib/
102 dh_gencontrol -Nlibnet-oping-perl
103 dh_gencontrol -plibnet-oping-perl -u-v$(LIBPERL_VERSION)
104 dh_md5sums
105 dh_builddeb
107 binary: binary-indep binary-arch
108 .PHONY: build clean binary-indep binary-arch binary install