]> git.deb.at Git - pkg/t-prot.git/blob - debian/rules
update my name
[pkg/t-prot.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for t-prot package
3 # Copyright 2002-2012 by Rhonda D'Vine <rhonda@debian.org>
4 # Licenced under WTFPLv2
5
6 PKG = t-prot
7 TMP = $(CURDIR)/debian/$(PKG)
8 BUILD_DATE = $(shell dpkg-parsechangelog --show-field Date)
9
10 INSTALL = install
11 INSTALL_FILE    = $(INSTALL) -p    -oroot -groot -m644
12 INSTALL_PROGRAM = $(INSTALL) -p    -oroot -groot -m755
13 INSTALL_SCRIPT  = $(INSTALL) -p    -oroot -groot -m755
14 INSTALL_DIR     = $(INSTALL) -p -d -oroot -groot -m755
15
16
17 clean:
18         $(checkdir)
19         $(checkroot)
20         -rm -rf $(TMP) debian/files debian/stamp-*
21         $(MAKE) -f /usr/share/quilt/quilt.make unpatch
22
23 build: build-arch build-indep
24 build-arch: debian/stamp-build
25 build-indep: debian/stamp-build
26 debian/stamp-build:
27         # only thing to do is apply the patches ...
28         $(MAKE) -f /usr/share/quilt/quilt.make patch
29         touch debian/stamp-build
30
31
32 install: debian/stamp-install
33 debian/stamp-install: build
34         $(checkdir)
35         $(checkroot)
36         -rm -rf $(TMP)
37         $(INSTALL_DIR) $(TMP)
38         cd $(TMP) && $(INSTALL_DIR) etc/t-prot/footers etc/t-prot/ads \
39                 usr/bin usr/share/man/man1 usr/share/slrn/macros \
40                 usr/share/doc/$(PKG)/examples
41         #       usr/share/doc/$(PKG)/contrib
42         $(INSTALL_SCRIPT) t-prot   $(TMP)/usr/bin
43         $(INSTALL_FILE)   t-prot.1 $(TMP)/usr/share/man/man1
44         $(INSTALL_FILE) debian/Muttrc     $(TMP)/etc/t-prot
45         $(INSTALL_FILE) debian/footers/*  $(TMP)/etc/t-prot/footers
46         $(INSTALL_FILE) contrib/t-prot.sl $(TMP)/usr/share/slrn/macros
47
48         $(INSTALL_FILE) TODO README $(TMP)/usr/share/doc/$(PKG)
49         $(INSTALL_FILE) contrib/filter_innd.pl contrib/README.examples \
50                 $(TMP)/usr/share/doc/$(PKG)/examples
51         $(INSTALL_FILE) ChangeLog \
52                 $(TMP)/usr/share/doc/$(PKG)/changelog
53         cd $(TMP)/usr/share && gzip -n9 doc/$(PKG)/changelog \
54                 man/man1/t-prot.1
55
56
57 binary-indep: install
58         $(checkdir)
59         $(checkroot)
60         $(INSTALL_DIR) $(TMP)/DEBIAN
61         $(INSTALL_FILE) debian/copyright debian/README.Debian \
62                 $(TMP)/usr/share/doc/$(PKG)
63         $(INSTALL_FILE) debian/changelog \
64                 $(TMP)/usr/share/doc/$(PKG)/changelog.Debian
65         cd $(TMP)/usr/share/doc/$(PKG) && gzip -n9 \
66                 changelog.Debian
67         $(INSTALL_SCRIPT) debian/postinst debian/postrm debian/config \
68                 $(TMP)/DEBIAN
69         po2debconf debian/templates > $(TMP)/DEBIAN/templates
70         $(INSTALL_FILE) debian/conffiles \
71                 $(TMP)/DEBIAN
72         dpkg-gencontrol -ldebian/changelog -isp -p$(PKG) -P$(TMP)
73         cd $(TMP) && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
74                 xargs -r0 md5sum > DEBIAN/md5sums
75         # Make build reproducible:
76         # Hardcode permissions for files created by output redirection
77         chmod 644 $(TMP)/DEBIAN/md5sums $(TMP)/DEBIAN/templates
78         # Set timestamp of all files to timestamp in debian/changelog entry
79         find $(TMP) -depth -newermt '$(BUILD_DATE)' -print0 | \
80                 xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
81         dpkg --build $(TMP) ..
82
83
84 binary-arch:
85         # We have nothing to do here.
86
87
88 binary: binary-indep
89
90
91 define checkdir
92         test -f debian/rules
93 endef
94
95 define checkroot
96         test root = "`whoami`"
97 endef
98
99 .PHONY: build clean binary-indep binary-arch binary install