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