File: rules

package info (click to toggle)
tkmail 4.0beta9-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,340 kB
  • ctags: 968
  • sloc: tcl: 13,256; ansic: 6,980; makefile: 349; sh: 79; sed: 57
file content (99 lines) | stat: -rwxr-xr-x 2,711 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
#!/usr/bin/make -f
# Sample debian.rules file - Copyright 1994,1995 by Ian Jackson.
#
# Invoke each target with `./debian/rules <target>'.  All targets should be
# invoked with the package root as the current directory.

# The name of the package
P = tkmail

CC = gcc
COPTIONS = -O2 -g -Wall
LDFLAGS = # none
INSTALL = install -s

R = debian/tmp

DIRECTORIES = \
        $(R) \
        $(R)/DEBIAN \
        $(R)/usr \
        $(R)/usr/bin \
        $(R)/usr/doc \
        $(R)/usr/doc/$(P) \
        $(R)/usr/doc/$(P)/examples \
        $(R)/usr/lib \
	$(R)/usr/lib/menu \
        $(R)/usr/lib/$(P)

build:
	$(checkdir)
	./configure
	make CC="$(CC)" COPTIONS="$(COPTIONS)" LDFLAGS="$(LDFLAGS)"
	touch build

# Clean $(DIRECTORIES)
clean-dir:
	$(checkdir)
	rm -rf $(R)

# Undoes the effect of `make -f rules build'.
clean: clean-dir
	$(checkdir)
	[ ! -f mfv/Makefile ] || make clean
	rm -f debian/files* debian/substvars core
	rm -f build

# Makes a binary package.
binary-indep: $(DIRECTORIES) checkroot build
	$(checkdir)

binary-arch: $(DIRECTORIES) checkroot build
	$(checkdir)
	$(INSTALL) -m 755 debian/postinst $(R)/DEBIAN/.
	$(INSTALL) -m 755 debian/postrm $(R)/DEBIAN/.
	$(INSTALL) -m 644 debian/changelog $(R)/usr/doc/$(P)/changelog.Debian
	$(INSTALL) -m 644 debian/copyright $(R)/usr/doc/$(P)/.
	$(INSTALL) -m 644 BETANOTES $(R)/usr/doc/$(P)/changelog
	$(INSTALL) -m 644 debian/menu $(R)/usr/lib/menu/$(P)
	make install DESTDIR=`pwd`/$(R) INSTALL="$(INSTALL)"
	find $(R)/usr/lib/tkmail -type f -print | xargs chmod -x
	chmod +x $(R)/usr/lib/tkmail/altedit.tk
	chmod +x $(R)/usr/lib/tkmail/tkbind/tkBindTest
	mv $(R)/usr/lib/tkmail/tkbind/ChangeLog $(R)/usr/doc/$(P)/changelog.tkbind
	mv $(R)/usr/lib/tkmail/tkbind/README $(R)/usr/doc/$(P)/README.tkbind
	mv $(R)/usr/lib/tkmail/tkbind/example.tkbindrc $(R)/usr/doc/$(P)/examples/dot.tkbindrc
	mv $(R)/usr/lib/tkmail/example.tkmail4rc $(R)/usr/doc/$(P)/examples/dot.tkmail4rc
	rmdir $(R)/usr/lib/tkmail.old/
	#strip mfv/dotlock mfv/mfv_wish
	gzip -9v $(R)/usr/doc/$(P)/changelog{,.Debian,.tkbind}
	gzip -9v $(R)/usr/doc/$(P)/README.tkbind
	dpkg-shlibdeps mfv/dotlock mfv/mfv_wish
	dpkg-gencontrol
	chown -R root.root $(R)
	chmod -R go-ws+rX $(R)
	chmod -R u-s+rw $(R)
	chown root.mail $(R)/usr/bin/dotlock
	chmod g+s $(R)/usr/bin/dotlock
	dpkg --build $(R) ..

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

# Below here is fairly generic really

$(DIRECTORIES):
	install -d -g root -o root -m 755 $@
	chmod g-s $@

binary:	binary-indep binary-arch

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

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

.PHONY: binary binary-arch binary-indep clean checkroot