]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/rules
Initial revision
[debian/debian-policy.git] / debian / rules
1 #!/usr/bin/make -f
2
3 DEB_VERSION     := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | sed 's/^Version: *//')
4 DATE            := $(shell date +"%Y-%m-%d")
5
6 build:
7         $(checkdir)
8         rm -f version.ent
9         echo "<!entity version \"$(DEB_VERSION)\">" >> version.ent
10         echo "<!entity date    \"$(DATE)\">"        >> version.ent
11         nsgmls -gues policy.sgml        # check SGML syntax
12         debiandoc2html policy.sgml
13         debiandoc2text policy.sgml
14         lynx -dump upgrading-checklist.html > upgrading-checklist.text
15         gzip -9 policy.text
16         touch build
17
18 clean:
19         $(checkdir)
20         -rm -f build
21         -rm -rf policy.html policy.text* policy.lout*
22         -rm -rf lout.li
23         -rm -rf upgrading-checklist.text
24         -rm -f `find . -name "*~"`
25         -rm -rf debian/tmp debian/files* core debian/substvars
26         -rm -rf version.ent
27
28 binary-indep:   checkroot build
29         $(checkdir)
30         -rm -rf debian/tmp
31         install -d debian/tmp
32         cd debian/tmp && install -d `cat ../dirs`
33
34         # create a substvar to reference from debian/control so that
35         # we don't hardcode the policy compliance of the policy
36         # package.  I guess some might question this but I take it as
37         # a given that the debian-policy pkg must always comply with
38         # itself...
39         echo "debian-policy:Version=$(DEB_VERSION)" > debian/substvars
40
41         cp -a policy.html debian/tmp/usr/doc/debian-policy/
42         cp policy.text.gz debian/tmp/usr/doc/debian-policy/
43         cat policy.sgml | gzip -9 > debian/tmp/usr/doc/debian-policy/policy.sgml.gz
44         cp FSSTND-FAQ fsstnd* debian/tmp/usr/doc/debian-policy/fsstnd/
45         cp virtual-package-names-list.text debian/tmp/usr/doc/debian-policy/
46         cp upgrading-checklist.text debian/tmp/usr/doc/debian-policy/
47         cp libc6-migration.text debian/tmp/usr/doc/debian-policy/
48         gzip -9 debian/tmp/usr/doc/debian-policy/fsstnd/FSSTND-FAQ
49         cp debian/changelog debian/tmp/usr/doc/debian-policy/
50         gzip -9 debian/tmp/usr/doc/debian-policy/{changelog,libc6-migration.text,virtual-package-names-list.text,upgrading-checklist.text}
51         cp debian-policy.desc debian/tmp/usr/share/doc-base/debian-policy
52         cp debian/copyright debian/tmp/usr/doc/debian-policy/
53         mkdir debian/tmp/DEBIAN
54         cp debian/{postinst,prerm} debian/tmp/DEBIAN/
55         chmod +x debian/tmp/DEBIAN/{postinst,prerm}
56         dpkg-gencontrol -isp
57         chown -R root.root debian/tmp
58         chmod -R go=rX debian/tmp
59         dpkg --build debian/tmp ..
60         debiandoc2ps -pa4 -1 -O policy.sgml | gzip -9v > ../policy.ps.gz
61         dpkg-distaddfile -fdebian/files policy.ps.gz byhand -
62         GZIP=-9v tar zcf ../policy.html.tar.gz policy.html
63         dpkg-distaddfile -fdebian/files policy.html.tar.gz byhand -
64         cp policy.text.gz ..
65         dpkg-distaddfile -fdebian/files policy.text.gz byhand -
66         cp virtual-package-names-list.text ..
67         dpkg-distaddfile -fdebian/files virtual-package-names-list.text byhand -
68         cp libc6-migration.text ..
69         dpkg-distaddfile -fdebian/files libc6-migration.text byhand -
70
71 binary-arch:    checkroot build
72         $(checkdir)
73 # There are no architecture-dependent files to be uploaded
74 # generated by this package.  If there were any they would be
75 # made here.
76
77 define checkdir
78         test -f debian/rules
79 endef
80
81 # Below here is fairly generic really
82
83 binary:         binary-indep binary-arch
84
85 checkroot:
86         $(checkdir)
87         test root = "`whoami`"
88
89 .PHONY: binary binary-arch binary-indep clean checkroot