2 ############################ -*- Mode: Makefile -*- ###########################
4 ## Author : Manoj Srivastava ( srivasta@tiamat.datasync.com )
5 ## Created On : Thu Oct 29 15:35:55 1998
6 ## Created On Node : tiamat.datasync.com
7 ## Last Modified By : Manoj Srivastava
8 ## Last Modified On : Fri Mar 17 17:01:28 2000
9 ## Last Machine Used: glaurung.green-gryphon.com
11 ## Status : Unknown, Use with caution!
15 ###############################################################################
16 # The name of the package (for example, `emacs').
17 package := $(shell grep Source debian/control | sed 's/^Source: //')
18 arch := $(shell dpkg --print-installation-architecture)
19 date := $(shell date +"%Y-%m-%d")
20 version := $(shell LC_ALL=C dpkg-parsechangelog | \
21 grep ^Version: | sed 's/^Version: *//')
22 ppackage:= packaging-manual
24 FILES_TO_CLEAN = debian/files debian/buildinfo debian/substvars \
25 debian/postinst debian/prerm \
26 version.ent policy.lout policy.lout.ld lout.li \
27 upgrading-checklist.text policy.text.gz \
28 packaging.lout packaging.text.gz packaging.ps \
29 packaging.pdf.gz menu-policy.text.gz \
30 policy-process.text.gz policy-process.pdf.gz \
31 proposal.text.gz menu-policy.pdf.gz proposal.pdf.gz \
32 mime-policy.text.gz mime-policy.pdf.gz
33 STAMPS_TO_CLEAN = stamp-policy stamp-packaging stamp-build stamp-configure
34 DIRS_TO_CLEAN = debian/tmp policy.html fhs debian/tmp-packaging \
35 packaging.html menu-policy.html mime-policy.html \
36 proposal.html policy-process.html
37 SGML_FILES = policy packaging menu-policy mime-policy proposal \
40 # Location of the source dir
41 SRCTOP := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi;)
42 TMPTOP := $(SRCTOP)/debian/tmp
43 DOCDIR := $(TMPTOP)/usr/share/doc/$(package)
44 LIBDIR := $(TMPTOP)/usr/share/doc-base
46 PTMPTOP := $(SRCTOP)/debian/tmp-packaging
47 PDOCDIR := $(PTMPTOP)/usr/share/doc/$(ppackage)
48 PLIBDIR := $(PTMPTOP)/usr/share/doc-base
50 # While we have two versions of the FHS installed in the source package,
51 # we need to modify this to handle it. This is the easiest way to do it.
52 # FHS_ARCHIVE =$(shell ls -1 fhs*.tar.gz)
53 FHS_ARCHIVE =fhs-2.1-pre-03.tar.gz
54 FHS_FILES =fhs/fhs.dvi fhs/fhs.ps fhs/fhs.txt
55 FSSTND_FILES =FSSTND-FAQ fsstnd-1.2.dvi.gz fsstnd-1.2.ps.gz fsstnd-1.2.txt.gz
56 POLICY_FILES =policy.text.gz policy.sgml virtual-package-names-list.text \
57 upgrading-checklist.text libc6-migration.text \
58 version.ent proposal.sgml proposal.text.gz \
59 menu-policy.sgml menu-policy.text.gz \
60 mime-policy.sgml mime-policy.text.gz \
61 policy-process.text.gz policy-process.sgml
62 BYHAND_FILES =policy.text.gz libc6-migration.text \
63 virtual-package-names-list.text menu-policy.text.gz \
65 PBYHAND_FILES=packaging.text.gz
67 install_file = /usr/bin/install -p -o root -g root -m 644
68 install_program= /usr/bin/install -p -o root -g root -m 755
69 make_directory = /usr/bin/install -p -d -o root -g root -m 755
72 all build: stamp-build
75 -test -f stamp-configure || $(MAKE) -f debian/rules configure
76 for file in $(SGML_FILES); do \
77 nsgmls -gues $$file.sgml; \
78 debiandoc2html $$file.sgml; \
79 debiandoc2text $$file.sgml; \
80 if [ -f $$file.txt ]; then mv $$file.txt $$file.text; fi; \
81 gzip -9f $$file.text; \
83 tar zfx $(FHS_ARCHIVE)
84 lynx -dump upgrading-checklist.html > upgrading-checklist.text
87 configure: stamp-configure
90 echo "<!entity version \"$(version)\">" >> version.ent
91 echo "<!entity date \"$(date)\">" >> version.ent
95 # Undoes the effect of `make -f debian/rules build'.
97 rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
98 rm -rf $(DIRS_TO_CLEAN)
99 rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o \
100 -name '*~' -o -name '*.bak' -o -name '#*#' -o \
101 -name '.*.orig' -o -name '.*.rej' -o -name '.SUMS' -o \
102 -size 0 \) -print` TAGS
105 binary: binary-indep binary-arch
108 # There are no architecture-dependent files to be uploaded
109 # generated by this package. If there were any they would be
112 binary-indep: stamp-policy stamp-packaging
114 @test $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
115 (echo need root priviledges; exit 1)
117 test -f stamp-build || $(MAKE) -f debian/rules build
119 $(make_directory) $(TMPTOP)/DEBIAN
120 $(make_directory) $(DOCDIR)/fsstnd
121 $(make_directory) $(DOCDIR)/fhs
122 $(make_directory) $(LIBDIR)
123 # create a substvar to reference from debian/control so that
124 # we don't hardcode the policy compliance of the policy
125 # package. I guess some might question this but I take it as
126 # a given that the debian-policy pkg must always comply with
128 echo "debian-policy:Version=$(version)" > debian/substvars
129 echo "packaging-manual:Version=$(version)" >> debian/substvars
130 $(install_file) $(POLICY_FILES) $(DOCDIR)/
131 $(install_file) $(FSSTND_FILES) $(DOCDIR)/fsstnd/
132 $(install_file) $(FHS_FILES) $(DOCDIR)/fhs/
133 $(install_file) debian/changelog $(DOCDIR)/
134 -gzip -fqr9 $(DOCDIR)
135 $(install_file) debian/copyright $(DOCDIR)/
136 $(install_file) debian-policy.desc $(LIBDIR)/debian-policy
137 (tar cf - policy.html) | (cd $(DOCDIR); tar xf -)
138 (tar cf - menu-policy.html) | (cd $(DOCDIR); tar xf -)
139 (tar cf - mime-policy.html) | (cd $(DOCDIR); tar xf -)
140 (tar cf - proposal.html) | (cd $(DOCDIR); tar xf -)
141 (tar cf - policy-process.html) | (cd $(DOCDIR); tar xf -)
142 sed -e 's/#PACKAGE#/$(package)/g' debian/postinst.in > debian/postinst
143 sed -e 's/#PACKAGE#/$(package)/g' debian/prerm.in > debian/prerm
144 $(install_program) debian/{postinst,prerm} debian/tmp/DEBIAN/
145 dpkg-gencontrol -pdebian-policy -Pdebian/tmp -isp
146 chown -R root.root debian/tmp
147 chmod -R go=rX debian/tmp
148 dpkg --build debian/tmp ..
149 debiandoc2latexps policy.sgml
151 gzip -9qvf ../policy.ps
152 debiandoc2latexpdf policy.sgml
154 gzip -9qfv ../policy.pdf
155 GZIP=-9v tar zcf ../policy.html.tar.gz policy.html
156 dpkg-distaddfile -fdebian/files policy.ps.gz byhand -
157 dpkg-distaddfile -fdebian/files policy.pdf.gz byhand -
158 dpkg-distaddfile -fdebian/files policy.html.tar.gz byhand -
159 for i in $(BYHAND_FILES); do \
160 $(install_file) $$i .. ; \
161 dpkg-distaddfile -fdebian/files $$i byhand - ; \
165 stamp-packaging: build
166 @test $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
167 (echo need root priviledges; exit 1)
169 test -f stamp-build || $(MAKE) -f debian/rules build
171 $(make_directory) $(PTMPTOP)/DEBIAN
172 $(make_directory) $(PDOCDIR)
173 $(make_directory) $(PLIBDIR)
174 echo "debian-policy:Version=$(version)" > debian/substvars
175 echo "packaging-manual:Version=$(version)" >> debian/substvars
177 $(install_file) packaging.sgml $(PDOCDIR)/
178 $(install_file) version.ent $(PDOCDIR)/
179 $(install_file) debian/changelog $(PDOCDIR)/
180 -gzip -fqr9 $(PDOCDIR)
181 $(install_file) packaging.text.gz $(PDOCDIR)/
182 $(install_file) debian/copyright $(PDOCDIR)/
183 $(install_file) packaging-manual.desc $(PLIBDIR)/packaging-manual
184 (tar cf - packaging.html) | (cd $(PDOCDIR); tar xf -)
185 sed -e 's/#PACKAGE#/$(ppackage)/g' debian/postinst.in > debian/postinst
186 sed -e 's/#PACKAGE#/$(ppackage)/g' debian/prerm.in > debian/prerm
187 $(install_program) debian/{postinst,prerm} debian/tmp-packaging/DEBIAN/
188 dpkg-gencontrol -ppackaging-manual -Pdebian/tmp-packaging -isp
189 chown -R root.root debian/tmp-packaging
190 chmod -R go=rX debian/tmp-packaging
191 dpkg --build debian/tmp-packaging ..
192 debiandoc2latexps packaging.sgml
193 debiandoc2latexpdf packaging.sgml
196 gzip -9vf ../packaging.ps
197 gzip -9vf ../packaging.pdf
198 GZIP=-9v tar zcf ../packaging.html.tar.gz packaging.html
199 dpkg-distaddfile -fdebian/files packaging.ps.gz byhand -
200 dpkg-distaddfile -fdebian/files packaging.pdf.gz byhand -
201 dpkg-distaddfile -fdebian/files packaging.html.tar.gz byhand -
202 for i in $(PBYHAND_FILES); do \
203 $(install_file) $$i .. ; \
204 dpkg-distaddfile -fdebian/files $$i byhand - ; \
210 test -f debian/rules -a -f policy.sgml
214 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
216 .PHONY: binary binary-arch binary-indep clean checkroot