Code

Added email-ignore-size-le-0.dpatch and sensors-ignorelist.dpatch.
[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_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 CFLAGS = -Wall -g
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17         CFLAGS += -O0
18 else
19         CFLAGS += -O2
20 endif
22 include /usr/share/dpatch/dpatch.make
24 config.status: configure
25         dh_testdir
26         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
27                         --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
28                         --mandir=\$${prefix}/share/man \
29                         --localstatedir=/var --sysconfdir=/etc
31 build: build-stamp
33 build-stamp: config.status patch
34         dh_testdir
35         
36         $(MAKE)
37         
38         touch build-stamp
40 clean: unpatch
41         dh_testdir
42         dh_testroot
43         rm -f build-stamp
44         
45         -$(MAKE) distclean
46         
47         dh_clean 
49 install-indep:
50         dh_testdir
51         dh_testroot
52         dh_clean -k
53         dh_installdirs -i
54         
55         include_dir=$(CURDIR)/debian/collectd-dev/usr/include/collectd/ \
56                 && mkdir -p $$include_dir \
57                 && cp src/*.h $$include_dir
59 install-arch: build
60         dh_testdir
61         dh_testroot
62         dh_clean -k 
63         dh_installdirs -a
64         
65         $(MAKE) install DESTDIR=$(CURDIR)/debian/collectd
66         
67         rm -f $(CURDIR)/debian/collectd/usr/lib/collectd/*.la
68         
69         rm -f $(CURDIR)/debian/collectd/etc/collectd.conf
70         install -D -m 0644 $(CURDIR)/debian/collectd.conf \
71                 $(CURDIR)/debian/collectd/etc/collectd/collectd.conf
72         
73         for PLUGIN in apache dns mysql ping sensors; do \
74                 plugin_dir=$(CURDIR)/debian/collectd-$$PLUGIN/usr/lib/collectd/; \
75                 mkdir -p $$plugin_dir; \
76                 mv $(CURDIR)/debian/collectd/usr/lib/collectd/$$PLUGIN.so \
77                         $$plugin_dir; \
78         done    
80 binary-indep: install-indep
81         dh_testdir
82         dh_testroot
83         dh_installchangelogs -i ChangeLog
84         dh_installdocs -A -i debian/README.Debian AUTHORS README TODO
85         dh_installexamples -i debian/examples/myplugin.c
86         dh_compress -i
87         dh_fixperms -i
88         dh_installdeb -i
89         dh_gencontrol -i
90         dh_md5sums -i
91         dh_builddeb -i
93 binary-arch: build install-arch
94         dh_testdir
95         dh_testroot
96         dh_installchangelogs -a ChangeLog
97         dh_installdocs -A -a debian/README.Debian AUTHORS README TODO
98         dh_installexamples -a contrib/collectd2html.pl contrib/collection.cgi
99         dh_installinit -a -- defaults 95
100         dh_installman -a src/collectd.1 src/collectd.conf.5
101         dh_link -a
102         dh_strip -a --dbg-package=collectd-dbg
103         dh_compress -a
104         dh_fixperms -a
105         dh_installdeb -a
106         dh_shlibdeps -a
107         dh_gencontrol -a
108         dh_md5sums -a
109         dh_builddeb -a
111 binary: binary-arch binary-indep
112 .PHONY: build clean binary-indep binary-arch binary install-indep install-arch