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