]> git.deb.at Git - pkg/t-prot.git/blob - debian/rules
Imported Debian patch 2.1-1
[pkg/t-prot.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for t-prot package
3
4 PKG = t-prot
5 TMP = $(CURDIR)/debian/$(PKG)
6
7 INSTALL = install
8 INSTALL_FILE    = $(INSTALL) -p    -oroot -groot -m644
9 INSTALL_PROGRAM = $(INSTALL) -p    -oroot -groot -m755
10 INSTALL_SCRIPT  = $(INSTALL) -p    -oroot -groot -m755
11 INSTALL_DIR     = $(INSTALL) -p -d -oroot -groot -m755
12
13
14 clean:
15         $(checkdir)
16         $(checkroot)
17         -rm -rf $(TMP) debian/files
18
19
20 build:
21         # uhm, build for a binary-indep package?  Don't try to be funny ;)
22
23
24 install: build
25         $(checkdir)
26         $(checkroot)
27         -rm -rf $(TMP)
28         $(INSTALL_DIR) $(TMP)
29         cd $(TMP) && $(INSTALL_DIR) etc usr/bin usr/share/man/man1 \
30                 usr/share/slrn/macros usr/share/doc/$(PKG)/examples
31         #       usr/share/doc/$(PKG)/contrib
32         $(INSTALL_SCRIPT) t-prot   $(TMP)/usr/bin
33         patch $(TMP)/usr/bin/t-prot \
34                 contrib/t-prot-r*-mutt157.diff
35         -rm -f $(TMP)/usr/bin/t-prot.orig
36         $(INSTALL_FILE)   t-prot.1 $(TMP)/usr/share/man/man1
37         $(INSTALL_FILE) debian/Muttrc.t-prot $(TMP)/etc
38         $(INSTALL_FILE) contrib/t-prot.sl $(TMP)/usr/share/slrn/macros
39         patch $(TMP)/usr/share/slrn/macros/t-prot.sl \
40                 contrib/t-prot.sl-slang2.diff
41         -rm -f $(TMP)/usr/share/slrn/macros/t-prot.sl.orig
42
43         $(INSTALL_FILE) TODO README $(TMP)/usr/share/doc/$(PKG)
44         #$(INSTALL_FILE) contrib/README.patches contrib/t-prot-r*-gol.diff \
45         #       contrib/t-prot-r*-indentms.diff \
46         #       $(TMP)/usr/share/doc/$(PKG)/contrib
47         cp -pR contrib/muttrc.t-prot contrib/filter_innd.pl \
48                 contrib/README.examples debian/footers debian/README.footers \
49                 $(TMP)/usr/share/doc/$(PKG)/examples
50         $(INSTALL_FILE) ChangeLog \
51                 $(TMP)/usr/share/doc/$(PKG)/changelog
52         cd $(TMP)/usr/share && gzip -9 doc/$(PKG)/changelog \
53                 man/man1/t-prot.1
54         find $(TMP) -print0 2>/dev/null | xargs -0r \
55                 chown --no-dereference 0.0
56         find $(TMP) ! -type l -print0 2>/dev/null | xargs -0r \
57                 chmod go=rX,u+rw,a-s
58
59
60 binary-indep: build install
61         $(checkdir)
62         $(checkroot)
63         $(INSTALL_DIR) $(TMP)/DEBIAN
64         $(INSTALL_FILE) debian/copyright debian/README.Debian \
65                 debian/NEWS.Debian $(TMP)/usr/share/doc/$(PKG)
66         $(INSTALL_FILE) debian/changelog \
67                 $(TMP)/usr/share/doc/$(PKG)/changelog.Debian
68         cd $(TMP)/usr/share/doc/$(PKG) && gzip -9 \
69                 changelog.Debian NEWS.Debian
70         $(INSTALL_SCRIPT) debian/postinst debian/postrm debian/config \
71                 $(TMP)/DEBIAN
72         po2debconf debian/templates > $(TMP)/DEBIAN/templates
73         $(INSTALL_FILE) debian/conffiles \
74                 $(TMP)/DEBIAN
75         dpkg-gencontrol -ldebian/changelog -isp -p$(PKG) -P$(TMP)
76         cd $(TMP) && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
77                 xargs -r0 md5sum > DEBIAN/md5sums
78         dpkg --build $(TMP) ..
79
80
81 binary-arch: build install
82         # We have nothing to do here.
83
84
85 binary: binary-indep binary-arch
86
87
88 define checkdir
89         test -f debian/rules
90 endef
91
92 define checkroot
93         test root = "`whoami`"
94 endef
95
96 .PHONY: build clean binary-indep binary-arch binary install