File: rules

package info (click to toggle)
mon 0.99.2-9%2Betch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 908 kB
  • ctags: 299
  • sloc: perl: 9,801; ansic: 778; sh: 372; makefile: 122
file content (124 lines) | stat: -rwxr-xr-x 3,068 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/make -f

# $Id: rules,v 1.12 2001/09/14 01:15:22 roderick Exp $

dt		:= debian/mon
doc		:= usr/share/doc/mon
debug_dir	:= debug

stamp_build	:= debian/stamp.build
stamp_install	:= debian/stamp.install
clean		:= $(stamp_build) $(stamp_install)

export CFLAGS	:= -O2 -Wall
ifneq "" "$(findstring debug,$(DEB_BUILD_OPTIONS))"
    CFLAGS	+= -g
endif

export DH_OPTIONS

run-debug:
	[ -d $(debug_dir) ] || mkdir $(debug_dir)
	pwd=`pwd` && ./mon \
	    -A "$$pwd"/etc/auth.cf \
	    -b "$$pwd" \
	    -B "$$pwd"/$(debug_dir) \
	    -c "$$pwd"/debian/debug.cf \
	    -D "$$pwd"/$(debug_dir) \
	    -d \
	    -L $(debug_dir) \
	    -P $(debug_dir)/pid \
	    $(mon_debug_args)

build: DH_OPTIONS :=
build: $(stamp_build)
$(stamp_build):
	dh_testdir
	cd mon.d && $(MAKE) CFLAGS="$(CFLAGS)" rpc.monitor
	touch $@

install: DH_OPTIONS :=
install: $(stamp_install)
$(stamp_install): $(stamp_build)
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	install mon $(dt)/usr/sbin
	install -m 644 clients/batch-example $(dt)/$(doc)/examples/batch-client
	install clients/moncmd clients/monshow clients/skymon/skymon \
	    $(dt)/usr/bin
	install alert.d/*.alert alert.d/alert.template \
	    $(dt)/usr/lib/mon/alert.d
	install mon.d/*.monitor $(dt)/usr/lib/mon/mon.d
	install -m 644 debian/mon.cf $(dt)/etc/mon
	install -m 644 etc/auth.cf $(dt)/etc/mon
	install -m 644 etc/example.cf $(dt)/$(doc)/examples/mon.cf
	install -m 644 `ls etc/*.cf | fgrep -xv etc/example.cf` \
	     $(dt)/$(doc)/examples
	install -m 644 etc/example.m4 $(dt)/$(doc)/examples/m4-conf.cf.m4
	install -m 644 etc/example.monshowrc $(dt)/$(doc)/examples/monshowrc
	install -m 644 clients/skymon/README $(dt)/$(doc)/README.skymon
	install -m 644 clients/skymon/allow $(dt)/$(doc)/examples/skymon.allow
	install -m 644 clients/skymon/procmail \
	    $(dt)/$(doc)/examples/skymon.procmail

#	dh_movefiles
	touch $@

clean: DH_OPTIONS :=
clean:
	dh_testdir
	dh_testroot
	rm -rf $(debug_dir)
	cd mon.d && $(MAKE) $@
	dh_clean $(clean)

binary-common:
	dh_testdir
	dh_testroot
#	dh_installdebconf
	dh_installdocs
	dh_installexamples
	dh_installmenu
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
	dh_installinit
	dh_installman doc/*.1 doc/*.8
	dh_installcron
	dh_installinfo
#	dh_undocumented
	dh_installchangelogs CHANGES
	dh_link
	dh_strip
	dh_compress

	dh_fixperms
	cd $(dt)/var && chown daemon log/mon run/mon state/mon

#	dh_makeshlibs
	dh_installdeb
	dh_perl
	dh_shlibdeps
	dh_gencontrol -u -isp
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
# (Comment this out if you have none to build.)
binary-indep: build install binary-common
#nothing to do

# Build architecture dependant packages using the common target.
binary-arch: DH_OPTIONS=-a
binary-arch: build install binary-common

# Any other binary targets build just one binary package at a time.
binary-%: build install
	make -f debian/rules binary-common DH_OPTIONS=-p$*

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install