]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/rules
Integrate the new policy files
[debian/debian-policy.git] / debian / rules
1 #!/usr/bin/make -f
2 ############################ -*- Mode: Makefile -*- ###########################
3 ## rules ---
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 : Tue Jun 29 10:27:46 1999
9 ## Last Machine Used: glaurung.green-gryphon.com
10 ## Update Count     : 45
11 ## Status           : Unknown, Use with caution!
12 ## HISTORY          :
13 ## Description      :
14 ## $Id$
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
23
24 FILES_TO_CLEAN  = debian/files debian/buildinfo  debian/substvars \
25                   version.ent  policy.lout policy.lout.ld lout.li \
26                   upgrading-checklist.text policy.text.gz \
27                   packaging.lout packaging.text.gz packaging.ps \
28                   packaging.pdf.gz menu-policy.text.gz \
29                   proposal.text.gz menu-policy.pdf.gz proposal.pdf.gz
30 STAMPS_TO_CLEAN = stamp-policy stamp-packaging stamp-build stamp-configure
31 DIRS_TO_CLEAN   = debian/tmp policy.html fhs debian/tmp-packaging \
32                   packaging.html menu-policy.html proposal.html
33 SGML_FILES      = policy packaging menu-policy proposal
34
35 # Location of the source dir
36 SRCTOP    := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi;)
37 TMPTOP    := $(SRCTOP)/debian/tmp
38 DOCDIR    := $(TMPTOP)/usr/doc/$(package)
39 LIBDIR    := $(TMPTOP)/usr/share/doc-base
40
41 PTMPTOP   := $(SRCTOP)/debian/tmp-packaging
42 PDOCDIR   := $(PTMPTOP)/usr/doc/$(package)
43 PLIBDIR   := $(PTMPTOP)/usr/share/doc-base
44
45 FHS_ARCHIVE  =$(shell ls -1 fhs*.tar.gz)
46 FHS_FILES    =fhs/fhs.dvi fhs/fhs.ps fhs/fhs.txt
47 FSSTND_FILES =FSSTND-FAQ fsstnd-1.2.dvi.gz fsstnd-1.2.ps.gz fsstnd-1.2.txt.gz
48 POLICY_FILES =policy.text.gz policy.sgml virtual-package-names-list.text \
49               upgrading-checklist.text libc6-migration.text \
50               version.ent proposal.sgml proposal.text.gz \
51               menu-policy.sgml menu-policy.text.gz
52 BYHAND_FILES =policy.text.gz libc6-migration.text \
53               virtual-package-names-list.text menu-policy.text.gz
54 PBYHAND_FILES=packaging.text.gz
55
56 install_file   = /usr/bin/install -p    -o root -g root  -m  644
57 install_program= /usr/bin/install -p    -o root -g root  -m  755
58 make_directory = /usr/bin/install -p -d -o root -g root  -m  755
59
60
61 all build: stamp-build
62 stamp-build:
63         $(checkdir)
64         -test -f stamp-configure || $(MAKE) -f debian/rules configure
65         for file in $(SGML_FILES); do \
66           nsgmls -gues $$file.sgml; \
67           debiandoc2html $$file.sgml; \
68           debiandoc2text $$file.sgml; \
69           if [ -f $$file.txt ]; then mv $$file.txt $$file.text; fi; \
70           gzip -9f $$file.text; \
71         done
72         tar zfx $(FHS_ARCHIVE)
73         lynx -dump upgrading-checklist.html > upgrading-checklist.text
74         touch stamp-build
75
76 configure: stamp-configure
77 stamp-configure:
78         rm -f version.ent
79         echo "<!entity version \"$(version)\">" >> version.ent
80         echo "<!entity date    \"$(date)\">"        >> version.ent
81         touch stamp-configure
82
83 clean:
84 # Undoes the effect of `make -f debian/rules build'.
85         $(checkdir)
86         rm -f  $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
87         rm -rf $(DIRS_TO_CLEAN)
88         rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o \
89           -name '*~' -o -name '*.bak' -o -name '#*#' -o \
90           -name '.*.orig' -o -name '.*.rej' -o -name '.SUMS' -o \
91           -size 0 \) -print` TAGS
92
93
94 binary:         binary-indep binary-arch
95 binary-arch:    build
96         $(checkdir)
97 # There are no architecture-dependent files to be uploaded
98 # generated by this package.  If there were any they would be
99 # made here.
100
101 binary-indep:   stamp-policy stamp-packaging
102 stamp-policy:  build
103         @test root = "`whoami`" || (echo need root priviledges; exit 1)
104         $(checkdir)
105         test -f stamp-build     || $(MAKE) -f        debian/rules build
106         -rm -rf                 $(TMPTOP)
107         $(make_directory)       $(TMPTOP)/DEBIAN
108         $(make_directory)       $(DOCDIR)/fsstnd
109         $(make_directory)       $(DOCDIR)/fhs
110         $(make_directory)       $(LIBDIR)
111         # create a substvar to reference from debian/control so that
112         # we don't hardcode the policy compliance of the policy
113         # package.  I guess some might question this but I take it as
114         # a given that the debian-policy pkg must always comply with
115         # itself...
116         echo "debian-policy:Version=$(version)"      > debian/substvars
117         $(install_file)     $(POLICY_FILES)          $(DOCDIR)/
118         $(install_file)     $(FSSTND_FILES)          $(DOCDIR)/fsstnd/
119         $(install_file)     $(FHS_FILES)             $(DOCDIR)/fhs/
120         $(install_file)     debian/changelog         $(DOCDIR)/
121         -gzip -fqr9         $(DOCDIR)
122         $(install_file)     debian/copyright         $(DOCDIR)/
123         $(install_file)     debian-policy.desc       $(LIBDIR)/debian-policy
124         (tar cf -           policy.html) |           (cd $(DOCDIR);   tar xf -)
125         (tar cf -           menu-policy.html) |      (cd $(DOCDIR);   tar xf -)
126         (tar cf -           proposal.html) |         (cd $(DOCDIR);   tar xf -)
127         $(install_program)  debian/{postinst,prerm}  debian/tmp/DEBIAN/
128         dpkg-gencontrol     -pdebian-policy -Pdebian/tmp -isp
129         chown               -R root.root debian/tmp
130         chmod               -R go=rX debian/tmp
131         dpkg                --build debian/tmp ..
132         debiandoc2latexps   -O policy.sgml | gzip -9v >  ../policy.ps.gz
133         debiandoc2latexpdf  -O policy.sgml | gzip -9v >  ../policy.pdf.gz
134         GZIP=-9v tar zcf    ../policy.html.tar.gz    policy.html
135         dpkg-distaddfile    -fdebian/files           policy.ps.gz       byhand -
136         dpkg-distaddfile    -fdebian/files           policy.pdf.gz      byhand -
137         dpkg-distaddfile    -fdebian/files           policy.html.tar.gz byhand -
138         for i in            $(BYHAND_FILES); do \
139           $(install_file)   $$i            ..                ; \
140           dpkg-distaddfile  -fdebian/files $$i       byhand - ; \
141         done
142         touch              stamp-policy
143
144 stamp-packaging:  build
145         @test root = "`whoami`" || (echo need root priviledges; exit 1)
146         $(checkdir)
147         test -f stamp-build     || $(MAKE) -f        debian/rules build
148         -rm -rf                 $(PTMPTOP)
149         $(make_directory)       $(PTMPTOP)/DEBIAN
150         $(make_directory)       $(PDOCDIR)
151         $(make_directory)       $(PLIBDIR)
152         echo "packaging-manual:Version=$(version)"           > debian/substvars
153
154         $(install_file)    packaging.sgml            $(PDOCDIR)/
155         $(install_file)    version.ent               $(PDOCDIR)/
156         $(install_file)    debian/changelog          $(PDOCDIR)/
157         -gzip -fqr9        $(DOCDIR)
158         $(install_file)    packaging.text.gz         $(PDOCDIR)/
159         $(install_file)    debian/copyright          $(PDOCDIR)/
160         $(install_file)    packaging-manual.desc     $(PLIBDIR)/packaging-manual
161         (tar cf -          packaging.html) |         (cd $(PDOCDIR);   tar xf -)
162         $(install_program) debian/{postinst,prerm}   debian/tmp-packaging/DEBIAN/
163         dpkg-gencontrol    -ppackaging-manual -Pdebian/tmp-packaging -isp
164         chown              -R root.root debian/tmp-packaging
165         chmod              -R go=rX debian/tmp-packaging
166         dpkg               --build debian/tmp-packaging ..
167         debiandoc2latexps  -O packaging.sgml | gzip -9f > ../packaging.ps.gz
168         debiandoc2latexpdf -O packaging.sgml | gzip -9f > ../packaging.pdf.gz
169         GZIP=-9v tar zcf   ../packaging.html.tar.gz    packaging.html
170         dpkg-distaddfile   -fdebian/files          packaging.ps.gz       byhand -
171         dpkg-distaddfile   -fdebian/files          packaging.pdf.gz      byhand -
172         dpkg-distaddfile   -fdebian/files          packaging.html.tar.gz byhand -
173         for i in            $(PBYHAND_FILES); do \
174           $(install_file)   $$i            ..                ; \
175           dpkg-distaddfile  -fdebian/files $$i       byhand - ; \
176         done
177         touch              stamp-
178
179
180 define checkdir
181         test -f debian/rules -a -f policy.sgml
182 endef
183
184 source diff:
185         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
186
187 .PHONY: binary binary-arch binary-indep clean checkroot
188
189 #Local variables:
190 #mode: makefile
191 #End: