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 Oct 30 00:19:38 1998
9 ## Last Machine Used: tiamat.datasync.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-architecture)
19 date := $(shell date +"%Y-%m-%d")
20 version := $(shell LC_ALL=C dpkg-parsechangelog | \
21 grep ^Version: | sed 's/^Version: *//')
23 FILES_TO_CLEAN = debian/files debian/buildinfo debian/substvars \
25 STAMPS_TO_CLEAN = stamp-binary stamp-build stamp-configure
26 DIRS_TO_CLEAN = debian/tmp policy.html policy.text* policy.lout* \
27 lout.li upgrading-checklist.text
29 # Location of the source dir
30 SRCTOP := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi;)
31 TMPTOP := $(SRCTOP)/debian/tmp
32 DOCDIR := $(TMPTOP)/usr/doc/$(package)
33 LIBDIR := $(TMPTOP)/usr/share/doc-base
35 FSSTND_FILES =FSSTND-FAQ fsstnd-1.2.dvi.gz fsstnd-1.2.ps.gz fsstnd-1.2.txt.gz
36 POLICY_FILES =policy.text.gz policy.sgml virtual-package-names-list.text \
37 upgrading-checklist.text libc6-migration.text
38 BYHAND_FILES =policy.text.gz libc6-migration.text\
39 virtual-package-names-list.text
41 install_file = /usr/bin/install -p -o root -g root -m 644
42 install_program= /usr/bin/install -p -o root -g root -m 755
43 make_directory = /usr/bin/install -p -d -o root -g root -m 755
46 all build: stamp-build
49 -test -f stamp-configure || $(MAKE) -f debian/rules configure
50 nsgmls -gues policy.sgml # check SGML syntax
51 debiandoc2html policy.sgml
52 debiandoc2text policy.sgml
53 lynx -dump upgrading-checklist.html > upgrading-checklist.text
57 configure: stamp-configure
60 echo "<!entity version \"$(version)\">" >> version.ent
61 echo "<!entity date \"$(date)\">" >> version.ent
64 # Undoes the effect of `make -f debian/rules build'.
66 rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
67 rm -rf $(DIRS_TO_CLEAN)
68 rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o \
69 -name '*~' -o -name '*.bak' -o -name '#*#' -o \
70 -name '.*.orig' -o -name '.*.rej' -o -name '.SUMS' -o \
71 -size 0 \) -print` TAGS
74 binary: binary-indep binary-arch
77 # There are no architecture-dependent files to be uploaded
78 # generated by this package. If there were any they would be
81 binary-indep: stamp-binary
83 @test root = "`whoami`" || (echo need root priviledges; exit 1)
85 test -f stamp-build || $(MAKE) -f debian/rules build
87 $(make_directory) $(TMPTOP)/DEBIAN
88 $(make_directory) $(DOCDIR)/fsstnd
89 $(make_directory) $(LIBDIR)
90 # create a substvar to reference from debian/control so that
91 # we don't hardcode the policy compliance of the policy
92 # package. I guess some might question this but I take it as
93 # a given that the debian-policy pkg must always comply with
95 echo "debian-policy:Version=$(version)" > debian/substvars
96 $(install_file) $(POLICY_FILES) $(DOCDIR)/
97 $(install_file) $(FSSTND_FILES) $(DOCDIR)/fsstnd/
98 $(install_file) debian/changelog $(DOCDIR)/
100 $(install_file) debian-policy.desc $(LIBDIR)/
101 $(install_file) debian/copyright $(DOCDIR)/
102 (tar cf - policy.html) | (cd $(DOCDIR); tar xf -)
103 $(install_program) debian/{postinst,prerm} debian/tmp/DEBIAN/
105 chown -R root.root debian/tmp
106 chmod -R go=rX debian/tmp
107 dpkg --build debian/tmp ..
108 debiandoc2ps -pa4 -1 -O policy.sgml | gzip -9v > ../policy.ps.gz
109 GZIP=-9v tar zcf ../policy.html.tar.gz policy.html
110 dpkg-distaddfile -fdebian/files policy.ps.gz byhand -
111 dpkg-distaddfile -fdebian/files policy.html.tar.gz byhand -
112 for i in $(BYHAND_FILES); do \
113 $(install_file) $$i .. ; \
114 dpkg-distaddfile -fdebian/files $$i byhand - ; \
119 test -f debian/rules -a -f policy.sgml
123 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
125 .PHONY: binary binary-arch binary-indep clean checkroot