7 # set the dpkg-architecture vars; but we don't use them, so we'll comment out
8 export DEB_BUILD_ARCH ?= $(shell dpkg-architecture $(ha) -qDEB_BUILD_ARCH)
9 export DEB_BUILD_GNU_CPU ?= $(shell dpkg-architecture $(ha) -qDEB_BUILD_GNU_CPU)
10 export DEB_BUILD_GNU_SYSTEM?= $(shell dpkg-architecture $(ha) -qDEB_BUILD_GNU_SYSTEM)
11 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture $(ha) -qDEB_BUILD_GNU_TYPE)
12 export DEB_HOST_ARCH ?= $(shell dpkg-architecture $(ha) -qDEB_HOST_ARCH)
13 export DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture $(ha) -qDEB_HOST_GNU_CPU)
14 export DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture $(ha) -qDEB_HOST_GNU_SYSTEM)
15 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture $(ha) -qDEB_HOST_GNU_TYPE)
17 arch := $(shell dpkg --print-architecture)
20 package := $(shell grep Source debian/control | sed 's/^Source: //')
21 date := $(shell date +"%Y-%m-%d")
22 version := $(shell awk -F '[()]' '/^$(package)/{ print $$2; exit }' debian/changelog)
24 # Currently, emacs23 is required (xemacs is not sufficient).
27 # Location of the source dir
29 TMPTOP := $(SRCTOP)/debian/tmp
30 DOCDIR := $(TMPTOP)/usr/share/doc/$(package)
31 LIBDIR := $(TMPTOP)/usr/share/doc-base
33 sanitycheck := debian/rules policy.sgml
35 SGML_FILES := policy menu-policy mime-policy perl-policy upgrading-checklist
36 DESC_FILES := copyright-format debian-policy debian-menu-policy debian-perl-policy \
37 debian-mime-policy debconf-spec fhs
39 # While we have two versions of the FHS installed in the source package,
40 # we need to modify this to handle it. This is the easiest way to do it.
41 # FHS_ARCHIVE := $(wildcard fhs*.tar.gz)
42 FHS_ARCHIVE := fhs-2.3-source.tar.gz
43 FHS_HTML := fhs-2.3.html
44 FHS_FILES := fhs-2.3.ps.gz fhs-2.3.txt.gz fhs-2.3.pdf.gz
49 POLICY_FILES = $(SGML_FILES:=.sgml) $(SGML_FILES:=.txt.gz) \
50 virtual-package-names-list.txt \
51 libc6-migration.txt version.ent \
52 copyright-format/copyright-format.html \
53 copyright-format/copyright-format.txt.gz \
54 debconf_spec/debconf_specification.html \
55 debconf_spec/debconf_specification.txt.gz \
56 policy.ps.gz policy.pdf.gz README.txt README.html \
57 Process.txt Process.html
59 FILES_FROM_ORG := Process.html Process.txt README.txt README.html
61 # policy.{pdf,ps,tpt,txt} are generated files
62 FILES_TO_CLEAN = copyright-format.xml.tar.gz \
63 debian/files debian/buildinfo debian/substvars \
64 debian/postinst debian/prerm \
66 $(SGML_FILES:=.txt.gz) $(SGML_FILES:=.html.tar.gz) \
67 $(SGML_FILES:=-1.html) \
68 policy.pdf.gz policy.ps.gz \
69 debconf_specification.xml.tar.gz \
70 policy.pdf policy.ps policy.txt policy. \
71 body.tmp head.tmp policy.tpt \
74 STAMPS_TO_CLEAN := stamp-policy stamp-build
75 DIRS_TO_CLEAN := debian/tmp fhs $(SGML_FILES:=.html)
78 install_file := install -p -o root -g root -m 644
79 install_program := install -p -o root -g root -m 755
80 make_directory := install -p -d -o root -g root -m 755
83 all build build-indep: stamp-build
85 stamp-build: version.ent $(sanitycheck)
86 $(MAKE) $(SGML_FILES:=.sgml.validate) \
87 $(SGML_FILES:=.html.tar.gz) \
88 $(SGML_FILES:=-1.html) \
89 $(SGML_FILES:=.txt.gz) \
90 policy.ps.gz policy.pdf.gz
91 $(MAKE) $(FILES_FROM_ORG)
92 $(MAKE) -C copyright-format all
93 $(MAKE) -C debconf_spec all
96 configure: version.ent
97 version.ent: debian/changelog
99 echo "<!entity version \"$(version)\">" >> $@
100 echo "<!entity date \"$(date)\">" >> $@
102 clean: $(sanitycheck)
103 # Undoes the effect of `make -f debian/rules build'.
104 $(MAKE) -C copyright-format clean
105 $(MAKE) -C debconf_spec clean
106 rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
107 rm -rf $(DIRS_TO_CLEAN)
108 rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o \
109 -name '*~' -o -name '*.bak' -o -name '#*#' -o \
110 -name '.*.orig' -o -name '.*.rej' -o -name '.SUMS' -o \
111 -size 0 \) -print` TAGS
114 binary: binary-indep binary-arch
115 binary-arch: build $(sanitycheck)
116 # There are no architecture-dependent files to be uploaded
117 # generated by this package. If there were any they would be
120 binary-indep: stamp-policy
121 stamp-policy: build $(sanitycheck)
122 @test $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
123 (echo need root priviledges; exit 1)
124 # This is unnecessary; commenting out
125 # test -f stamp-build || $(MAKE) -f debian/rules build
127 $(make_directory) $(TMPTOP)/DEBIAN
128 $(make_directory) $(DOCDIR)/fhs
129 $(make_directory) $(LIBDIR)
130 # create a substvar to reference from debian/control so that
131 # we don't hardcode the policy compliance of the policy
132 # package. I guess some might question this but I take it as
133 # a given that the debian-policy pkg must always comply with
135 echo "debian-policy:Version=$(version)" > debian/substvars
136 $(install_file) $(POLICY_FILES) $(DOCDIR)/
137 $(install_file) debian/changelog $(DOCDIR)/
138 # Be more specific with file compression
139 gzip -f9 $(DOCDIR)/*.txt $(DOCDIR)/*.sgml \
141 # These are allready compressed
142 #$(install_file) $(FHS_NEW_FILES) $(DOCDIR)/fhs/
143 $(install_file) $(FHS_FILES) $(DOCDIR)/fhs/
144 $(install_file) debian/copyright $(DOCDIR)/
145 GZIP=-9 cd copyright-format && \
146 tar -zcf ../copyright-format.xml.tar.gz *
147 $(install_file) copyright-format.xml.tar.gz $(DOCDIR)/
149 GZIP=-9 cd debconf_spec && \
150 tar -zcf ../debconf_specification.xml.tar.gz *
151 $(install_file) debconf_specification.xml.tar.gz $(DOCDIR)/
153 for file in $(DESC_FILES); do \
154 $(install_file) $$file.desc $(LIBDIR)/$$file; \
157 for file in $(SGML_FILES); do \
158 tar -C $(DOCDIR) -zxf $$file.html.tar.gz; \
160 for file in $(SGML_FILES); do \
161 $(install_file) $${file}-1.html $(DOCDIR); \
163 $(install_file) $(FHS_HTML) $(DOCDIR)/fhs
166 find . -path "./DEBIAN" -prune -o -type f -printf '%P\0' \
167 | xargs -r0 md5sum > DEBIAN/md5sums
168 dpkg-gencontrol -p$(package) -Pdebian/tmp -isp
169 chown -R root:root debian/tmp
170 chmod -R go=rX debian/tmp
171 dpkg --build debian/tmp ..
175 .PHONY: configure build build-arch build-indep binary binary-arch
176 .PHONY: binary-indep clean checkroot