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-arch build-indep
46 build-arch: build-stamp
48 build-indep:
49 # nothing to do here
51 build-stamp: config.status
52 dh_testdir
54 $(MAKE) LD_RUN_PATH=""
55 chrpath --delete bindings/perl/blib/arch/auto/Net/Oping/Oping.so
57 touch build-stamp
59 clean:
60 dh_testdir
61 dh_testroot
62 rm -f build-stamp
64 [ ! -f Makefile ] || $(MAKE) distclean
66 for file in config.guess config.sub; do \
67 if [ -e $$file.upstream ]; then \
68 rm -f $$file; \
69 mv $$file.upstream $$file; \
70 fi \
71 done
73 dh_clean
75 # force a rebuild of the manpages
76 rm -f src/mans/*.3 src/mans/*.8
78 install: build
79 dh_testdir
80 dh_testroot
81 dh_prep
82 dh_installdirs
84 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
86 # we do not want .la files in Debian
87 rm -f debian/tmp/usr/lib/liboping.la
89 chmod u+s debian/tmp/usr/bin/oping debian/tmp/usr/bin/noping
90 mkdir -p debian/oping/usr/share/lintian/overrides/
91 cp debian/oping.overrides debian/oping/usr/share/lintian/overrides/oping
93 binary-indep:
94 # nothing to do here
96 binary-arch: build install
97 dh_testdir
98 dh_testroot
99 dh_installchangelogs -Nlibnet-oping-perl ChangeLog
100 dh_installchangelogs -plibnet-oping-perl bindings/perl/Changes
101 dh_installdocs -A debian/README.Debian AUTHORS
102 dh_installdocs -A -Nlibnet-oping-perl README
103 dh_installdocs -plibnet-oping-perl bindings/perl/README
104 dh_installman
105 dh_install --sourcedir=debian/tmp --fail-missing
106 dh_perl -plibnet-oping-perl
107 dh_link
108 dh_strip
109 dh_compress
110 dh_fixperms -Xusr/bin/oping -Xusr/bin/noping
111 dh_makeshlibs
112 dh_installdeb
113 dh_shlibdeps -ldebian/liboping0/usr/lib/
114 dh_gencontrol -Nlibnet-oping-perl
115 dh_gencontrol -plibnet-oping-perl -u-v$(LIBPERL_VERSION)
116 dh_md5sums
117 dh_builddeb
119 binary: binary-indep binary-arch
120 .PHONY: build clean binary-indep binary-arch binary install