]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/rules
typo
[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 : Wed Jun 30 23:05:51 1999
9 ## Last Machine Used: glaurung.green-gryphon.com
10 ## Update Count     : 51
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/$(ppackage)
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         echo "packaging-manual:Version=$(version)"   >> debian/substvars
118         $(install_file)     $(POLICY_FILES)          $(DOCDIR)/
119         $(install_file)     $(FSSTND_FILES)          $(DOCDIR)/fsstnd/
120         $(install_file)     $(FHS_FILES)             $(DOCDIR)/fhs/
121         $(install_file)     debian/changelog         $(DOCDIR)/
122         -gzip -fqr9         $(DOCDIR)
123         $(install_file)     debian/copyright         $(DOCDIR)/
124         $(install_file)     debian-policy.desc       $(LIBDIR)/debian-policy
125         (tar cf -           policy.html) |           (cd $(DOCDIR);   tar xf -)
126         (tar cf -           menu-policy.html) |      (cd $(DOCDIR);   tar xf -)
127         (tar cf -           proposal.html) |         (cd $(DOCDIR);   tar xf -)
128         $(install_program)  debian/{postinst,prerm}  debian/tmp/DEBIAN/
129         dpkg-gencontrol     -pdebian-policy -Pdebian/tmp -isp
130         chown               -R root.root debian/tmp
131         chmod               -R go=rX debian/tmp
132         dpkg                --build debian/tmp ..
133         debiandoc2latexps   -O policy.sgml | gzip -9v >  ../policy.ps.gz
134         debiandoc2latexpdf  -O policy.sgml | gzip -9v >  ../policy.pdf.gz
135         GZIP=-9v tar zcf    ../policy.html.tar.gz    policy.html
136         dpkg-distaddfile    -fdebian/files           policy.ps.gz       byhand -
137         dpkg-distaddfile    -fdebian/files           policy.pdf.gz      byhand -
138         dpkg-distaddfile    -fdebian/files           policy.html.tar.gz byhand -
139         for i in            $(BYHAND_FILES); do \
140           $(install_file)   $$i            ..                ; \
141           dpkg-distaddfile  -fdebian/files $$i       byhand - ; \
142         done
143         touch              stamp-policy
144
145 stamp-packaging:  build
146         @test root = "`whoami`" || (echo need root priviledges; exit 1)
147         $(checkdir)
148         test -f stamp-build     || $(MAKE) -f        debian/rules build
149         -rm -rf                 $(PTMPTOP)
150         $(make_directory)       $(PTMPTOP)/DEBIAN
151         $(make_directory)       $(PDOCDIR)
152         $(make_directory)       $(PLIBDIR)
153         echo "debian-policy:Version=$(version)"      > debian/substvars
154         echo "packaging-manual:Version=$(version)"   >> debian/substvars
155
156         $(install_file)    packaging.sgml            $(PDOCDIR)/
157         $(install_file)    version.ent               $(PDOCDIR)/
158         $(install_file)    debian/changelog          $(PDOCDIR)/
159         -gzip -fqr9        $(PDOCDIR)
160         $(install_file)    packaging.text.gz         $(PDOCDIR)/
161         $(install_file)    debian/copyright          $(PDOCDIR)/
162         $(install_file)    packaging-manual.desc     $(PLIBDIR)/packaging-manual
163         (tar cf -          packaging.html) |         (cd $(PDOCDIR);   tar xf -)
164         $(install_program) debian/{postinst,prerm}   debian/tmp-packaging/DEBIAN/
165         dpkg-gencontrol    -ppackaging-manual -Pdebian/tmp-packaging -isp
166         chown              -R root.root debian/tmp-packaging
167         chmod              -R go=rX debian/tmp-packaging
168         dpkg               --build debian/tmp-packaging ..
169         debiandoc2latexps  -O packaging.sgml | gzip -9f > ../packaging.ps.gz
170         debiandoc2latexpdf -O packaging.sgml | gzip -9f > ../packaging.pdf.gz
171         GZIP=-9v tar zcf   ../packaging.html.tar.gz    packaging.html
172         dpkg-distaddfile   -fdebian/files        packaging.ps.gz       byhand -
173         dpkg-distaddfile   -fdebian/files        packaging.pdf.gz      byhand -
174         dpkg-distaddfile   -fdebian/files        packaging.html.tar.gz byhand -
175         for i in            $(PBYHAND_FILES); do \
176           $(install_file)   $$i            ..                ; \
177           dpkg-distaddfile  -fdebian/files $$i       byhand - ; \
178         done
179         touch              stamp-
180
181
182 define checkdir
183         test -f debian/rules -a -f policy.sgml
184 endef
185
186 source diff:
187         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
188
189 .PHONY: binary binary-arch binary-indep clean checkroot
190
191 #Local variables:
192 #mode: makefile
193 #End: