cvsimport
[findutils.git] / debian.rules
Commit [+]AuthorDateLineData
a5cadd30 kevin1996-02-04 20:47:30 +00001#! /usr/bin/make -f
2#
1023a10e kevin1996-05-27 08:10:50 +00003# Last updated: 1996/05/27 08:10:50 by Kevin Dalley <kevin@aimnet.com>
a5cadd30 kevin1996-02-04 20:47:30 +00004#
5# To make the binary distribution package, the ``Debianized'' source package
6# and the context diff to the original package, type `./debian.rules dist'.
7# Make sure that `debian.rules' is executable before the final distribution
8# is made.
9#
10# Invoke each target with `./debian.rules <target>'. All targets should be
11# invoked with the package root as the current directory.
12#
13# The `binary' target must be run as root, as it needs to install files with
14# specific ownerships. The `diff' target assumes that you have the original
15f801f3 kevin1996-04-14 07:12:26 +000015# source package available, unpacked, in ../$(package)-$(version).orig, or that you have
a5cadd30 kevin1996-02-04 20:47:30 +000016# the previous revision of the ``Debianized'' source package and context diff
17# in the parent directory.
18
19CC = gcc
20CFLAGS = -O2
21LDFLAGS = -s
22
23# The name of the package (for example, `emacs').
3ecf5d25 kevin1996-02-25 22:00:48 +000024package = findutils
a5cadd30 kevin1996-02-04 20:47:30 +000025# The version of the package (for example, `19.28').
6373cc23 kevin1996-02-25 21:28:38 +000026version = 4.1
a5cadd30 kevin1996-02-04 20:47:30 +000027# The Debian revision of the package (for example, `2').
51c67d32 kevin1996-10-21 07:32:07 +000028debian = 12
a5cadd30 kevin1996-02-04 20:47:30 +000029
30build:
31# Builds the binary package.
32 ./configure --prefix=/usr
33 make CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
34 libexecdir=/usr/lib/locate localstatedir=/var/lib/locate
35 ( cd doc ; makeinfo find.texi )
36 touch stamp-build
37
38clean:
39# Undoes the effect of `make -f debian.rules build'.
40 make distclean
a5cadd30 kevin1996-02-04 20:47:30 +000041 rm -f stamp-build
42 rm -rf debian-tmp
43
44binary:
45# Makes a binary package.
46 test -f stamp-build || make -f debian.rules build
47 install -d -g root -m 755 -o root debian-tmp
48 chmod g-s debian-tmp
49 install -d -g root -m 755 -o root debian-tmp/DEBIAN
50 install -d -g root -m 755 -o root debian-tmp/etc/cron.daily
51 install -g root -m 755 -o root cron.find \
52 debian-tmp/etc/cron.daily/find
53 install -d -g root -m 755 -o root debian-tmp/usr/bin
54 install -g root -m 755 -o root find/find \
55 debian-tmp/usr/bin/find
56 install -g root -m 755 -o root locate/locate \
57 debian-tmp/usr/bin/locate
58 install -g root -m 755 -o root locate/updatedb \
59 debian-tmp/usr/bin/updatedb
60 install -g root -m 755 -o root xargs/xargs \
61 debian-tmp/usr/bin/xargs
62 install -d -g root -m 755 -o root debian-tmp/usr/info
63 install -g root -m 644 -o root doc/find.info* \
64 debian-tmp/usr/info
65 install -d -g root -m 755 -o root debian-tmp/usr/lib/locate
3ecf5d25 kevin1996-02-25 22:00:48 +000066 install -g root -m 755 -o root locate/bigram locate/code \
67 locate/frcode debian-tmp/usr/lib/locate
a5cadd30 kevin1996-02-04 20:47:30 +000068 install -d -g root -m 755 -o root debian-tmp/usr/man/man1
69 install -g root -m 644 -o root find/find.1 \
70 debian-tmp/usr/man/man1/find.1
71 install -g root -m 644 -o root locate/locate.1 \
72 debian-tmp/usr/man/man1/locate.1
73 install -g root -m 644 -o root locate/updatedb.1 \
74 debian-tmp/usr/man/man1/updatedb.1
75 install -g root -m 644 -o root xargs/xargs.1 \
76 debian-tmp/usr/man/man1/xargs.1
77 install -d -g root -m 755 -o root debian-tmp/usr/man/man5
78 install -d -g root -m 755 -o root debian-tmp/usr/lib/locate
79 install -d -g root -m 755 -o root debian-tmp/var/lib
80 install -d -g nogroup -m 2755 -o nobody debian-tmp/var/lib/locate
81 install -g root -m 644 -o root locate/locatedb.5 \
82 debian-tmp/usr/man/man5/locatedb.5
83 install -d -g root -m 755 -o root debian-tmp/usr/doc/copyright
84 install -g root -m 644 -o root debian.README \
3ecf5d25 kevin1996-02-25 22:00:48 +000085 debian-tmp/usr/doc/copyright/$(package)
a5cadd30 kevin1996-02-04 20:47:30 +000086 rm -f debian-tmp/usr/info/find.info*.gz
87 gzip -9f debian-tmp/usr/info/find.info*
51c67d32 kevin1996-10-21 07:32:07 +000088 sed -e '1s/=/$(package)/; \
89 2s/=/$(version)-$(debian)/; \
15f801f3 kevin1996-04-14 07:12:26 +000090 3s/=/$(shell dpkg --print-architecture)/;' \
91 debian.control > debian-tmp/DEBIAN/control
a5cadd30 kevin1996-02-04 20:47:30 +000092 chmod 644 debian-tmp/DEBIAN/control
93 install -g root -m 644 -o root debian.conffiles \
94 debian-tmp/DEBIAN/conffiles
95 install -g root -m 755 -o root debian.postinst \
96 debian-tmp/DEBIAN/postinst
97 install -g root -m 755 -o root debian.postrm \
98 debian-tmp/DEBIAN/postrm
915a3824 kevin1996-03-12 06:32:03 +000099 install -g root -m 755 -o root debian.preinst \
100 debian-tmp/DEBIAN/preinst
a5cadd30 kevin1996-02-04 20:47:30 +0000101 dpkg --build debian-tmp
1023a10e kevin1996-05-27 08:10:50 +0000102 mv debian-tmp.deb \
103 ../$(package)-$(version)-$(debian).$(shell dpkg --print-architecture).deb
a5cadd30 kevin1996-02-04 20:47:30 +0000104
15f801f3 kevin1996-04-14 07:12:26 +0000105source: clean
a5cadd30 kevin1996-02-04 20:47:30 +0000106# Makes a source package.
3ecf5d25 kevin1996-02-25 22:00:48 +0000107 ( cd .. && tar cf - $(package)-$(version) | \
108 gzip -9f > $(package)-$(version)-$(debian).tar.gz )
a5cadd30 kevin1996-02-04 20:47:30 +0000109
15f801f3 kevin1996-04-14 07:12:26 +0000110diff: clean
a5cadd30 kevin1996-02-04 20:47:30 +0000111# Makes a context diff.
3ecf5d25 kevin1996-02-25 22:00:48 +0000112 -test -d ../$(package)-$(version).orig -o \
113 -f ../$(package)-$(version)-`expr $(debian) - 1`.diff.gz \
a5cadd30 kevin1996-02-04 20:47:30 +0000114 || ( echo "Original source package is not available." ; false )
3ecf5d25 kevin1996-02-25 22:00:48 +0000115 -test -d ../$(package)-$(version).orig || make -f debian.rules orig
116 #cp -a ../$(package)-$(version).orig/doc/find.info* doc
15f801f3 kevin1996-04-14 07:12:26 +0000117 cd .. && \
118 (diff -ruN $(package)-$(version).orig $(package)-$(version) \
119 >$(package)-$(version)-$(debian).diff; [ $$? = 1 ]) && \
120 gzip -9vf $(package)-$(version)-$(debian).diff
a5cadd30 kevin1996-02-04 20:47:30 +0000121 -test -f stamp-orig \
3ecf5d25 kevin1996-02-25 22:00:48 +0000122 && rm -rf ../$(package)-$(version).orig && rm -f stamp-orig
a5cadd30 kevin1996-02-04 20:47:30 +0000123
124dist: binary source diff
125# Prepares the package for distribution.
126
127orig:
128# Prepares the original package from the previous
129# Debian revision source package and context diff.
130 ( cd .. \
3ecf5d25 kevin1996-02-25 22:00:48 +0000131 && mkdir $(package).orig \
132 && cd $(package).orig \
133 && tar xzf ../$(package)-$(version)-`expr $(debian) - 1`.tar.gz \
134 && cd $(package)-$(version) \
135 && ( zcat ../../$(package)-$(version)-`expr $(debian) - 1`.diff.gz \
a5cadd30 kevin1996-02-04 20:47:30 +0000136 | patch -sER -p1 ) \
137 && find . -name "*.orig" -exec rm -f {} \; \
138 && cd .. \
3ecf5d25 kevin1996-02-25 22:00:48 +0000139 && mv $(package)-$(version) ../$(package)-$(version).orig \
a5cadd30 kevin1996-02-04 20:47:30 +0000140 && cd .. \
3ecf5d25 kevin1996-02-25 22:00:48 +0000141 && rmdir $(package).orig )
a5cadd30 kevin1996-02-04 20:47:30 +0000142 touch stamp-orig