Code

debian/rules: Removed unnecessary call to dh_shlibdeps(1).
[pkg-collectd.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for collectd
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_ARCH      ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
13 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15 CFLAGS = -Wall -g
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21 endif
23 include /usr/share/dpatch/dpatch.make
25 confflags = --host=$(DEB_HOST_GNU_TYPE) \
26                         --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
27                         --mandir=\$${prefix}/share/man \
28                         --localstatedir=/var --sysconfdir=/etc \
29                         --enable-debug
31 # These plugins do not provide any functionality under Linux.
32 confflags += --disable-apple_sensors --disable-tape
34 # The static libraries iptc and upsclient cannot be used on 64bit systems
35 # (see bugs #358637 and #419684 for more details).
36 ifneq (,$(findstring $(DEB_BUILD_ARCH),alpha amd64 hppa ia64 ppc64))
37         confflags += --disable-iptables --disable-nut
38 endif
40 config.status: configure $(DPATCH_STAMPFN)
41         dh_testdir
42         CFLAGS="$(CFLAGS)" ./configure $(confflags)
44 build: build-stamp
46 build-stamp: config.status
47         dh_testdir
48         
49         $(MAKE)
50         perl ./debian/check_plugins.pl
51         
52         touch build-stamp
54 clean: unpatch
55         dh_testdir
56         dh_testroot
57         rm -f build-stamp
58         
59         -$(MAKE) distclean
60         
61         dh_clean 
62         debconf-updatepo
64 install-indep:
65         dh_testdir
66         dh_testroot
67         dh_clean -k
68         dh_installdirs -i
69         
70         include_dir=debian/collectd-dev/usr/include/collectd/ \
71                 && mkdir -p $$include_dir \
72                 && cp src/*.h $$include_dir
74 install-arch: build
75         dh_testdir
76         dh_testroot
77         dh_clean -k 
78         dh_installdirs -a
79         
80         $(MAKE) install DESTDIR=$(CURDIR)/debian/collectd
81         
82         rm -f debian/collectd/usr/lib/collectd/*.la
83         
84         rm -f debian/collectd/etc/collectd.conf
85         install -D -m 0644 debian/collectd.conf \
86                 debian/collectd/etc/collectd/collectd.conf
87         install -m 0644 debian/collection.conf \
88                 debian/collectd/etc/collectd/collection.conf
89         
90         mkdir -p debian/collectd/usr/lib/collectd/utils/
91         for UTIL in extractDS.px migrate-3-4.px; do \
92                 cp contrib/$$UTIL debian/collectd/usr/lib/collectd/utils/; \
93         done
95 binary-indep: install-indep
96         dh_testdir
97         dh_testroot
98         dh_installchangelogs -i ChangeLog
99         dh_installdocs -A -i debian/README.Debian AUTHORS README TODO
100         dh_installexamples -i debian/examples/myplugin.c \
101                 debian/examples/MyPlugin.pm
102         dh_compress -i
103         dh_fixperms -i
104         dh_installdeb -i
105         dh_gencontrol -i
106         dh_md5sums -i
107         dh_builddeb -i
109 binary-arch: build install-arch
110         dh_testdir
111         dh_testroot
112         dh_installchangelogs -a ChangeLog
113         dh_installdocs -A -a debian/README.Debian AUTHORS README TODO
114         dh_installdocs -a debian/NEWS.Debian
115         dh_installexamples -a contrib/collectd2html.pl contrib/collection.cgi \
116                 contrib/PerlLib/ contrib/SpamAssassin/ contrib/iptables/
117         dh_installdebconf -a
118         dh_installinit -a -- defaults 95
119         dh_installman -a src/collectd.1 src/collectd.conf.5
120         dh_link -a
121         dh_strip -a --dbg-package=collectd-dbg
122         dh_compress -a
123         dh_fixperms -a
124         dh_installdeb -a
125         dpkg-shlibdeps -Tdebian/collectd.substvars \
126                 -dDepends debian/collectd/usr/bin/* debian/collectd/usr/sbin/* \
127                 -dRecommends debian/collectd/usr/lib/collectd/*.so
128         dh_gencontrol -a
129         dh_md5sums -a
130         dh_builddeb -a
132 binary: binary-arch binary-indep
133 .PHONY: build clean binary-indep binary-arch binary install-indep install-arch