1 #!/usr/bin/make -f
2 # debian/rules for liboping
3 #
4 # Written by Sebastian Harl <sh@tokkee.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 CFLAGS="$(CFLAGS)" ./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"
45 build: build-stamp
47 build-stamp: config.status
48 dh_testdir
50 $(MAKE) LD_RUN_PATH=""
52 touch build-stamp
54 clean: unpatch
55 dh_testdir
56 dh_testroot
57 rm -f build-stamp
59 [ ! -f Makefile ] || $(MAKE) distclean
61 for file in config.guess config.sub; do \
62 if [ -e $$file.upstream ]; then \
63 rm -f $$file; \
64 mv $$file.upstream $$file; \
65 fi \
66 done
68 dh_clean
70 install: build
71 dh_testdir
72 dh_testroot
73 dh_clean -k
74 dh_installdirs
76 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
78 chmod u+s debian/tmp/usr/bin/oping
79 mkdir -p debian/oping/usr/share/lintian/overrides/
80 cp debian/oping.overrides debian/oping/usr/share/lintian/overrides/oping
82 binary-indep:
83 # nothing to do here
85 binary-arch: build install
86 dh_testdir
87 dh_testroot
88 dh_installchangelogs -Nlibnet-oping-perl ChangeLog
89 dh_installchangelogs -plibnet-oping-perl bindings/perl/Changes
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