File: rules

package info (click to toggle)
docbook 4.5-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 4,488 kB
  • ctags: 5
  • sloc: xml: 254; makefile: 93
file content (92 lines) | stat: -rwxr-xr-x 2,991 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

PACKAGE	:= docbook

%:
	dh $@ --parallel

override_dh_clean:
	dh_clean debian/docbook.install \
	         debian/docbook.links \
	         debian/docbook.sgmlcatalogs

override_dh_install: debian/docbook.install
	dh_install

debian/docbook.install:
	set -ex ; \
	touch $@ ; \
	for db in docbook-* ; do \
		dbver=`echo $${db} | sed -e 's/docbook-//g'` ; \
		for file in $${db}/*.dcl $${db}/*.dtd $${db}/*.mod ; do \
			if [ $${file} != $${db}/dbgenent.mod ] ; then \
				echo "$${file} usr/share/sgml/docbook/dtd/$${dbver}" >> $@ ; \
			else \
				echo "$${file} etc/sgml/docbook/$${dbver}" >> $@ ; \
			fi ; \
		done ; \
	done

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

debian/docbook.links:
	set -ex ; \
	touch $@ ; \
	for db in docbook-* ; do \
		dbver=`echo $${db} | sed -e 's/docbook-//g'` ; \
		[ -f $${db}/dbgenent.mod ] && \
		    echo -n "etc/sgml/docbook/$${dbver}/dbgenent.mod " >> $@ && \
		        echo "usr/share/sgml/docbook/dtd/$${dbver}/dbgenent.mod" >> $@ ; \
		[ -f $${db}/docbook.cat ] && \
		    echo "usr/share/sgml/docbook/dtd/$${dbver}/catalog usr/share/sgml/docbook/dtd/$${dbver}/docbook.cat" >> $@ ; \
	done

override_dh_installcatalogs: debian/docbook.sgmlcatalogs
	dh_installcatalogs

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

override_dh_installchangelogs::
	dh_installchangelogs ChangeLog.upstream

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

.PHONY: get-orig-source
get-orig-source:
	set -ex ; \
	TMPDIR=`mktemp -d docbook-$(version).orig` ; \
	touch "$$TMPDIR"/ChangeLog.upstream ; \
	for db in 4.5 4.4 4.3 4.2 ; do \
		mkdir -p "$$TMPDIR"/docbook-$${db} ; \
		dbzip=docbook-$${db}.zip ; \
		wget -P "$$TMPDIR" http://www.oasis-open.org/docbook/sgml/$${db}/"$$dbzip" ; \
		unzip -d "$$TMPDIR"/docbook-$${db} "$$TMPDIR"/"$$dbzip" ; \
		rm -f "$$TMPDIR"/"$$dbzip" ; \
		[ -f "$$TMPDIR"/docbook-$${db}/ChangeLog ] && \
		    cat "$$TMPDIR"/docbook-$${db}/ChangeLog >> "$$TMPDIR"/ChangeLog.upstream ; \
	done; \
	for db in 4.1 4.0 3.1 3.0 2.4.1 ; do \
		mkdir -p "$$TMPDIR"/docbook-$${db} ; \
		dbver=`echo $${db} | sed -e 's/\.//g'` ; \
		dbzip=docbk"$$dbver".zip ; \
		wget -P "$$TMPDIR" http://www.oasis-open.org/docbook/sgml/$${db}/"$$dbzip" ; \
		unzip -d "$$TMPDIR"/docbook-$${db} "$$TMPDIR"/"$$dbzip" ; \
		rm -f "$$TMPDIR"/"$$dbzip" ; \
		cat "$$TMPDIR"/docbook-$${db}/"$$dbver"chg.txt >> "$$TMPDIR"/ChangeLog.upstream ; \
	done ; \
	find "$$TMPDIR" -type f ! -perm 644 -exec chmod 644 "{}" ";" ; \
	GZIP=-9 tar -czf $(CURDIR)/docbook_${version}.orig.tar.gz "$$TMPDIR" ; \
	rm -rf "$$TMPDIR"