File: rules

package info (click to toggle)
joe 2.8-10
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,080 kB
  • ctags: 1,764
  • sloc: ansic: 18,800; asm: 224; makefile: 122; sh: 9
file content (121 lines) | stat: -rwxr-xr-x 2,571 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
# debian.rules file for joe-2.8
# Based on the sample debian.rules file written by Ian Jackson.
# Written by Christian Linhart in 1995.
# I hereby place this file in the public domain.
# Expanded to use termidx by Michael Meskes in 1996
# Modified to support the new source format by Dale Scheetz Sep 1996

# Program name
#
p=joe

# Setup variables
#
DOC_DIR=debian/tmp/usr/doc/$(p)
DOCS=README INFO LIST TODO VERSION debian.README 
EXAMPLE_DIR=$(DOC_DIR)/examples
EXAMPLES=

# Build binaries
#
build:
	$(checkdir)
	$(MAKE) joe termidx
	touch build

# Clean up after build
#
clean:
	$(checkdir)
	-/bin/rm -f build
	-rm -rf debian/tmp *~ debian/substvars* debian/files*
	-$(MAKE) -i clean
	-/bin/rm -f jmacs jpico jstar rjoe joe termidx

# No binary independent code for this package
#
binary-indep:
# None
	@echo 'No independent packages.'

# Construct the binary package
#
binary binary-arch:	checkroot build
	$(checkdir)

# Check for proper build
#
	test -f build || make -f debian.rules build

# Clean out the old temp directory
#
	-rm -rf debian/tmp

# Install new directories for housing package components
#
	install -d debian/tmp debian/tmp/DEBIAN
	install -d $(DOC_DIR)

# Install contents of /doc directory
#
	for doc in $(DOCS) ; do \
		gzip -9vc $$doc >$(DOC_DIR)/$$doc.gz ; done
	gzip -9vc debian/changelog >$(DOC_DIR)/changelog.Debian.gz
	install -m 644 debian/copyright $(DOC_DIR)/.

# Install configuration files and conffiles
#
	cp debian/conffiles debian/tmp/DEBIAN/conffiles
	install -o root -g root -m 755 debian/postinst \
		debian/tmp/DEBIAN/postinst
	install -o root -g root -m 755 debian/prerm \
		debian/tmp/DEBIAN/prerm

# Set up directories for installation
#
	install -d debian/tmp/etc/joe
	install -d debian/tmp/usr/man/man1

# Install package components into tmp directory
#
	$(MAKE) DESTDIR=debian/tmp install

# gzip man pages
#
	gzip -9 debian/tmp/usr/man/man1/*

# make additional man page links for various binary names
#
	( cd debian/tmp/usr/man/man1 ; \
		ln -s joe.1.gz jmacs.1.gz ; \
		ln -s joe.1.gz jpico.1.gz ; \
		ln -s joe.1.gz jstar.1.gz ; \
		ln -s joe.1.gz rjoe.1.gz ; \
	)

# Determine dependencies
#
	dpkg-shlibdeps debian/tmp/usr/bin/$(p)

# Set control information
#
	dpkg-gencontrol

# Set proper ownership and permissions of files
#
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..

# Bookkeeping
#
define checkdir
	test -f $(p).man -a -f debian/rules
endef

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

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