Code

debian/rules: Added --without-libstatgrab to the configure options.
[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 -I$(CURDIR)/debian/include
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                         --with-perl-bindings="INSTALLDIRS=vendor" \
30                         --without-libstatgrab \
31                         --enable-debug
33 # These plugins do not provide any functionality under Linux.
34 confflags += --disable-apple_sensors --disable-tape
36 # The static libraries iptc, netstat and upsclient cannot be used on
37 # 64bit systems (see bugs #358637 and #419684 for more details).
38 ifneq (,$(findstring $(DEB_BUILD_ARCH),alpha amd64 hppa ia64 ppc64))
39         confflags += --disable-iptables --disable-netlink --disable-nut
40 endif
42 config.status: configure $(DPATCH_STAMPFN)
43         dh_testdir
44         CFLAGS="$(CFLAGS)" ./configure $(confflags)
46 build: build-stamp
48 build-stamp: config.status
49         dh_testdir
50         
51         $(MAKE)
52         perl ./debian/bin/check_plugins.pl
53         
54         touch build-stamp
56 clean: unpatch
57         dh_testdir
58         dh_testroot
59         rm -f build-stamp
60         
61         [ ! -f Makefile ] || $(MAKE) distclean
62         
63         rm -f debian/README.Debian.plugins
64         
65         dh_clean 
66         debconf-updatepo
68 install-indep:
69         dh_testdir
70         dh_testroot
71         dh_clean -k
72         dh_installdirs -i
73         
74         include_dir=debian/collectd-dev/usr/include/collectd/ \
75                 && mkdir -p $$include_dir \
76                 && cp src/*.h $$include_dir
78 install-arch: build
79         dh_testdir
80         dh_testroot
81         dh_clean -k 
82         dh_installdirs -a
83         
84         $(MAKE) install DESTDIR=$(CURDIR)/debian/collectd
85         
86         rm -f debian/collectd/usr/lib/collectd/*.la
87         
88         rm -f debian/collectd/etc/collectd.conf
89         install -D -m 0644 debian/collectd.conf \
90                 debian/collectd/etc/collectd/collectd.conf
91         install -m 0644 debian/collection.conf \
92                 debian/collectd/etc/collectd/collection.conf
93         
94         mkdir -p debian/collectd/usr/lib/collectd/utils/
95         for UTIL in extractDS.px migrate-3-4.px; do \
96                 cp contrib/$$UTIL debian/collectd/usr/lib/collectd/utils/; \
97         done
98         
99         perl ./debian/bin/gen_plugin_deps.pl
100         
101         mkdir -p debian/collectd/usr/share/lintian/overrides/
102         cp debian/collectd.overrides \
103                 debian/collectd/usr/share/lintian/overrides/collectd
105 binary-indep: install-indep
106         dh_testdir
107         dh_testroot
108         dh_installchangelogs -i ChangeLog
109         dh_installdocs -A -i debian/README.Debian AUTHORS README TODO
110         dh_installexamples -i contrib/examples/myplugin.c \
111                 contrib/examples/MyPlugin.pm
112         dh_compress -i -Xexamples/myplugin.c -Xexamples/MyPlugin.c
113         dh_fixperms -i
114         dh_installdeb -i
115         dh_gencontrol -i
116         dh_md5sums -i
117         dh_builddeb -i
119 binary-arch: build install-arch
120         dh_testdir
121         dh_testroot
122         dh_installchangelogs -a ChangeLog
123         dh_installdocs -A -a debian/README.Debian AUTHORS README TODO
124         dh_installdocs -a debian/NEWS.Debian debian/README.Debian.plugins
125         dh_installexamples -a contrib/collectd2html.pl contrib/collection.cgi \
126                 contrib/exec-munin.conf contrib/exec-munin.px contrib/exec-smartctl \
127                 contrib/SpamAssassin/ contrib/iptables/ contrib/cussh.pl \
128                 contrib/snmp-data.conf
129         dh_installdebconf -a
130         dh_installinit -a -- defaults 95
131         dh_installman -a src/collectd.1 src/collectd.conf.5
132         dh_link -a
133         dh_strip -a --dbg-package=collectd-dbg
134         dh_compress -a
135         dh_fixperms -a
136         dh_installdeb -a
137         dpkg-shlibdeps -Tdebian/collectd.substvars \
138                 -dDepends debian/collectd/usr/bin/* debian/collectd/usr/sbin/* \
139                 -dRecommends debian/collectd/usr/lib/collectd/*.so
140         dh_gencontrol -a
141         dh_md5sums -a
142         dh_builddeb -a
144 binary: binary-arch binary-indep
145 .PHONY: build clean binary-indep binary-arch binary install-indep install-arch