Code

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