~ubuntu-branches/ubuntu/precise/nagios-snmp-plugins/precise

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Jan Wagner
  • Date: 2007-04-25 22:00:50 UTC
  • Revision ID: james.westby@ubuntu.com-20070425220050-7vku4vgmmk4p1geu
Tags: 1.1.1-1
* new upstream
* include (new) html docs into package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
 
 
3
# Uncomment this to turn on verbose mode.
 
4
#export DH_VERBOSE=1
 
5
 
 
6
COMMANDDEFPATH:=/etc/nagios-plugins/config/
 
7
NP_DIR:=debian/nagios-snmp-plugins
 
8
NP_TEMPLATES:=$(NP_DIR)/usr/share/nagios-snmp-plugins/pluginconfig
 
9
NP_LIBEXEC:=/usr/lib/nagios/plugins
 
10
 
 
11
plugin_cfgs:=snmp_cpfw snmp_env snmp_int snmp_load snmp_mem snmp_process \
 
12
        snmp_storage snmp_vrrp snmp_win
 
13
 
 
14
build:
 
15
 
 
16
clean:
 
17
        dh_testdir
 
18
        dh_testroot
 
19
 
 
20
        dh_clean
 
21
        -rm -f debian/postrm
 
22
 
 
23
install: build
 
24
        dh_testdir
 
25
        dh_testroot
 
26
        dh_clean -k
 
27
        dh_installdirs
 
28
 
 
29
        # Add here commands to install the package into debian/nagios-snmp-plugins.
 
30
        for PLUGINS in *.pl; \
 
31
        do \
 
32
                install -D -m 0755 $$PLUGINS $(NP_DIR)$(NP_LIBEXEC)/$$PLUGINS || exit 1; \
 
33
                sed -i "s#/usr/local/nagios/libexec#$(NP_LIBEXEC)#" $(NP_DIR)$(NP_LIBEXEC)/$$PLUGINS || exit 1; \
 
34
        done
 
35
        # copying templates them into seperate "template" directories outside of
 
36
        # /usr/share/doc for ucf to use.
 
37
        install -d $(NP_DIR)/usr/share/nagios-snmp-plugins/pluginconfig
 
38
        for c in ${plugin_cfgs}; do \
 
39
                cp debian/pluginconfig/$${c}.cfg ${NP_TEMPLATES}; \
 
40
        done
 
41
        # here the list of config templates are writen to postrm
 
42
        sed -e 's/@PLUGINS@/${plugin_cfgs}/' \
 
43
                < debian/postrm.in \
 
44
                > debian/postrm
 
45
        # copy html documentation over
 
46
        install -d $(NP_DIR)/usr/share/doc/nagios-snmp-plugins/html/
 
47
        cp doc/* $(NP_DIR)/usr/share/doc/nagios-snmp-plugins/html/
 
48
 
 
49
# Build architecture-independent files here.
 
50
binary-indep: build install
 
51
        dh_testdir
 
52
        dh_testroot
 
53
        dh_installchangelogs
 
54
        dh_installdocs
 
55
        dh_link
 
56
        dh_compress
 
57
        dh_fixperms
 
58
        dh_perl
 
59
        dh_installdeb
 
60
        dh_gencontrol
 
61
        dh_md5sums
 
62
        dh_builddeb
 
63
 
 
64
# Build architecture-dependent files here.
 
65
binary-arch: build install
 
66
# We have nothing to do for now.
 
67
 
 
68
binary: binary-indep binary-arch
 
69
.PHONY: build clean binary-indep binary-arch binary install