Code

collectd.conf, control, rules: Disabled the "curl_json" plugin.
[pkg-collectd.git] / debian / rules
1 #! /usr/bin/make -f
2 # debian/rules for collectd
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_ARCH      ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
13 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15 CPPFLAGS = -I$(CURDIR)/debian/include
16 CFLAGS = -Wall -g
18 # There is no way to tell lt_dlopen() to use the RTLD_GLOBAL flag which is
19 # however required by the perl plugin (which would otherwise be unable to find
20 # symbols defined in libperl when loading perl modules that require such
21 # symbols). This is a workaround for this issue.
22 CPPFLAGS += -DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL'
24 # Upstream defaults to ${sysconfdir}/collectd.conf. Setting ${sysconfdir} to
25 # /etc/collectd would be wrong though.
26 CPPFLAGS += -UCONFIGFILE
27 CPPFLAGS += -DCONFIGFILE='\"/etc/collectd/collectd.conf\"'
29 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
30         CFLAGS += -O0
31 else
32         CFLAGS += -O2
33 endif
35 # The archdir map has been copied from openjdk-6's debian/rules.
36 JAVA_ARCHDIR_MAP = armel=arm hppa=parisc lpia=i386 powerpc=ppc
37 JAVA_ARCHDIR = $(strip $(patsubst $(DEB_BUILD_ARCH)=%, %, \
38                         $(filter $(DEB_BUILD_ARCH)=%, $(JAVA_ARCHDIR_MAP))))
39 ifeq (,$(JAVA_ARCHDIR))
40         JAVA_ARCHDIR = $(DEB_BUILD_ARCH)
41 endif
42 JAVA_HOME = /usr/lib/jvm/java-6-openjdk
43 JAVA_LIBDIR = $(JAVA_HOME)/jre/lib/$(JAVA_ARCHDIR)/server
45 JAVAC = $(JAVA_HOME)/bin/javac
46 JAVA_CPPFLAGS = -I$(JAVA_HOME)/include
47 JAVA_LDFLAGS = -L$(JAVA_LIBDIR) -Wl,-rpath -Wl,$(JAVA_LIBDIR)
49 include /usr/share/dpatch/dpatch.make
51 confflags = --host=$(DEB_HOST_GNU_TYPE) \
52                         --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
53                         --mandir=\$${prefix}/share/man \
54                         --localstatedir=/var --sysconfdir=/etc \
55                         --with-perl-bindings="INSTALLDIRS=vendor" \
56                         --without-libstatgrab \
57                         --without-included-ltdl \
58                         --disable-static \
59                         --enable-all-plugins
61 # These plugins do not provide any functionality under Linux.
62 confflags += --disable-apple_sensors --disable-tape
64 # libyajl is required for the curl_json plugin.
65 confflags += --disable-curl_json
67 # libganglia >= 3 is required for the gmond plugin.
68 confflags += --disable-gmond
70 # libmemcached is required for the memcachec plugin.
71 confflags += --disable-memcachec
73 # libnetapp is required for the netapp plugin.
74 confflags += --disable-netapp
76 # libowcapi is required for the onewire plugin.
77 confflags += --disable-onewire
79 # libclntsh is required for the oracle plugin.
80 confflags += --disable-oracle
82 # librouteros is required for the routeros plugin.
83 confflags += --disable-routeros
85 # rrdclient support in librrd is required for the rrdcached plugin.
86 confflags += --disable-rrdcached
88 # libtokyotyrant is required for the tokyotyrant plugin.
89 confflags += --disable-tokyotyrant
91 # xmms1 is required for the xmms plugin.
92 confflags += --disable-xmms
94 # libkstat is required for the xfs_arc plugin.
95 confflags += --disable-zfs-arc
97 # The static library netstat cannot be linked into shared objects on some
98 # architectures (see bugs #358637, #419684 and #524593 for more details).
99 ifneq (,$(filter alpha amd64 hppa ia64 ppc64 mips mipsel, $(DEB_BUILD_ARCH)))
100         confflags += --disable-netlink
101 endif
103 # These plugins are Linux-specific.
104 ifneq (,$(filter kfreebsd-i386 kfreebsd-amd64, $(DEB_BUILD_ARCH)))
105         confflags += \
106                 --disable-iptables \
107                 --disable-ipvs \
108                 --disable-madwifi \
109                 --disable-netlink \
110                 --disable-sensors \
111                 --disable-vserver
112 endif
114 # These plugins have not been ported to FreeBSD yet.
115 ifneq (,$(filter kfreebsd-i386 kfreebsd-amd64, $(DEB_BUILD_ARCH)))
116         confflags += \
117                 --disable-battery \
118                 --disable-conntrack \
119                 --disable-contextswitch \
120                 --disable-cpufreq \
121                 --disable-disk \
122                 --disable-entropy \
123                 --disable-fscache \
124                 --disable-irq \
125                 --disable-nfs \
126                 --disable-protocols \
127                 --disable-serial \
128                 --disable-thermal \
129                 --disable-vmem \
130                 --disable-wireless
131 endif
133 # Build-dependencies of these plugins are (not yet) available for kfreebsd.
134 ifneq (,$(filter kfreebsd-i386 kfreebsd-amd64, $(DEB_BUILD_ARCH)))
135         confflags += \
136                 --disable-gmond \
137                 --disable-libvirt \
138                 --disable-tokyotyrant \
139                 --disable-java
140 endif
142 # The hppa buildds currently do not keep up with Java related stuff, thus
143 # prevending testing transitions.
144 ifneq (,$(filter hppa, $(DEB_BUILD_ARCH)))
145         confflags += --disable-java
146 endif
148 config.status: configure $(DPATCH_STAMPFN)
149         dh_testdir
150         
151         ( cd debian/patches/; for patch in *; do \
152                 if test "$$patch" != "00list"; then \
153                         grep "$$patch" 00list > /dev/null \
154                                 || ( echo "$$patch not enabled\!"; exit 1 ); \
155                 fi; done )
156         
157         # This is a work-around for #474087 (broken openipmi .pc files).
158         mkdir debian/pkgconfig
159         sed -re 's/^(Requires:.*) pthread(.*)$$/\1\2/' \
160                 /usr/lib/pkgconfig/OpenIPMIpthread.pc \
161                 > debian/pkgconfig/OpenIPMIpthread.pc
162         
163         PKG_CONFIG_PATH="$(CURDIR)/debian/pkgconfig:$$PKG_CONFIG_PATH" \
164         ./configure $(confflags) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
165                 JAVAC="$(JAVAC)" JAVA_CPPFLAGS="$(JAVA_CPPFLAGS)" \
166                 JAVA_LDFLAGS="$(JAVA_LDFLAGS)" \
167                 || ( status=$$?; cat config.log; exit $$status )
169 build: build-stamp
171 build-stamp: config.status
172         dh_testdir
173         
174         $(MAKE)
175         perl ./debian/bin/check_plugins.pl
176         
177         touch build-stamp
179 clean: unpatch
180         dh_testdir
181         dh_testroot
182         rm -f build-stamp
183         
184         [ ! -f Makefile ] || $(MAKE) distclean
185         
186         rm -f debian/README.Debian.plugins
187         rm -f src/*.1 src/*.5
188         
189         rm -rf debian/pkgconfig
190         
191         dh_clean
192         debconf-updatepo
194 install-indep:
195         dh_testdir
196         dh_testroot
197         dh_clean -k
198         dh_installdirs -i
199         dh_install -i
201 install-arch: build
202         dh_testdir
203         dh_testroot
204         dh_clean -k
205         dh_installdirs -a
206         
207         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
208         
209         rm -f debian/tmp/usr/lib/collectd/*.la
210         rm -f debian/tmp/usr/lib/libcollectdclient.la
211         rm -f debian/tmp/etc/collectd.conf
212         
213         dh_install -a --sourcedir=$(CURDIR)/debian/tmp --fail-missing
214         
215         perl ./debian/bin/gen_plugin_deps.pl
216         
217         mkdir -p debian/collectd-core/usr/share/lintian/overrides/
218         cp debian/collectd-core.overrides \
219                 debian/collectd-core/usr/share/lintian/overrides/collectd-core
221 binary-indep: install-indep
222         dh_testdir
223         dh_testroot
224         dh_installchangelogs -i ChangeLog
225         dh_installdocs -A -i debian/README.Debian AUTHORS README TODO
226         dh_installexamples -i contrib/examples/myplugin.c \
227                 contrib/examples/MyPlugin.pm
228         dh_compress -i -Xexamples/
229         dh_fixperms -i
230         dh_installdeb -i
231         dh_gencontrol -i
232         dh_md5sums -i
233         dh_builddeb -i
235 binary-arch: build install-arch
236         dh_testdir
237         dh_testroot
238         dh_installchangelogs -a ChangeLog
239         dh_installdocs -A -a debian/README.Debian AUTHORS README TODO
240         dh_installdocs -a debian/NEWS.Debian debian/README.Debian.plugins
241         dh_installexamples -a contrib/collectd2html.pl contrib/collection.cgi \
242                 contrib/collection3/ contrib/php-collection/ \
243                 contrib/exec-munin.conf contrib/exec-munin.px contrib/exec-smartctl \
244                 contrib/exec-nagios.conf contrib/exec-nagios.px \
245                 contrib/SpamAssassin/ contrib/iptables/ contrib/cussh.pl \
246                 contrib/snmp-data.conf contrib/add_rra.sh contrib/network-proxy.py \
247                 contrib/collectd_network.py contrib/collectd_unixsock.py \
248                 contrib/snmp-probe-host.px contrib/GenericJMX.conf \
249                 debian/collectd.conf debian/filters.conf debian/thresholds.conf
250         # some upstream tarballs have been built inside a dirty working dir
251         ( cd debian/collectd-core/ \
252                 && cd usr/share/doc/collectd-core/examples/collection3/ \
253                 && rm -f bin/foo bin/test_config.px etc/collection4.conf \
254                 && rm -f lib/Collectd/Graph.pm lib/Collectd/Graph/Data.pm \
255                 && rm -f lib/Collectd/Graph/File.pm lib/Collectd/Graph/Filter.pm \
256                 && rm -f lib/Collectd/Graph/MetaData.pm )
257         dh_installdebconf -a
258         dh_installinit -pcollectd-core --name=collectd -- defaults 95
259         dh_link -a
260         dh_strip -a --dbg-package=collectd-dbg
261         dh_compress -a -Xexamples/
262         dh_fixperms -a
263         dh_makeshlibs -a
264         dh_installdeb -a
265         dh_shlibdeps -a -Ncollectd-core -Ncollectd
266         dpkg-shlibdeps -Tdebian/collectd.substvars \
267                 -dDepends debian/collectd-core/usr/lib/collectd/rrdtool.so
268         dpkg-shlibdeps -Tdebian/collectd-core.substvars \
269                 -dDepends debian/collectd-core/usr/sbin/* \
270                 -dSuggests debian/collectd-core/usr/lib/collectd/*.so
271         grep shlibs:Suggests debian/collectd-core.substvars \
272                 | sed -e 's/shlibs:Suggests/shlibs:Recommends/' \
273                 >> debian/collectd.substvars
274         dh_gencontrol -a
275         dh_md5sums -a
276         dh_builddeb -a
278 binary: binary-arch binary-indep
279 .PHONY: build clean binary-indep binary-arch binary install-indep install-arch