File: rules

package info (click to toggle)
sam 4.3-18.2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 1,440 kB
  • ctags: 1,662
  • sloc: ansic: 14,328; sh: 879; makefile: 205
file content (102 lines) | stat: -rwxr-xr-x 3,573 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
#! /usr/bin/make -f
## debian/rules for the Debian packages version of sam
## (C) 2002 Gergely Nagy <algernon@debian.org>,
## Based on the work of Raul Miller <moth@debian.org>
##
## Released under the terms of the GNU GPLv2.

PACKAGE		= sam
DEB_SAM		= ${CURDIR}/debian/sam

CFLAGS 		= -g
ifneq (,$(findstring noopt,${DEB_BUILD_OPTIONS}))
CFLAGS          += -O0
else
CFLAGS          += -O2
endif

PATCHLIST	 = $(notdir $(basename $(wildcard debian/patches/*.dpatch)))

include /usr/share/dpatch/dpatch.make

build: patch
	test -e debian/control
	${MAKE} CFLAGS="-D_LIBXG_EXTENSION -I../include ${CFLAGS}" \
		XLIBS="-L/usr/X11R6/lib -lXt -lX11" \
		TERMNAME="/usr/lib/sam/samterm" RXNAME="ssh" \
		RXPATHNAME="/usr/bin/ssh" TMP="/var/tmp"

clean: clean1 unpatch
	test -e debian/control && test xroot = x`whoami`
	rm -rf debian/patched
clean1: 
	test xroot = x`whoami`
	rm -f build
	${MAKE} nuke
	rm -rf debian/files* core debian/*substvars debian/sam

binary-sam: build
	test -e debian/control && test xroot = x`whoami`
## Install directories
	install -d ${DEB_SAM}/etc/X11/app-defaults ${DEB_SAM}/usr/bin \
		${DEB_SAM}/usr/lib/sam ${DEB_SAM}/usr/share/doc/sam \
		${DEB_SAM}/usr/share/man/man1 ${DEB_SAM}/usr/share/man/man5 \
		${DEB_SAM}/usr/share/man/man7 ${DEB_SAM}/usr/share/menu \
		${DEB_SAM}/DEBIAN/
	${MAKE} install DESTDIR=${DEB_SAM} SHARE=/share \
			SAMTERM=${DEB_SAM}/usr/lib/sam/samterm \
			RSAMNAME=sam.real SAMSAVEDIR=${DEB_SAM}/usr/lib/sam \
			SAMDIR=${DEB_SAM}/usr/bin
	install -m 0755 debian/local/sam ${DEB_SAM}/usr/bin/sam
	install -m 0755 sam/B.sh ${DEB_SAM}/usr/bin/B
## Install manual pages
	gzip -9fc doc/sam.1 >${DEB_SAM}/usr/share/man/man1/sam.1.gz
	ln -sf sam.1.gz ${DEB_SAM}/usr/share/man/man1/sam.real.1.gz
	ln -sf sam.1.gz ${DEB_SAM}/usr/share/man/man1/B.1.gz
	for f in doc/*.4; do \
		gzip -9fc $$f >${DEB_SAM}/usr/share/man/man5/`basename $$f .4`.5g.gz; \
	done
	for f in doc/*.6; do \
		gzip -9fc $$f >${DEB_SAM}/usr/share/man/man7/`basename $$f .6`.7g.gz; \
	done
	ln -sf font.5g.gz ${DEB_SAM}/usr/share/man/man5/subfont.5g.gz
	ln -sf utf.5g.gz ${DEB_SAM}/usr/share/man/man5/rune.5g.gz
## Install misc. stuff
	install -m 0644 doc/Sam.ad ${DEB_SAM}/etc/X11/app-defaults
	install -m 0644 doc/sam.ps doc/sam.tut.ms doc/se.ps \
		${DEB_SAM}/usr/share/doc/sam/
## Install docs
	install -m 0644 README.dist debian/README.Debian \
		debian/copyright ${DEB_SAM}/usr/share/doc/sam/
	gzip -9fc README >${DEB_SAM}/usr/share/doc/sam/README.gz
	gzip -9fc debian/changelog \
		  >${DEB_SAM}/usr/share/doc/sam/changelog.Debian.gz
## Install menu-file
	install -m 0644 debian/local/menu/sam ${DEB_SAM}/usr/share/menu
## Strip binaries
ifeq (,$(findstring nostrip,${DEB_BUILD_OPTIONS}))
	strip --remove-section=.note --remove-section=.comment \
		${DEB_SAM}/usr/bin/sam.real ${DEB_SAM}/usr/lib/sam/samterm
endif
## Generate ${shlibs:Depends}
	dpkg-shlibdeps -Tdebian/sam.substvars -dDepends \
			${DEB_SAM}/usr/bin/sam.real \
			${DEB_SAM}/usr/lib/sam/samterm
## Install files into DEBIAN/
	install -m 0755 debian/maint/sam/p* ${DEB_SAM}/DEBIAN/
	install -m 0644 debian/maint/sam/conffiles ${DEB_SAM}/DEBIAN/
## Generate DEBIAN/md5sums
	cd ${DEB_SAM} >/dev/null; \
	  find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums
## Generate DEBIAN/control
	dpkg-gencontrol -isp -psam -Tdebian/sam.substvars \
		-P${DEB_SAM}
## And finally build it
	dpkg --build ${DEB_SAM} ..

binary-indep: ;
binary-arch: binary-sam
binary:	binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean patch unpatch clean1 \
	binary-sam