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 config.status: configure $(DPATCH_STAMPFN)
25 dh_testdir
27 for file in config.guess config.sub; do \
28 mv $$file $$file.upstream; \
29 ln -s /usr/share/misc/$$file .; \
30 done
32 CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
33 --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
34 --mandir=\$${prefix}/share/man
36 build: build-stamp
38 build-stamp: config.status
39 dh_testdir
41 $(MAKE)
43 touch build-stamp
45 clean: unpatch
46 dh_testdir
47 dh_testroot
48 rm -f build-stamp
50 [ ! -f Makefile ] || $(MAKE) distclean
52 for file in config.guess config.sub; do \
53 if [ -e $$file.upstream ]; then \
54 rm -f $$file; \
55 mv $$file.upstream $$file; \
56 fi \
57 done
59 dh_clean
61 install: build
62 dh_testdir
63 dh_testroot
64 dh_clean -k
65 dh_installdirs
67 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
69 chmod u+s debian/tmp/usr/bin/oping
70 mkdir -p debian/oping/usr/share/lintian/overrides/
71 cp debian/oping.overrides debian/oping/usr/share/lintian/overrides/oping
73 binary-indep:
74 # nothing to do here
76 binary-arch: build install
77 dh_testdir
78 dh_testroot
79 dh_installchangelogs ChangeLog
80 dh_installdocs -A README
81 dh_installman
82 dh_install --sourcedir=debian/tmp --list-missing
83 dh_link
84 dh_strip
85 dh_compress
86 dh_fixperms -Xusr/bin/oping
87 dh_makeshlibs
88 dh_installdeb
89 dh_shlibdeps -ldebian/liboping0/usr/lib/
90 dh_gencontrol
91 dh_md5sums
92 dh_builddeb
94 binary: binary-indep binary-arch
95 .PHONY: build clean binary-indep binary-arch binary install