File: rules

package info (click to toggle)
docbook-xml 4.5-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 4,880 kB
  • sloc: xml: 1,375; makefile: 132; sh: 24
file content (131 lines) | stat: -rwxr-xr-x 5,184 bytes parent folder | download
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
#!/usr/bin/make -f
# rules file for docbook-xml
#
# Some bytes in this file may have been touched by Ian Jackson,
# so I can never remove his name from this file.

PACKAGE := docbook-xml

%:
	dh $@ --with xml-core

debian/docbook-xml.install:
	set -ex ; \
	touch $@ ; \
	for dbx in docbook-* ; do \
		dbxver=`echo $${dbx} | sed -e 's/docbook-//g'` ; \
		for file in $${dbx}/*.dtd $${dbx}/*.ent $${dbx}/*.mod $${dbx}/*.ver ; do \
			if [ -f $${file} ] ; then \
				if [ $${file} != $${dbx}/dbgenent.* ] ; then \
					echo "$${file} usr/share/xml/docbook/schema/dtd/$${dbxver}" >> $@ ; \
				else \
					echo "$${file} etc/sgml/docbook-xml/$${dbxver}" >> $@ ; \
				fi ; \
			fi ; \
		done ; \
		[ -f $${dbx}/catalog.xml ] && \
		    echo "$${dbx}/catalog.xml usr/share/xml/docbook/schema/dtd/$${dbxver}" >> $@ ; \
	done

debian/docbook-xml.links:
	set -ex ; \
	touch $@ ; \
	cat $@.in >> $@ ; \
	for dbx in docbook-* ; do \
		dbxver=`echo $${dbx} | sed -e 's/docbook-//g'` ; \
		for file in $${dbx}/dbgenent.* ; do \
			dbfile=`echo $${file} | sed -e 's/[^\/]*\///g'` ; \
			echo -n "etc/sgml/docbook-xml/$${dbxver}/$${dbfile} " >> $@ && \
			    echo "usr/share/xml/docbook/schema/dtd/$${dbxver}/$${dbfile}" >> $@ ; \
		done ; \
		[ -f $${dbx}/docbook.cat ] && \
		    echo -n "usr/share/xml/docbook/schema/dtd/$${dbxver}/catalog " >> $@ && \
		        echo "usr/share/xml/docbook/schema/dtd/$${dbxver}/docbook.cat" >> $@ ; \
		[ -d $${dbx}/ent ] && \
		    echo -n "usr/share/xml/entities/xml-iso-entities-8879.1986 " >> $@ && \
		        echo "usr/share/xml/docbook/schema/dtd/$${dbxver}/ent" >> $@ ; \
		echo "usr/share/xml/docbook/schema/dtd/$${dbxver} usr/share/sgml/docbook/dtd/xml/$${dbxver}" >> $@ ; \
	done

debian/docbook-xml.sgmlcatalogs:
	set -ex ; \
	touch $@ ; \
	echo "catalog /usr/share/xml/docbook/schema/dtd/catalog" > $@ ; \
	for dbx in docbook-* ; do \
		dbxver=`echo $${dbx} | sed -e 's/docbook-//g'` ; \
		[ -f $${dbx}/docbook.cat ] && \
		    echo "$${dbx}/docbook.cat /usr/share/xml/docbook/schema/dtd/$${dbxver}/catalog" >> $@ ; \
	done

debian/docbook-xml.xmlcatalogs:
	set -ex ; \
	touch $@ ; \
	cat $@.in >> $@ ; \
	for dbx in docbook-* ; do \
		dbxver=`echo $${dbx} | sed -e 's/docbook-//g'` ; \
		if [ -f $${dbx}/catalog.xml ] ; then \
			echo "local;$${dbx}/catalog.xml;/usr/share/xml/docbook/schema/dtd/$${dbxver}/catalog.xml" >> $@ ; \
			sysids=`egrep -e "<system systemId=\"[^\"]+\"" $${dbx}/catalog.xml | \
			        sed -e 's/<system systemId=\"\(.*\)\"/\1;/g'` IFS=';' ; \
			echo $${sysids} | while read id ; do \
				echo "package;system;$${id};/usr/share/xml/docbook/schema/dtd/$${dbxver}/catalog.xml" >> $@ ; \
			done ; \
			pubids=`egrep -e "<public publicId=\"[^\"]+\"" $${dbx}/catalog.xml | \
			        sed -e 's/<public publicId=\"\(.*\)\"/\1;/g'` IFS=';' ; \
			echo $${pubids} | while read id ; do \
				echo "package;public;$${id};/usr/share/xml/docbook/schema/dtd/$${dbxver}/catalog.xml" >> $@ ; \
			done ; \
			echo >> $@ ; \
		fi ; \
	done ; \
	fpiregex="s/^.*\-\/\/OASIS\/\/DTD XML Exchange Table Model 19990315\/\/EN.*\/dtd\/4\.[^5].*//g" ; \
	sed -i -e 's/\ ;\/usr/;\/usr/g' -e $${fpiregex} $@


