Code

Imported diff on NMU 1.6.1+2.g207d51d-1.1.
[pkg-liboping.git] / debian / rules
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
30         
31         for file in config.guess config.sub; do \
32                 mv $$file $$file.upstream; \
33                 ln -s /usr/share/misc/$$file .; \
34         done
35         
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
48         
49         $(MAKE) LD_RUN_PATH=""
50         chrpath --delete bindings/perl/blib/arch/auto/Net/Oping/Oping.so
51         
52         touch build-stamp
54 clean:
55         dh_testdir
56         dh_testroot
57         rm -f build-stamp
58         
59         [ ! -f Makefile ] || $(MAKE) distclean
60         
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
67         
68         dh_clean
69         
70         # force a rebuild of the manpages
71         rm -f src/mans/*.3 src/mans/*.8
73 install: build
74         dh_testdir
75         dh_testroot
76         dh_prep
77         dh_installdirs
78         
79         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
80         
81         # we do not want .la files in Debian
82         rm -f debian/tmp/usr/lib/liboping.la
83         
84         chmod u+s debian/tmp/usr/bin/oping debian/tmp/usr/bin/noping
85         mkdir -p debian/oping/usr/share/lintian/overrides/
86         cp debian/oping.overrides debian/oping/usr/share/lintian/overrides/oping
87         
88 binary-indep:
89         # nothing to do here
91 binary-arch: build install
92         dh_testdir
93         dh_testroot
94         dh_installchangelogs -Nlibnet-oping-perl ChangeLog
95         dh_installchangelogs -plibnet-oping-perl bindings/perl/Changes
96         dh_installdocs -A debian/README.Debian AUTHORS
97         dh_installdocs -A -Nlibnet-oping-perl README
98         dh_installdocs -plibnet-oping-perl bindings/perl/README
99         dh_installman
100         dh_install --sourcedir=debian/tmp --fail-missing
101         dh_perl -plibnet-oping-perl
102         dh_link
103         dh_strip
104         dh_compress
105         dh_fixperms -Xusr/bin/oping -Xusr/bin/noping
106         dh_makeshlibs
107         dh_installdeb
108         dh_shlibdeps -ldebian/liboping0/usr/lib/
109         dh_gencontrol -Nlibnet-oping-perl
110         dh_gencontrol -plibnet-oping-perl -u-v$(LIBPERL_VERSION)
111         dh_md5sums
112         dh_builddeb
114 binary: binary-indep binary-arch
115 .PHONY: build clean binary-indep binary-arch binary install