Code

Updated collectd.conf and added thresholds.conf.
[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 # There is no way to tell lt_dlopen() to use the RTLD_GLOBAL flag which is
18 # however required by the perl plugin (which would otherwise be unable to find
19 # symbols defined in libperl when loading perl modules that require such
20 # symbols). This is a workaround for this issue.
21 CFLAGS += -DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL'
23 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24         CFLAGS += -O0
25 else
26         CFLAGS += -O2
27 endif
29 include /usr/share/dpatch/dpatch.make
31 confflags = --host=$(DEB_HOST_GNU_TYPE) \
32                         --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
33                         --mandir=\$${prefix}/share/man \
34                         --localstatedir=/var --sysconfdir=/etc \
35                         --with-perl-bindings="INSTALLDIRS=vendor" \
36                         --disable-xmms \
37                         --without-libstatgrab
39 # These plugins do not provide any functionality under Linux.
40 confflags += --disable-apple_sensors --disable-tape
42 # The static libraries iptc, netstat and upsclient cannot be used on
43 # 64bit systems (see bugs #358637 and #419684 for more details).
44 ifneq (,$(findstring $(DEB_BUILD_ARCH),alpha amd64 hppa ia64 ppc64))
45         confflags += --disable-iptables --disable-netlink --disable-nut
46 endif
48 config.status: configure $(DPATCH_STAMPFN)
49         dh_testdir
50         CFLAGS="$(CFLAGS)" ./configure $(confflags)
52 build: build-stamp
54 build-stamp: config.status
55         dh_testdir
56         
57         $(MAKE)
58         perl ./debian/bin/check_plugins.pl
59         
60         touch build-stamp
62 clean: unpatch
63         dh_testdir
64         dh_testroot
65         rm -f build-stamp
66         
67         [ ! -f Makefile ] || $(MAKE) distclean
68         
69         rm -f debian/README.Debian.plugins
70         
71         dh_clean 
72         debconf-updatepo
74 install-indep:
75         dh_testdir
76         dh_testroot
77         dh_clean -k
78         dh_installdirs -i
79         
80         include_dir=debian/collectd-dev/usr/include/collectd/ \
81                 && mkdir -p $$include_dir/liboconfig \
82                 && cp src/*.h $$include_dir \
83                 && cp src/liboconfig/oconfig.h $$include_dir/liboconfig
85 install-arch: build
86         dh_testdir
87         dh_testroot
88         dh_clean -k 
89         dh_installdirs -a
90         
91         $(MAKE) install DESTDIR=$(CURDIR)/debian/collectd
92         
93         rm -rf debian/collectd/usr/include/
94         rm -f debian/collectd/usr/lib/collectd/*.la
95         
96         rm -f debian/collectd/etc/collectd.conf
97         install -D -m 0644 debian/collectd.conf \
98                 debian/collectd/etc/collectd/collectd.conf
99         install -m 0644 debian/collection.conf \
100                 debian/collectd/etc/collectd/collection.conf
101         install -m 0644 debian/thresholds.conf \
102                 debian/collectd/etc/collectd/thresholds.conf
103         
104         mkdir -p debian/collectd/usr/lib/collectd/utils/
105         for UTIL in extractDS.px migrate-3-4.px; do \
106                 cp contrib/$$UTIL debian/collectd/usr/lib/collectd/utils/; \
107         done
108         
109         perl ./debian/bin/gen_plugin_deps.pl
110         
111         mkdir -p debian/collectd/usr/share/lintian/overrides/
112         cp debian/collectd.overrides \
113                 debian/collectd/usr/share/lintian/overrides/collectd
115 binary-indep: install-indep
116         dh_testdir
117         dh_testroot
118         dh_installchangelogs -i ChangeLog
119         dh_installdocs -A -i debian/README.Debian AUTHORS README TODO
120         dh_installexamples -i contrib/examples/myplugin.c \
121                 contrib/examples/MyPlugin.pm
122         dh_compress -i -Xexamples/myplugin.c -Xexamples/MyPlugin.c
123         dh_fixperms -i
124         dh_installdeb -i
125         dh_gencontrol -i
126         dh_md5sums -i
127         dh_builddeb -i
129 binary-arch: build install-arch
130         dh_testdir
131         dh_testroot
132         dh_installchangelogs -a ChangeLog
133         dh_installdocs -A -a debian/README.Debian AUTHORS README TODO
134         dh_installdocs -a debian/NEWS.Debian debian/README.Debian.plugins
135         dh_installexamples -a contrib/collectd2html.pl contrib/collection.cgi \
136                 contrib/exec-munin.conf contrib/exec-munin.px contrib/exec-smartctl \
137                 contrib/SpamAssassin/ contrib/iptables/ contrib/cussh.pl \
138                 contrib/snmp-data.conf contrib/add_rra.sh contrib/network-proxy.py
139         dh_installdebconf -a
140         dh_installinit -a -- defaults 95
141         dh_link -a
142         dh_strip -a --dbg-package=collectd-dbg
143         dh_compress -a
144         dh_fixperms -a
145         dh_installdeb -a
146         dpkg-shlibdeps -Tdebian/collectd.substvars \
147                 -dDepends debian/collectd/usr/bin/* debian/collectd/usr/sbin/* \
148                 -dRecommends debian/collectd/usr/lib/collectd/*.so
149         dh_gencontrol -a
150         dh_md5sums -a
151         dh_builddeb -a
153 binary: binary-arch binary-indep
154 .PHONY: build clean binary-indep binary-arch binary install-indep install-arch