File: rules

package info (click to toggle)
rlpr 2.02-7woody1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 860 kB
  • ctags: 685
  • sloc: ansic: 5,917; sh: 318; makefile: 256; sed: 93
file content (90 lines) | stat: -rwxr-xr-x 2,478 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
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file - for rlpr
# Copyright 1997-2002 by Brian Mays
# Patterned after the hello package by Ian Jackson.

package=rlpr

# Stupid hack dictated by policy wonks
CFLAGS=-O2 -Wall
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif

Makefile:
	$(checkdir)
	./configure --prefix=/usr/share --exec-prefix=/usr

build:	Makefile
	$(checkdir)
	$(MAKE) CFLAGS='$(CFLAGS)' all
	touch build

clean:	Makefile
	$(checkdir)
	$(RM) build
	$(MAKE) distclean
	$(RM) config.cache
	$(RM) -r *~ debian/tmp debian/substvars debian/*~ debian/files*

binary-indep:	checkroot build
	$(checkdir)

binary-arch:	checkroot build
	$(chechdir)
	$(RM) -r debian/tmp
	install -d debian/tmp debian/tmp/DEBIAN
	install -d debian/tmp/usr/share/doc/$(package)
# Install Debian package control information files
	install debian/postinst debian/prerm \
	  debian/tmp/DEBIAN/.
# Install directories
	install -d debian/tmp/usr/bin
	install -d debian/tmp/usr/share/man/man1
	install -d debian/tmp/usr/share/man/man5
	install -d debian/tmp/usr/share/man/man8
# Install files
	$(MAKE) install install-setuid \
	  prefix=$(shell pwd)/debian/tmp/usr/share \
	  exec_prefix=$(shell pwd)/debian/tmp/usr
	rmdir debian/tmp/usr/share/share
# Strip binaries (including hack by policy wonks)
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	strip -R.note -R.comment debian/tmp/usr/bin/*
endif
# Install documentation
	install -m 644 NEWS debian/tmp/usr/share/doc/$(package)/changelog
	install -m 644 README debian/tmp/usr/share/doc/$(package)/.
	install -m 644 debian/BSD-compat.txt \
	  debian/tmp/usr/share/doc/$(package)/.
# Install changelog & copyright
	install -m 644 debian/changelog \
	  debian/tmp/usr/share/doc/$(package)/changelog.Debian
	gzip -9v debian/tmp/usr/share/doc/$(package)/*
	gzip -9v debian/tmp/usr/share/man/*/*
	install -m 644 debian/copyright debian/tmp/usr/share/doc/$(package)/.
# Determine shared library dependencies
	dpkg-shlibdeps src/rlpr src/rlpq src/rlprm src/rlprd
# Genereate deb file
	dpkg-gencontrol -isp
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg-deb --build debian/tmp ..

define checkdir
	test -f src/rlpr.h -a -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

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

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

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