changed variables v and d to complete words version and debian
[findutils.git] / debian.rules
blob645919f8921ca8bd031f8faaab61c7afffe7cec2
1 #! /usr/bin/make -f
3 # Last updated: Sat Dec 23 08:53:20 PST 1995 by kevin@aimnet.com
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.
10 # Invoke each target with `./debian.rules <target>'. All targets should be
11 # invoked with the package root as the current directory.
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
15 # source package available, unpacked, in ../$(p)-$(v).orig, or that you have
16 # the previous revision of the ``Debianized'' source package and context diff
17 # in the parent directory.
19 CC = gcc
20 CFLAGS = -O2
21 LDFLAGS = -s
23 # The name of the package (for example, `emacs').
24 p = findutils
25 # The version of the package (for example, `19.28').
26 version = 4.1
27 # The Debian revision of the package (for example, `2').
28 debian = 6
30 build:
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
38 clean:
39 # Undoes the effect of `make -f debian.rules build'.
40 make distclean
41 rm -f doc/find.info*
42 rm -f stamp-build
43 rm -rf debian-tmp
45 binary:
46 # Makes a binary package.
47 test -f stamp-build || make -f debian.rules build
48 install -d -g root -m 755 -o root debian-tmp
49 chmod g-s debian-tmp
50 install -d -g root -m 755 -o root debian-tmp/DEBIAN
51 install -d -g root -m 755 -o root debian-tmp/etc/cron.daily
52 install -g root -m 755 -o root cron.find \
53 debian-tmp/etc/cron.daily/find
54 install -d -g root -m 755 -o root debian-tmp/usr/bin
55 install -g root -m 755 -o root find/find \
56 debian-tmp/usr/bin/find
57 install -g root -m 755 -o root locate/locate \
58 debian-tmp/usr/bin/locate
59 install -g root -m 755 -o root locate/updatedb \
60 debian-tmp/usr/bin/updatedb
61 install -g root -m 755 -o root xargs/xargs \
62 debian-tmp/usr/bin/xargs
63 install -d -g root -m 755 -o root debian-tmp/usr/info
64 install -g root -m 644 -o root doc/find.info* \
65 debian-tmp/usr/info
66 install -d -g root -m 755 -o root debian-tmp/usr/lib/locate
67 install -g root -m 755 -o root locate/bigram locate/code locate/frcode \
68 debian-tmp/usr/lib/locate
69 install -d -g root -m 755 -o root debian-tmp/usr/man/man1
70 install -g root -m 644 -o root find/find.1 \
71 debian-tmp/usr/man/man1/find.1
72 install -g root -m 644 -o root locate/locate.1 \
73 debian-tmp/usr/man/man1/locate.1
74 install -g root -m 644 -o root locate/updatedb.1 \
75 debian-tmp/usr/man/man1/updatedb.1
76 install -g root -m 644 -o root xargs/xargs.1 \
77 debian-tmp/usr/man/man1/xargs.1
78 install -d -g root -m 755 -o root debian-tmp/usr/man/man5
79 install -d -g root -m 755 -o root debian-tmp/usr/lib/locate
80 install -d -g root -m 755 -o root debian-tmp/var/lib
81 install -d -g nogroup -m 2755 -o nobody debian-tmp/var/lib/locate
82 install -g root -m 644 -o root locate/locatedb.5 \
83 debian-tmp/usr/man/man5/locatedb.5
84 install -d -g root -m 755 -o root debian-tmp/usr/doc/copyright
85 install -g root -m 644 -o root debian.README \
86 debian-tmp/usr/doc/copyright/$(p)
87 rm -f debian-tmp/usr/info/find.info*.gz
88 gzip -9f debian-tmp/usr/info/find.info*
89 sed -e 's/=V-D/$(version)-$(debian)/' debian.control \
90 > debian-tmp/DEBIAN/control
91 chmod 644 debian-tmp/DEBIAN/control
92 install -g root -m 644 -o root debian.conffiles \
93 debian-tmp/DEBIAN/conffiles
94 install -g root -m 755 -o root debian.postinst \
95 debian-tmp/DEBIAN/postinst
96 install -g root -m 755 -o root debian.postrm \
97 debian-tmp/DEBIAN/postrm
98 dpkg --build debian-tmp
99 mv debian-tmp.deb ../$(p)-$(v)-$(d).deb
101 source:
102 # Makes a source package.
103 -test -f stamp-build && make -f debian.rules clean
104 ( cd .. && tar cf - $(p)-$(v) | gzip -9f > $(p)-$(v)-$(d).tar.gz )
106 diff:
107 # Makes a context diff.
108 -test -f stamp-build && make -f debian.rules clean
109 -test -d ../$(p)-$(v).orig -o -f ../$(p)-$(v)-`expr $(d) - 1`.diff.gz \
110 || ( echo "Original source package is not available." ; false )
111 -test -d ../$(p)-$(v).orig || make -f debian.rules orig
112 #cp -a ../$(p)-$(v).orig/doc/find.info* doc
113 ( cd .. && diff -cNr $(p)-$(v).orig $(p)-$(v) | gzip -9f \
114 > $(p)-$(v)-$(d).diff.gz )
115 -test -f stamp-orig \
116 && rm -rf ../$(p)-$(v).orig && rm -f stamp-orig
118 dist: binary source diff
119 # Prepares the package for distribution.
121 orig:
122 # Prepares the original package from the previous
123 # Debian revision source package and context diff.
124 ( cd .. \
125 && mkdir $(p).orig \
126 && cd $(p).orig \
127 && tar xzf ../$(p)-$(v)-`expr $(d) - 1`.tar.gz \
128 && cd $(p)-$(v) \
129 && ( zcat ../../$(p)-$(v)-`expr $(d) - 1`.diff.gz \
130 | patch -sER -p1 ) \
131 && find . -name "*.orig" -exec rm -f {} \; \
132 && cd .. \
133 && mv $(p)-$(v) ../$(p)-$(v).orig \
134 && cd .. \
135 && rmdir $(p).orig )
136 touch stamp-orig