Code

ce276f56b8cee69a290d5f1a1dfd185c144084b2
[pkg-nagvis.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
7 include /usr/share/dpatch/dpatch.make
8 DEST = debian/nagvis
9 TMP  = debian/tmp
11 configure: configure-stamp
12 configure-stamp:
13         dh_testdir
14         touch configure-stamp
16 build: build-stamp patch-stamp
17 build-stamp: configure-stamp 
18         dh_testdir
19         #$(MAKE)
20         #docbook-to-man debian/nagvis.sgml > nagvis.1
21         touch $@
23 clean: unpatch
24         dh_testdir
25         dh_testroot
26         rm -f build-stamp configure-stamp
27         # Add here commands to clean up after the build process.
28         #-$(MAKE) clean
29         dh_clean 
31 install: build
32         dh_testdir
33         dh_testroot
34         dh_clean -k
35         dh_installdirs
36         dh_install
38         # -- images to /var 
39         mv $(DEST)/usr/share/nagvis/htdocs/nagvis/images/* $(DEST)/var/lib/nagvis/images/.
41         # -- templates
42         mv $(DEST)/usr/share/nagvis/htdocs/nagvis/templates $(DEST)/etc/nagvis/.
44         # -- gadgets
45         mv $(DEST)/usr/share/nagvis/htdocs/nagvis/gadgets $(DEST)/etc/nagvis/.
46         
47         [ -x /usr/bin/html2text ] && \
48                  /usr/bin/html2text -ascii -nobs < docs/en_US/changelog.html > docs/changelog
49         mv $(DEST)/etc/nagvis/nagvis.ini.php-sample \
50                 $(DEST)/usr/share/nagvis/debian/
51         sed -e 's/^[; ]*\(\<dbhost\) *=.*$$/\1=_DBC_DBSERVER_/' \
52             -e 's/^[; ]*\(\<dbport\) *=.*$$/\1=_DBC_DBPORT_/' \
53             -e 's/^[; ]*\(\<dbname\) *=.*$$/\1=_DBC_DBNAME_/' \
54             -e 's/^[; ]*\(\<dbuser\) *=.*$$/\1=_DBC_DBUSER_/' \
55             -e 's/^[; ]*\(\<dbpass\) *=.*$$/\1=_DBC_DBPASS_/' \
56          < $(DEST)/usr/share/nagvis/debian/nagvis.ini.php-sample \
57          > $(DEST)/usr/share/nagvis/debian/nagvis.ini.php-sample.new && \
58          mv $(DEST)/usr/share/nagvis/debian/nagvis.ini.php-sample.new \
59             $(DEST)/usr/share/nagvis/debian/nagvis.ini.php-sample
60         
61         # demo site
62         install -d $(TMP)/demo/etc/nagvis/maps
63         mv $(DEST)/etc/nagvis/maps/demo*.cfg $(TMP)/demo/etc/nagvis/maps/
64         
65         dh_link
66         dh_lintian
68 # Build architecture-dependent files here.
69 binary-arch: build install
70 # We have nothing to do by default.
72 # Build architecture-independent files here.
73 binary-indep: build install
74         dh_testdir
75         dh_testroot
76         dh_installchangelogs 
77         dh_installdocs
78         dh_installexamples
79         dh_installdebconf       
80         dh_compress
81         dh_fixperms
82         dh_installdeb
83         dh_shlibdeps
84         dh_gencontrol
85         dh_md5sums
86         dh_builddeb
88 binary: binary-indep binary-arch
89 .PHONY: build clean binary-indep binary-arch binary install configure