Imported Debian patch 0.8.7g-2.1
[debian/cacti] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 CFLAGS = -Wall -g
7
8 TDIR:=debian/cacti
9 SHAREDIR:=${TDIR}/usr/share/cacti
10 SITEDIR:=${SHAREDIR}/site
11 RRADIR:=${TDIR}/var/lib/cacti/rra
12
13 # include the patch/unpatch rules from quilt
14 include /usr/share/quilt/quilt.make
15
16
17 configure: configure-stamp
18 configure-stamp: $(QUILT_STAMPFN)
19         dh_testdir
20         # make sure that cli-include-path.patch is up to date
21         if grep -r -E '(include|repair).*\.\./' cli | grep -v /site/; then \
22                 echo " ^ fix above include paths in cli directory ^" && false; \
23         fi
24         touch configure-stamp
25
26 build: build-stamp
27 build-stamp: patch configure-stamp 
28         dh_testdir
29         touch build-stamp
30
31 clean: unpatch
32         dh_testdir
33         dh_testroot
34         rm -f build-stamp configure-stamp
35         dh_clean 
36         debconf-updatepo
37
38 install: build
39         dh_testdir
40         dh_testroot
41         dh_clean -k 
42         dh_installdirs
43         install -p *.php ${SITEDIR}/
44         cp -pr scripts images include install lib ${SITEDIR}/
45         cp -pr cli resource ${SHAREDIR}/
46         find ${SHAREDIR}/cli -type f -print0 | xargs -0 file | \
47                 grep /usr/bin/php | cut -d: -f1 | xargs chmod ug+x
48         # place the sql script where dbconfig-common wants it
49         cp cacti.sql ${TDIR}/usr/share/dbconfig-common/data/cacti/install/mysql
50         # normalize permissions in the site directory
51         find ${RRADIR} ${SITEDIR}/ -exec chown root:www-data {} \;
52         find ${SITEDIR}/ -type f -exec chmod 640 {} \;
53         find ${SITEDIR}/scripts -type f -exec chmod 750 {} \;
54         find ${SITEDIR}/ -type d -exec chmod 750 {} \;
55         # and then fix the special case files
56         find ${SITEDIR}/scripts -type f -name '*.php' -exec chmod 640 {} \;
57         chmod 770 ${RRADIR}
58         # remove all adodb code at build time, as we get this from libphp-adodb
59         rm -rf ${SITEDIR}/lib/adodb
60         # plop in our lintian override file
61         cp debian/cacti.lintian-overrides ${TDIR}/usr/share/lintian/overrides/cacti
62         
63
64 binary-arch: 
65 # Build architecture-dependent files here.
66 binary-indep: build install
67         dh_testdir
68         dh_testroot
69         dh_installchangelogs docs/CHANGELOG
70         dh_installdocs
71         dh_installexamples
72         dh_installdebconf       
73         dh_installlogrotate
74         dh_installcron
75         dh_installman
76         dh_usrlocal
77         dh_link
78         dh_strip
79         dh_compress
80         dh_fixperms -X/var/lib/cacti/rra
81         dh_installdeb
82         dh_shlibdeps
83         dh_gencontrol
84         dh_md5sums
85         dh_builddeb
86
87 binary: binary-indep
88 .PHONY: build clean binary-arch binary-indep binary install configure patch unpatch