File: rules

package info (click to toggle)
docbook-simple 1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 508 kB
  • ctags: 7
  • sloc: xml: 172; makefile: 127; sh: 111
file content (133 lines) | stat: -rwxr-xr-x 4,239 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/make -f
# rules for docbook-simple

#export DH_VERBOSE=1

PACKAGE := docbook-simple

include /usr/share/dpatch/dpatch.make


debian/docbook-simple.install:
	set -ex ; \
	touch $@ ; \
	for dbs in docbook-simple-* ; do \
		dbsver=`echo $${dbs} | sed -e 's/docbook-simple-//g'` ; \
		echo "$${dbs}/catalog.xml	usr/share/xml/docbook/custom/simple/$${dbsver}" >> $@ ; \
		echo "$${dbs}/*.mod	usr/share/xml/docbook/custom/simple/$${dbsver}" >> $@ ; \
		echo "$${dbs}/sdocbook.dtd	usr/share/xml/docbook/custom/simple/$${dbsver}" >> $@ ; \
		echo "$${dbs}/sdocbookref.dtd	usr/share/xml/docbook/custom/simple/$${dbsver}" >> $@ ; \
		echo "$${dbs}/*.css	usr/share/xml/docbook/custom/simple/$${dbsver}/css" >> $@ ; \
		echo "$${dbs}/sdocbook*-custom.dtd	etc/sgml/docbook-simple/$${dbsver}" >> $@ ; \
		echo >> $@ ; \
	done

debian/docbook-simple.links:
	set -ex ; \
	touch $@ ; \
	cat $@.in >> $@ ; \
	for dbs in docbook-simple-*/sdocbook-custom.dtd docbook-simple-*/sdocbookref-custom.dtd ; do \
		dbsdtd=`echo $${dbs} | sed -e 's/docbook-simple-//g'` ; \
		echo -n "etc/sgml/docbook-simple/$${dbsdtd} " >> $@ && \
		    echo "usr/share/xml/docbook/custom/simple/$${dbsdtd}" >> $@ ; \
	done

debian/docbook-simple.sgmlcatalogs:
	set -ex ; \
	touch $@ ; \
	for dbs in docbook-simple-* ; do \
		dbsver=`echo $${dbs} | sed -e 's/docbook-simple-//g'` ; \
		echo "$${dbs}/catalog	/usr/share/xml/docbook/custom/simple/$${dbsver}/catalog" >> $@ ; \
	done

debian/docbook-simple.xmlcatalogs:
	set -ex ; \
	touch $@ ; \
	cat $@.in >> $@ ; \
	for dbscat in docbook-simple-*/catalog.xml ; do \
		dbsver=`echo $${dbscat} | sed -e 's/docbook-simple-//g' -e 's/\/catalog.xml//g'` ; \
		echo "local;$${dbscat};/usr/share/xml/docbook/custom/simple/$${dbsver}/catalog.xml" >> $@ ; \
		sysids=`egrep -e "<system systemId=\"[^\"]+\"" $${dbscat} | \
		    sed -e 's/<system systemId=\"\(.*\)\"/\1;/g'` IFS=';' ; \
		echo $${sysids} | while read id ; do \
			echo "package;system;$${id};/usr/share/xml/docbook/custom/simple/$${dbsver}/catalog.xml" >> $@ ; \
		done ; \
		pubids=`egrep -e "<public publicId=\"[^\"]+\"" $${dbscat} | \
		    sed -e 's/<public publicId=\"\(.*\)\"/\1;/g'` IFS=';' ; \
		echo $${pubids} | while read id ; do \
			echo "package;public;$${id};/usr/share/xml/docbook/custom/simple/$${dbsver}/catalog.xml" >> $@ ; \
		done ; \
		echo >> $@ ; \
	done ; \
	sed -i -e 's/\ ;\/usr/;\/usr/g' $@

build: patch-stamp build-stamp

build-stamp: debian/docbook-simple.install \
             debian/docbook-simple.links \
             debian/docbook-simple.sgmlcatalogs \
             debian/docbook-simple.xmlcatalogs
	dh_testdir
	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp patch-stamp
	rm -f debian/docbook-simple.install \
	      debian/docbook-simple.links \
	      debian/docbook-simple.sgmlcatalogs \
	      debian/docbook-simple.xmlcatalogs
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k

# Build architecture-independent files here.
binary-arch: build install
# We have nothing to do.

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdirs
	dh_install
	dh_installdocs
	dh_installexamples
	dh_installchangelogs 
	dh_link 
	dh_installcatalogs
	dh_installxmlcatalogs
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

# This following code is used to create the .orig.tar.gz tarball.
# Use it to prepare it for a new release.

version=$(shell dpkg-parsechangelog | sed -n -e 's/^Version: \(.*\)-[^-]*/\1/p')

.PHONY: get-orig-source
get-orig-source:
	set -ex ; \
	TMPDIR=`mktemp -d docbook-simple-$(version).orig` ; \
	for dbs in 1.0 1.1 ; do \
		mkdir -p "$$TMPDIR"/docbook-simple-$${dbs} ; \
		dbszip=docbook-simple-$${dbs}.zip ; \
		wget -P "$$TMPDIR" http://www.oasis-open.org/docbook/xml/simple/$${dbs}/"$$dbszip" ; \
		unzip -d "$$TMPDIR"/docbook-simple-$${dbs} "$$TMPDIR"/"$$dbszip" ; \
		rm -f "$$TMPDIR"/"$$dbszip" ; \
	done; \
	find "$$TMPDIR" -type f ! -perm 644 -exec chmod 644 "{}" ";" ; \
	GZIP=-9 tar -czf $(CURDIR)/docbook-simple_${version}.orig.tar.gz "$$TMPDIR" ; \
	rm -rf "$$TMPDIR"