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