File: rules

package info (click to toggle)
xwave 0.6%2B2-7
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,904 kB
  • ctags: 2,026
  • sloc: ansic: 15,177; perl: 345; makefile: 74; sh: 63
file content (94 lines) | stat: -rwxr-xr-x 2,510 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
#!/usr/bin/make -f
# $Id: rules,v 1.8 2001/07/18 23:47:17 phil Exp $	

DEBCFLAGS:=-O2
DEBSTRIP:=strip
WGET=wget
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
DEBCFLAGS += -g
endif
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
DEBSTRIP:=:
endif

DEBVERSION:=$(shell head -1 debian/changelog \
	            | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/-[0-9]*$$//')

build:
	$(ckeckdir)
	-mkdir lib
	xmkmf -a
	$(MAKE) CDEBUGFLAGS="$(DEBCFLAGS)"
	touch build

clean:
	$(checkdir)
	-$(MAKE) clean
	-rm -f build
	-rm -fr debian/tmp include
	-rm -f debian/files* debian/substvars
	-find . -name "*~" | xargs -r rm

binary-indep: checkroot build
	$(checkdir)
	@echo "Nothing to be done for binary-indep..."

binary-arch: checkroot build
	# Install
	$(checkdir)
	-rm -fr debian/tmp
	mkdir -p debian/tmp debian/tmp/DEBIAN
	mkdir -p debian/tmp/usr/share/doc/xwave
	# Doc
	cp README* debian/tmp/usr/share/doc/xwave
	cp Changelog debian/tmp/usr/share/doc/xwave/changelog
	cp debian/changelog debian/tmp/usr/share/doc/xwave/changelog.Debian
	gzip -v9 debian/tmp/usr/share/doc/xwave/*
	cp debian/copyright debian/tmp/usr/share/doc/xwave/copyright
	# Bin hack
	mkdir -p debian/tmp/usr/bin
	cp src/xwave debian/tmp/usr/bin
	$(DEBSTRIP) --remove-section=.comment --remove-section=.note \
	  debian/tmp/usr/bin/xwave
	mkdir -p debian/tmp/etc/X11/app-defaults
	cp src/XWave debian/tmp/etc/X11/app-defaults
	# Man
	mkdir -p debian/tmp/usr/share/man/man1
	cp debian/xwave.man debian/tmp/usr/share/man/man1/xwave.1
	gzip -v9 debian/tmp/usr/share/man/man1/xwave.1
	# Menu system
	mkdir -p debian/tmp/usr/lib/menu
	cp debian/menu debian/tmp/usr/lib/menu/xwave
	# Control & stuff
	dpkg-shlibdeps debian/tmp/usr/bin/*
	dpkg-gencontrol -isp
	cp debian/postinst debian/tmp/DEBIAN
	cp debian/postrm debian/tmp/DEBIAN
	cp debian/prerm debian/tmp/DEBIAN
	cp debian/conffiles debian/tmp/DEBIAN
	chmod +x debian/tmp/DEBIAN/{postinst,postrm,prerm}
	chmod -R go-w debian/tmp
	chown -R root.root debian/tmp
	dpkg -b debian/tmp ..

binary: binary-arch binary-indep

define checkdir
	test -f src/xwave.c -a -f debian/rules
endef

checkroot:
	$(checkdir)
	test root = "`whoami`"

print-version:
	@@echo "Debian version:          $(DEBVERSION)"
	@@echo "Upstream version:        $(UPVERSION)"

get-orig-source:
	$(WGET) -O xwave_$(UPVERSION).orig.tar.gz \
	  http://www.funet.fi/~kouhia/waves/xwave2.tar.gz

.PHONY: binary binary-arch binary-indep clean checkroot print-version \
	get-orig-source