Code

rules, control, collectd.conf: Disabled memcachec 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 (,$(findstring 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 = alpha=alpha arm=arm armel=arm amd64=amd64 hppa=parisc \
37                         i386=i386 lpia=i386 m68k=m68k mips=mips mipsel=mipsel \
38                         powerpc=ppc sparc=sparc s390=s390 ia64=ia64
39 JAVA_ARCHDIR = $(strip $(patsubst $(DEB_BUILD_ARCH)=%, %, \
40                         $(filter $(DEB_BUILD_ARCH)=%, $(JAVA_ARCHDIR_MAP))))
41 JAVA_HOME = /usr/lib/jvm/java-6-openjdk
42 JAVA_LIBDIR = $(JAVA_HOME)/jre/lib/$(JAVA_ARCHDIR)/server
44 JAVAC = $(JAVA_HOME)/bin/javac
45 JAVA_CPPFLAGS = -I$(JAVA_HOME)/include
46 JAVA_LDFLAGS = -L$(JAVA_LIBDIR) -Wl,-rpath -Wl,$(JAVA_LIBDIR)
48 include /usr/share/dpatch/dpatch.make
50 confflags = --host=$(DEB_HOST_GNU_TYPE) \
51                         --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
52                         --mandir=\$${prefix}/share/man \
53                         --localstatedir=/var --sysconfdir=/etc \
54                         --with-perl-bindings="INSTALLDIRS=vendor" \
55                         --without-libstatgrab \
56                         --without-included-ltdl \
57                         --disable-static \
58                         --enable-all-plugins
60 # These plugins do not provide any functionality under Linux.
61 confflags += --disable-apple_sensors --disable-tape
63 # libganglia >= 3 is required for the gmond plugin.
64 confflags += --disable-gmond
66 # libmemcached is required for the memcachec plugin.
67 confflags += --disable-memcachec
69 # libowcapi is required for the onewire plugin.
70 confflags += --disable-onewire
72 # libclntsh is required for the oracle plugin.
73 confflags += --disable-oracle
75 # rrdclient support in librrd is required for the rrdcached plugin.
76 confflags += --disable-rrdcached
78 # libtokyotyrant is required for the tokyotyrant plugin.
79 confflags += --disable-tokyotyrant
81 # xmms1 is required for the xmms plugin.
82 confflags += --disable-xmms
84 # libkstat is required for the xfs_arc plugin.
85 confflags += --disable-zfs-arc
87 # libdbi is not available on Etch
88 confflags += --disable-dbi
90 # The static library netstat and upsclient cannot be linked into shared
91 # objects on some architectures (see bugs #358637, #419684 and #524593 for
92 # more details).
93 ifneq (,$(findstring $(DEB_BUILD_ARCH),alpha amd64 hppa ia64 ppc64 mips mipsel))
94         confflags += --disable-netlink --disable-nut
95 endif
97 # The hppa buildds currently do not keep up with Java related stuff, thus
98 # prevending testing transitions.
99 ifneq (,$(findstring $(DEB_BUILD_ARCH),hppa))
100         confflags += --disable-java
101 endif
103 config.status: configure $(DPATCH_STAMPFN)
104         dh_testdir
105         
106         # This is a work-around for #474087 (broken openipmi .pc files).
107         mkdir debian/pkgconfig
108         sed -re 's/^(Requires:.*) pthread(.*)$$/\1\2/' \
109                 /usr/lib/pkgconfig/OpenIPMIpthread.pc \
110                 > debian/pkgconfig/OpenIPMIpthread.pc
111         
112         PKG_CONFIG_PATH="$(CURDIR)/debian/pkgconfig:$$PKG_CONFIG_PATH" \
113         ./configure $(confflags) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
114                 JAVAC="$(JAVAC)" JAVA_CPPFLAGS="$(JAVA_CPPFLAGS)" \
115                 JAVA_LDFLAGS="$(JAVA_LDFLAGS)" \
116                 || ( status=$$?; cat config.log; exit $$status )
118 build: build-stamp
120 build-stamp: config.status
121         dh_testdir
122         
123         $(MAKE)
124         perl ./debian/bin/check_plugins.pl
125         
126         touch build-stamp
128 clean: unpatch
129         dh_testdir
130         dh_testroot
131         rm -f build-stamp
132         
133         [ ! -f Makefile ] || $(MAKE) distclean
134         
135         rm -f debian/README.Debian.plugins
136         rm -f src/*.1 src/*.5
137         
138         rm -rf debian/pkgconfig
139         
140         dh_clean
141         debconf-updatepo
143 install-indep:
144         dh_testdir
145         dh_testroot
146         dh_clean -k
147         dh_installdirs -i
148         dh_install -i
150 install-arch: build
151         dh_testdir
152         dh_testroot
153         dh_clean -k
154         dh_installdirs -a
155         
156         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
157         
158         rm -f debian/tmp/usr/lib/collectd/*.la
159         rm -f debian/tmp/usr/lib/libcollectdclient.la
160         rm -f debian/tmp/etc/collectd.conf
161         
162         dh_install -a --sourcedir=$(CURDIR)/debian/tmp --fail-missing
163         
164         perl ./debian/bin/gen_plugin_deps.pl
165         
166         mkdir -p debian/collectd-core/usr/share/lintian/overrides/
167         cp debian/collectd-core.overrides \
168                 debian/collectd-core/usr/share/lintian/overrides/collectd-core
170 binary-indep: install-indep
171         dh_testdir
172         dh_testroot
173         dh_installchangelogs -i ChangeLog
174         dh_installdocs -A -i debian/README.Debian AUTHORS README TODO
175         dh_installexamples -i contrib/examples/myplugin.c \
176                 contrib/examples/MyPlugin.pm
177         dh_compress -i -Xexamples/
178         dh_fixperms -i
179         dh_installdeb -i
180         dh_gencontrol -i
181         dh_md5sums -i
182         dh_builddeb -i
184 binary-arch: build install-arch
185         dh_testdir
186         dh_testroot
187         dh_installchangelogs -a ChangeLog
188         dh_installdocs -A -a debian/README.Debian AUTHORS README TODO
189         dh_installdocs -a debian/NEWS.Debian debian/README.Debian.plugins
190         dh_installexamples -a contrib/collectd2html.pl contrib/collection.cgi \
191                 contrib/collection3/ contrib/php-collection/ \
192                 contrib/exec-munin.conf contrib/exec-munin.px contrib/exec-smartctl \
193                 contrib/exec-nagios.conf contrib/exec-nagios.px \
194                 contrib/SpamAssassin/ contrib/iptables/ contrib/cussh.pl \
195                 contrib/snmp-data.conf contrib/add_rra.sh contrib/network-proxy.py \
196                 contrib/collectd_network.py contrib/collectd_unixsock.py \
197                 contrib/snmp-probe-host.px contrib/GenericJMX.conf \
198                 debian/collectd.conf debian/filters.conf debian/thresholds.conf
199         # some upstream tarballs have been built inside a dirty working dir
200         ( cd debian/collectd-core/ \
201                 && cd usr/share/doc/collectd-core/examples/collection3/ \
202                 && rm -f bin/foo bin/test_config.px etc/collection4.conf \
203                 && rm -f lib/Collectd/Graph.pm lib/Collectd/Graph/Data.pm \
204                 && rm -f lib/Collectd/Graph/File.pm lib/Collectd/Graph/Filter.pm \
205                 && rm -f lib/Collectd/Graph/MetaData.pm )
206         dh_installdebconf -a
207         dh_installinit -pcollectd-core --name=collectd -- defaults 95
208         dh_link -a
209         dh_strip -a --dbg-package=collectd-dbg
210         dh_compress -a -Xexamples/
211         dh_fixperms -a
212         dh_makeshlibs -a
213         dh_installdeb -a
214         dh_shlibdeps -a -Ncollectd-core -Ncollectd
215         dpkg-shlibdeps -Tdebian/collectd.substvars \
216                 -dDepends debian/collectd-core/usr/lib/collectd/rrdtool.so
217         dpkg-shlibdeps -Tdebian/collectd-core.substvars \
218                 -dDepends debian/collectd-core/usr/sbin/* \
219                 -dSuggests debian/collectd-core/usr/lib/collectd/*.so
220         grep shlibs:Suggests debian/collectd-core.substvars \
221                 | sed -e 's/shlibs:Suggests/shlibs:Recommends/' \
222                 >> debian/collectd.substvars
223         dh_gencontrol -a
224         dh_md5sums -a
225         dh_builddeb -a
227 binary: binary-arch binary-indep
228 .PHONY: build clean binary-indep binary-arch binary install-indep install-arch