liboconfig: Include the filename in error messages.
[collectd.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for collectd
3 #
4 # Written by Sebastian Harl <sh@tokkee.org>.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
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)
13
14 CFLAGS = -Wall -g
15
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17         CFLAGS += -O0
18 else
19         CFLAGS += -O2
20 endif
21
22 config.status: configure
23         dh_testdir
24         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
25                         --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
26                         --mandir=\$${prefix}/share/man \
27                         --localstatedir=/var --sysconfdir=/etc
28
29 build: build-stamp
30
31 build-stamp: config.status
32         dh_testdir
33         
34         $(MAKE)
35         
36         touch build-stamp
37
38 clean:
39         dh_testdir
40         dh_testroot
41         rm -f build-stamp
42         
43         -$(MAKE) distclean
44         
45         dh_clean 
46
47 install-indep:
48         dh_testdir
49         dh_testroot
50         dh_clean -k
51         dh_installdirs -i
52         
53         include_dir=$(CURDIR)/debian/collectd-dev/usr/include/collectd/ \
54                 && mkdir -p $$include_dir \
55                 && cp src/*.h $$include_dir
56
57 install-arch: build
58         dh_testdir
59         dh_testroot
60         dh_clean -k 
61         dh_installdirs -a
62         
63         $(MAKE) install DESTDIR=$(CURDIR)/debian/collectd
64         
65         rm -f $(CURDIR)/debian/collectd/usr/lib/collectd/*.la
66         
67         rm -f $(CURDIR)/debian/collectd/etc/collectd.conf
68         install -D -m 0644 $(CURDIR)/debian/collectd.conf \
69                 $(CURDIR)/debian/collectd/etc/collectd/collectd.conf
70         
71         for PLUGIN in apache hddtemp mbmon mysql ping sensors; do \
72                 plugin_dir=$(CURDIR)/debian/collectd-$$PLUGIN/usr/lib/collectd/; \
73                 mkdir -p $$plugin_dir; \
74                 mv $(CURDIR)/debian/collectd/usr/lib/collectd/$$PLUGIN.so \
75                         $$plugin_dir; \
76         done    
77
78 binary-indep: install-indep
79         dh_testdir
80         dh_testroot
81         dh_installchangelogs -i ChangeLog
82         dh_installdocs -A -i debian/README.Debian AUTHORS README TODO
83         dh_installexamples -i debian/examples/myplugin.c
84         dh_compress -i
85         dh_fixperms -i
86         dh_installdeb -i
87         dh_gencontrol -i
88         dh_md5sums -i
89         dh_builddeb -i
90
91 binary-arch: build install-arch
92         dh_testdir
93         dh_testroot
94         dh_installchangelogs -a ChangeLog
95         dh_installdocs -A -a debian/README.Debian AUTHORS README TODO
96         dh_installexamples -a contrib/collectd2html.pl contrib/collection.cgi
97         dh_installinit -a -- defaults 95
98         dh_installman -a src/collectd.1 src/collectd.conf.5
99         dh_link -a
100         dh_strip -a --dbg-package=collectd-dbg
101         dh_compress -a
102         dh_fixperms -a
103         dh_installdeb -a
104         dh_shlibdeps -a
105         dh_gencontrol -a
106         dh_md5sums -a
107         dh_builddeb -a
108
109 binary: binary-arch binary-indep
110 .PHONY: build clean binary-indep binary-arch binary install-indep install-arch
111