File: rules

package info (click to toggle)
nut 0.45.5-rel-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,984 kB
  • ctags: 2,146
  • sloc: ansic: 22,216; sh: 1,138; makefile: 405
file content (116 lines) | stat: -rwxr-xr-x 2,954 bytes parent folder | download
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
#!/usr/bin/make -f
export DH_VERBOSE=0
export DH_COMPAT=1
export DH_OPTIONS=

configure: configure-stamp
configure-stamp:
	dh_testdir
	./configure \
	    --prefix=/ \
	    --sysconfdir=/etc/nut \
	    --mandir=/usr/share/man \
	    --with-statepath=/var/lib/nut \
	    --with-altpidpath=/var/run/nut \
	    --with-modelpath=/lib/nut \
	    --with-cgipath=/usr/lib/cgi-bin/nut \
	    --with-pidpath=/var/run/nut \
	    --with-user=nut \
	    --with-group=nut
	touch $@

build: configure
build: build-stamp
build-stamp:
	dh_testdir
	$(MAKE) all cgi
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f configure-stamp build-stamp install-stamp
	-$(MAKE) distclean
	dh_clean

uninstall:
	dh_testdir
	dh_testroot
	dh_clean -k
	rm -f install-stamp

install: build
install: install-stamp
install-stamp: DH_OPTIONS=
install-stamp: INSTALLROOT=$(PWD)/debian/tmp
install-stamp:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) INSTALLROOT=$(INSTALLROOT) RUNUID=65534 RUNGID=65534 install
	$(MAKE) INSTALLROOT=$(INSTALLROOT) RUNUID=65534 RUNGID=65534 install-cgi
	$(MAKE) INSTALLROOT=$(INSTALLROOT) RUNUID=65534 RUNGID=65534 install-misc
	# install the header and library in appropriate places
	chmod 644 $(INSTALLROOT)/misc/*
	mv $(INSTALLROOT)/misc/upsfetch.o $(INSTALLROOT)/usr/lib/nut
	mv $(INSTALLROOT)/misc/upsfetch.h $(INSTALLROOT)/usr/include
	rmdir $(INSTALLROOT)/misc
	# remove upsdrvctl because we aren't using the unified model daemons
	rm $(INSTALLROOT)/lib/nut/upsdrvctl
	# move all the .sample configuration files to appropriate locations
	mkdir -p $(INSTALLROOT)/usr/share/doc/nut-cgi/examples
	for file in hosts.conf.sample multimon.conf.sample upsset.conf.sample;\
	do\
	  mv $(INSTALLROOT)/etc/nut/$$file\
	     $(INSTALLROOT)/usr/share/doc/nut-cgi/examples/$$file;\
	  chmod 644 $(INSTALLROOT)/usr/share/doc/nut-cgi/examples/$$file;\
	done
	mkdir -p $(INSTALLROOT)/usr/share/doc/nut/examples
	mv $(INSTALLROOT)/etc/nut/*\
	   $(INSTALLROOT)/usr/share/doc/nut/examples/;\
	# install our own configuration files
	install -m 600 $(PWD)/debian/upsd.conf   $(INSTALLROOT)/etc/nut
	install -m 600 $(PWD)/debian/upsd.users  $(INSTALLROOT)/etc/nut
	install -m 600 $(PWD)/debian/upsmon.conf $(INSTALLROOT)/etc/nut
	dh_movefiles
	touch $@

binary-indep: DH_OPTIONS=-i
binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdocs
	dh_installchangelogs CHANGES
	dh_strip
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps -Xupsfetch.o
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: DH_OPTIONS=-a
binary-arch: install
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdocs
	dh_installinit
	dh_installmanpages -Nnut-cgi -Nnut-doc
	dh_installchangelogs CHANGES
	dh_strip
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps -Xupsfetch.o
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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