install Grml origin for dpkg
[grml-debian-keyring.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules file - for debian/keyring
3 # Based on sample debian/rules file - for GNU Hello (1.3).
4 # Copyright 1994,1995 by Ian Jackson.
5 # Copyright 1998-2003 James Troup
6 # I hereby give you perpetual unlimited permission to copy,
7 # modify and relicense this file, provided that you do not remove
8 # my name from the file itself.  (I assert my moral right of
9 # paternity under the Copyright, Designs and Patents Act 1988.)
10 # This file may have to be extensively modified
11
12 install_dir=install -d -m 755
13 install_file=install -m 644
14 install_script=install -m 755
15 install_binary=install -m 755 -s
16
17 VERSION := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)
18
19 build:
20
21 clean:
22         $(checkdir)
23         -rm -f foo foo.asc *.bak *~ */*~ debian/files* debian/*substvars
24         -rm -rf debian/tmp
25
26 binary-indep: checkroot
27         $(checkdir)
28         -rm -rf debian/tmp
29         $(install_dir) debian/tmp/DEBIAN/
30         $(install_script) debian/postinst debian/tmp/DEBIAN/
31         $(install_script) debian/prerm debian/tmp/DEBIAN/
32
33         $(install_dir) debian/tmp/usr/share/keyrings/
34         $(install_file) keyrings/grml-debian-keyring.gpg debian/tmp/usr/share/keyrings/
35         $(install_file) keyrings/grml-debian-removed-keys.gpg debian/tmp/usr/share/keyrings/
36
37         $(install_dir) debian/tmp/usr/share/doc/grml-debian-keyring/
38         $(install_file) debian/changelog debian/tmp/usr/share/doc/grml-debian-keyring/changelog
39         gzip -9 debian/tmp/usr/share/doc/grml-debian-keyring/changelog
40         $(install_file) debian/copyright debian/tmp/usr/share/doc/grml-debian-keyring/
41
42         $(install_dir) debian/tmp/etc/dpkg/origins/
43         $(install_file) origins/Grml debian/tmp/etc/dpkg/origins/
44
45         dpkg-gencontrol -pgrml-debian-keyring -isp
46         chown -R root.root debian/tmp
47         chmod -R go=rX debian/tmp
48         dpkg --build debian/tmp ..
49
50 binary-arch:
51
52 define checkdir
53         test -f keyrings/grml-debian-keyring.gpg
54         test -f keyrings/grml-debian-removed-keys.gpg
55 endef
56
57 # Below here is fairly generic really
58
59 binary:         binary-indep binary-arch
60
61 checkroot:
62         $(checkdir)
63         test root = "`whoami`"
64
65 .PHONY: binary binary-arch binary-indep clean checkroot