Code

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