File: rules

package info (click to toggle)
elvis-tiny 1.4-20
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 728 kB
  • ctags: 1,056
  • sloc: ansic: 13,870; makefile: 231; sh: 33
file content (75 lines) | stat: -rwxr-xr-x 2,156 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
#! /usr/bin/make -f
#
#	debian/rules file for elvis-tiny
#

# Name.
pkg	= elvis-tiny
tmp	= $(shell pwd)/debian/tmp

SHELL	= /bin/bash
LC_ALL	= POSIX

define checkdir
	test -f cmd1.c
endef

build:
# Builds the binary package.
	$(checkdir)
	make CC="$(CC) -fsigned-char"
	$(CC) -O2 -s -o debian/wrapper debian/wrapper.c
	touch build

# Architecture independant files.
binary-indep:   build
	$(checkdir)

# Make a binary package (.deb file)
binary-arch:	build checkroot
	-rm -rf $(tmp)
	install -d -g root -m 755 -o root $(tmp)
	install -d -g root -m 755 -o root $(tmp)/DEBIAN
	install -d -g root -m 755 -o root $(tmp)/bin
	install -d -g root -m 755 -o root $(tmp)/usr
	install -d -g root -m 755 -o root $(tmp)/usr/share
	install -d -g root -m 755 -o root $(tmp)/usr/share/doc
	install -d -g root -m 755 -o root $(tmp)/usr/share/doc/$(pkg)
	install -d -g root -m 755 -o root $(tmp)/usr/share/man
	install -d -g root -m 755 -o root $(tmp)/usr/share/man/man1
	install -g root -s -m 755 debian/wrapper $(tmp)/bin/vi
	strip --remove-section=.comment --remove-section=.note $(tmp)/bin/vi
	install -g root -s -m 755 elvis $(tmp)/bin/elvis-tiny
	strip --remove-section=.comment --remove-section=.note $(tmp)/bin/elvis-tiny
	install -g root -m 644 debian/changelog \
		$(tmp)/usr/share/doc/$(pkg)/changelog.Debian
	install -g root -m 644 debian/changelog.upstream \
		$(tmp)/usr/share/doc/$(pkg)/changelog
	install -g root -m 644 KNOWN.BUGS $(tmp)/usr/share/doc/$(pkg)
	install -g root -m 644 debian/elvis-tiny.1 $(tmp)/usr/share/man/man1
	gzip -9f $(tmp)/usr/share/man/man1/*
	gzip -9f $(tmp)/usr/share/doc/$(pkg)/*

	install -g root -m 644 debian/copyright $(tmp)/usr/share/doc/$(pkg)

	install -g root -m 755 debian/postinst $(tmp)/DEBIAN
	install -g root -m 755 debian/prerm $(tmp)/DEBIAN

	dpkg-shlibdeps elvis
	dpkg-gencontrol -isp
	dpkg --build $(tmp) ..
	rm -rf $(tmp)

clean:	checkroot
	-make clobber
	rm -f build debian/{files,substvars,wrapper}
	rm -rf $(tmp)
	find . -name '*.bak' -o -name '*~' | xargs -r rm -f --

binary: binary-indep binary-arch

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

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