]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/rules
debiandoc.txt now creates a .txt file, instead of a .text file.
[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 Apr 27 11:55:25 1999
9 ## Last Machine Used: glaurung.green-gryphon.com
10 ## Update Count     : 35
11 ## Status           : Unknown, Use with caution!
12 ## HISTORY          :
13 ## Description      :
14 ##
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
23 FILES_TO_CLEAN  = debian/files debian/buildinfo  debian/substvars \
24                   version.ent  policy.lout policy.lout.ld lout.li \
25                   upgrading-checklist.text policy.text.gz
26 STAMPS_TO_CLEAN = stamp-binary stamp-build stamp-configure
27 DIRS_TO_CLEAN   = debian/tmp policy.html
28
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
34
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 version.ent
38 BYHAND_FILES   =policy.text.gz libc6-migration.text\
39                 virtual-package-names-list.text
40
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
44
45
46 all build: stamp-build
47 stamp-build:
48         $(checkdir)
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         if [ -f policy.txt ]; then mv policy.txt policy.text; fi
54         lynx -dump upgrading-checklist.html > upgrading-checklist.text
55         gzip -9f policy.text
56         touch stamp-build
57
58 configure: stamp-configure
59 stamp-configure:
60         rm -f version.ent
61         echo "<!entity version \"$(version)\">" >> version.ent
62         echo "<!entity date    \"$(date)\">"        >> version.ent
63         touch stamp-configure
64
65 clean:
66 # Undoes the effect of `make -f debian/rules build'.
67         $(checkdir)
68         rm -f  $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
69         rm -rf $(DIRS_TO_CLEAN)
70         rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o \
71           -name '*~' -o -name '*.bak' -o -name '#*#' -o \
72           -name '.*.orig' -o -name '.*.rej' -o -name '.SUMS' -o \
73           -size 0 \) -print` TAGS
74
75
76 binary:         binary-indep binary-arch
77 binary-arch:    build
78         $(checkdir)
79 # There are no architecture-dependent files to be uploaded
80 # generated by this package.  If there were any they would be
81 # made here.
82
83 binary-indep:   stamp-binary
84 stamp-binary:  build
85         @test root = "`whoami`" || (echo need root priviledges; exit 1)
86         $(checkdir)
87         test -f stamp-build     || $(MAKE) -f        debian/rules build
88         -rm -rf                 $(TMPTOP)
89         $(make_directory)       $(TMPTOP)/DEBIAN
90         $(make_directory)       $(DOCDIR)/fsstnd
91         $(make_directory)       $(LIBDIR)
92         # create a substvar to reference from debian/control so that
93         # we don't hardcode the policy compliance of the policy
94         # package.  I guess some might question this but I take it as
95         # a given that the debian-policy pkg must always comply with
96         # itself...
97         echo "debian-policy:Version=$(version)"      > debian/substvars
98         $(install_file)     $(POLICY_FILES)          $(DOCDIR)/
99         $(install_file)     $(FSSTND_FILES)          $(DOCDIR)/fsstnd/
100         $(install_file)     debian/changelog         $(DOCDIR)/
101         -gzip -fqr9         $(DOCDIR)
102         $(install_file)     debian/copyright         $(DOCDIR)/
103         $(install_file)     debian-policy.desc       $(LIBDIR)/debian-policy
104         (tar cf -           policy.html) |           (cd $(DOCDIR);   tar xf -)
105         $(install_program)  debian/{postinst,prerm}  debian/tmp/DEBIAN/
106         dpkg-gencontrol     -isp
107         chown               -R root.root debian/tmp
108         chmod               -R go=rX debian/tmp
109         dpkg                --build debian/tmp ..
110         debiandoc2ps        -pa4 -1 -O policy.sgml | gzip -9v >  ../policy.ps.gz
111         GZIP=-9v tar zcf    ../policy.html.tar.gz    policy.html
112         dpkg-distaddfile    -fdebian/files           policy.ps.gz       byhand -
113         dpkg-distaddfile    -fdebian/files           policy.html.tar.gz byhand -
114         for i in            $(BYHAND_FILES); do \
115           $(install_file)   $$i            ..                ; \
116           dpkg-distaddfile  -fdebian/files $$i       byhand - ; \
117         done
118         touch              stamp-binary
119
120 define checkdir
121         test -f debian/rules -a -f policy.sgml
122 endef
123
124 source diff:
125         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
126
127 .PHONY: binary binary-arch binary-indep clean checkroot
128
129 #Local variables:
130 #mode: makefile
131 #End: