File: rules

package info (click to toggle)
genpower 1.0.1-13
  • links: PTS
  • area: main
  • in suites: woody
  • size: 264 kB
  • ctags: 44
  • sloc: ansic: 522; sh: 183; makefile: 109
file content (78 lines) | stat: -rwxr-xr-x 2,893 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
#! /usr/bin/make -f
#
# To make the binary distribution package, the ``Debianized'' source package
# and the context diff to the original package, type `./debian/rules dist'.
# Make sure that `debian/rules' is executable before the final distribution
# is made.
#
# Invoke each target with `./debian/rules <target>'.  All targets should be
# invoked with the package root as the current directory.
#
# The `binary' target must be run as root, as it needs to install files with
# specific ownerships.  The `diff' target assumes that you have the original
# source package available, unpacked, in ../$(p)-$(v).orig.
#


package	:= genpower


build:
# Builds the binary package.
	make CFLAGS='-O2 -fomit-frame-pointer -DNEWINIT'
	touch stamp-build

clean:
# Undoes the effect of `debian/rules build'.
	rm -f stamp-build
	rm -rf debian/tmp debian/files debian/substvars
	find . \( -name "*~" -o -name "#*" \) -exec rm -f {} \;
	$(MAKE) clean


# Makes a binary package.
binary-indep:
	@echo "No architecture-independant packages"

binary-arch:
	test -f stamp-build || make -f debian/rules build
	rm -rf debian/tmp
	#
	mkdir -p debian/tmp/DEBIAN debian/tmp/usr/share/doc/$(package)
	mkdir -p debian/tmp/sbin debian/tmp/usr/sbin debian/tmp/etc/init.d debian/tmp/usr/share/man/man8
	#
	$(MAKE) install BINDIR=debian/tmp/sbin SCRIPTDIR=debian/tmp/etc MANDIR=debian/tmp/usr/share/man/man8
	rm -f debian/tmp/etc/genpowerfail
	cp gentest debian/tmp/usr/sbin
	install -m 755 debian/genpower.rc  debian/tmp/etc/init.d/genpower
	install -m 755 debian/powerfail.rc debian/tmp/etc/init.d/powerfail
	cd debian/tmp/etc/init.d; ln -s genpower ups-monitor
	strip debian/tmp/sbin/* debian/tmp/usr/sbin/*
	cp gentest.8 debian/tmp/usr/share/man/man8/
	cd debian/tmp/usr/share/man && gzip -9v */*;
	cd debian/tmp/usr/share/man/man8; ln -s genpowerd.8.gz genpower.8.gz
	#
	cp Change.Log					debian/tmp/usr/share/doc/$(package)/changelog
	cp debian/changelog				debian/tmp/usr/share/doc/$(package)/changelog.Debian
	cp genpower.docs				debian/tmp/usr/share/doc/$(package)/
	cp debian/new-APC-cable			debian/tmp/usr/share/doc/$(package)
	cp debian/pnp-APC-cable			debian/tmp/usr/share/doc/$(package)
	cp debian/trust-energy-cable	debian/tmp/usr/share/doc/$(package)
	cd debian/tmp/usr/share/doc/$(package) && gzip -9v *
	cp debian/copyright				debian/tmp/usr/share/doc/$(package)
#	cd debian/tmp/usr/share/doc/$(package) && ln -sf ../copyright/GPL copyright
	#
	install -m 644 debian/conffiles	debian/tmp/DEBIAN
	install -m 755 debian/postinst	debian/tmp/DEBIAN
	install -m 755 debian/prerm		debian/tmp/DEBIAN
	install -m 755 debian/postrm	debian/tmp/DEBIAN
	#
	dpkg-shlibdeps debian/tmp/sbin/* debian/tmp/usr/sbin/*
	dpkg-gencontrol -is -ip
	chown -R root.root debian/tmp
	chmod -R go=rX	   debian/tmp
	dpkg --build debian/tmp
	dpkg-name -o -s .. debian/tmp.deb

binary: binary-indep binary-arch
	@echo "Binaries made"