override_dh_auto_build: debian/docbook-xml.xmlcatalogs debian/docbook-xml.sgmlcatalogs debian/docbook-xml.install

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog.upstream

override_dh_link: debian/docbook-xml.links
	dh_link
	find $(CURDIR)/debian/$(PACKAGE) -type l -follow >/dev/null # exits 1 on broken links

version=$(shell dpkg-parsechangelog | sed -n -e 's/^Version: \(.*\)-[^-]*/\1/p')
get-orig-source:
	set -ex ; \
	TMPDIR=`mktemp -d docbook-xml-$(version).orig.XXXXXX` ; \
	touch "$$TMPDIR"/ChangeLog.upstream ; \
	for db in 4.5 4.4 4.3 4.2 ; do \
		dbxver=`echo $${db} | sed -e 's/\.//g'` ; \
		dbxzip=docbook-xml-$${db}.zip ; \
		mkdir -p "$$TMPDIR"/docbook-$${db} ; \
		wget -P "$$TMPDIR" http://www.oasis-open.org/docbook/xml/$${db}/"$$dbxzip" ; \
		unzip -d "$$TMPDIR"/docbook-$${db} "$$TMPDIR"/"$$dbxzip" ; \
		rm -f "$$TMPDIR"/"$$dbxzip" ; \
		([ -f "$$TMPDIR"/docbook-$${db}/ChangeLog ] && [ "$$dbxver" -ge 44 ] ) && \
		    cat "$$TMPDIR"/docbook-$${db}/ChangeLog >> "$$TMPDIR"/ChangeLog.upstream ; \
	done; \
	for db in 4.1.2 4.0 ; do \
		dbxver=`echo $${db} | sed -e 's/\.//g'` ; \
		dbxzip=docbkx"$$dbxver".zip ; \
		mkdir -p "$$TMPDIR"/docbook-$${db} ; \
		wget -P "$$TMPDIR" http://www.oasis-open.org/docbook/xml/$${db}/"$$dbxzip" ; \
		unzip -d "$$TMPDIR"/docbook-$${db} "$$TMPDIR"/"$$dbxzip" ; \
		rm -f "$$TMPDIR"/"$$dbxzip" ; \
		if [ $${db} = "4.1.2" ] ; then \
			cat "$$TMPDIR"/docbook-$${db}/ChangeLog >> "$$TMPDIR"/ChangeLog.upstream ; \
			cat "$$TMPDIR"/docbook-$${db}/41chg.txt >> "$$TMPDIR"/ChangeLog.upstream ; \
			cat "$$TMPDIR"/docbook-$${db}/40chg.txt >> "$$TMPDIR"/ChangeLog.upstream ; \
		else \
			cat "$$TMPDIR"/docbook-$${db}/"$$dbxver"chg.txt >> "$$TMPDIR"/ChangeLog.upstream ; \
		fi ; \
	done ; \
	find "$$TMPDIR" -type f ! -perm 644 -exec chmod 644 "{}" ";" ; \
	mv "$$TMPDIR" docbook-xml-$(version).orig ; \
	GZIP=-9 tar --remove-files -czf $(CURDIR)/docbook-xml_${version}.orig.tar.gz \
	    docbook-xml-$(version).orig

#Local variables:
#mode: makefile
#End: