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
|
#!/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 = suck
CC = gcc
COPTIONS = -O2 -g -Wall
LDFLAGS = # none
INSTALL = install -s
R = debian/tmp
DIRECTORIES = \
$(R) \
$(R)/DEBIAN \
$(R)/etc \
$(R)/etc/$(P) \
$(R)/etc/cron.weekly \
$(R)/usr \
$(R)/usr/bin \
$(R)/usr/doc \
$(R)/usr/doc/$(P) \
$(R)/usr/lib \
$(R)/usr/lib/$(P) \
$(R)/usr/man \
$(R)/usr/man/man1 \
$(R)/usr/man/man8 \
$(R)/usr/sbin \
$(R)/var \
$(R)/var/lib \
$(R)/var/lib/$(P) \
$(R)/var/lib/$(P)/msg \
$(R)/var/log \
$(R)/var/log/$(P)
# Builds the binary package.
build:
$(checkdir)
./configure
make all lpost 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 Makefile ] || make distclean cleanconfig
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,postrm} $(R)/DEBIAN/.
$(INSTALL) -m 644 debian/conffiles $(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 CHANGELOG $(R)/usr/doc/$(P)/changelog
$(INSTALL) -m 755 debian/$(P).cron $(R)/etc/cron.weekly/$(P)
$(INSTALL) -m 755 debian/get-news $(R)/usr/sbin/.
$(INSTALL) -m 644 debian/get-news.8 $(R)/usr/man/man8/.
$(INSTALL) -m 644 debian/get-news.conf $(R)/etc/$(P)/.
$(INSTALL) -m 755 debian/put-news $(R)/usr/lib/$(P)/.
$(INSTALL) -m 644 debian/sucknewsrc $(R)/etc/$(P)/.
$(INSTALL) -m 644 debian/suckkillfile $(R)/etc/$(P)/.
$(INSTALL) -c -m 755 suck $(R)/usr/bin/suck
#$(INSTALL) -c -m 755 lpost $(R)/usr/bin/lpost
$(INSTALL) -c -m 755 rpost $(R)/usr/bin/rpost
$(INSTALL) -c -m 755 testhost $(R)/usr/bin/testhost
$(INSTALL) -c -m 644 man/suck.1 $(R)/usr/man/man1/suck.1
#$(INSTALL) -c -m 644 man/lpost.1 $(R)/usr/man/man1/lpost.1
$(INSTALL) -c -m 644 man/rpost.1 $(R)/usr/man/man1/rpost.1
$(INSTALL) -c -m 644 man/testhost.1 $(R)/usr/man/man1/testhost.1
gzip -9v $(R)/usr/doc/$(P)/changelog{,.Debian}
gzip -9v $(R)/usr/man/man{1,8}/*
dpkg-shlibdeps suck rpost testhost
dpkg-gencontrol
chown -R root.root $(R)
chmod -R go-ws+rX $(R)
chmod -R u-s+rw $(R)
chown -R news.news $(R)/etc/$(P) $(R)/var/lib/$(P) $(R)/var/log/$(P)
dpkg --build $(R) ..
define checkdir
test -f suckutils.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
|