a53dd37b8762baa397b09c8127f6c45086b5f3db
[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         $(install_file) debian/copyright debian/tmp/usr/share/doc/grml-debian-keyring/
40
41         dpkg-gencontrol -pgrml-debian-keyring -isp
42         chown -R root.root debian/tmp
43         chmod -R go=rX debian/tmp
44         dpkg --build debian/tmp ..
45
46 binary-arch:
47
48 define checkdir
49         test -f keyrings/grml-debian-keyring.gpg
50         test -f keyrings/grml-debian-removed-keys.gpg
51 endef
52
53 # Below here is fairly generic really
54
55 binary:         binary-indep binary-arch
56
57 checkroot:
58         $(checkdir)
59         test root = "`whoami`"
60
61 .PHONY: binary binary-arch binary-indep clean checkroot