~ubuntu-branches/ubuntu/vivid/sgml-data/vivid-proposed

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
#!/usr/bin/make -f
# uncomment to enable verbose mode for debhelper
#DH_VERBOSE = 1
# uncomment to exclude VCS paths
DH_ALWAYS_EXCLUDE=CVS:.svn:.git

%:
	dh $@

#######################################################################
# Some bytes in this file may have been touched by Ian Jackson,
# so I can never remove his name from this file.  Oh boy.
# But modernized for easier maint.

#######################################################################
# directory abstraction
prefix		:= debian/sgml-data
sgmldir		:= $(prefix)/usr/share/sgml
xmldir		:= $(prefix)/usr/share/xml

#######################################################################
override_dh_auto_configure:
	# -c check without execution, -w warn
	perl -cw sgml-catalog-check.pl

#######################################################################
override_dh_install:
	dh_install -X/catalog
	# skip */catalog and */catalog.xml files 
	# but do not skip sgml-catalog-check.pl

#######################################################################
override_dh_installcatalogs:
	# assert if destination free
	if [ -f $(sgmldir)/dtd/rdf.dtd ]; then exit; fi
	dh_installcatalogs
	# assert if destination free
	if [ -f $(xmldir)/declaration/xml.dcl ]; then exit; fi
	dh_installxmlcatalogs

#######################################################################
override_dh_link:
	dh_link
#	 create all the nice links as specified in SGML FS Guidelines
#	 (No more CVS/ in subdirectory)
	set -e; cd sgml; for file in `find . -name catalog -o -name '*.soc'`; do	\
	    echo "checking sgml/$$file"							;\
	    ../sgml-catalog-check.pl -v 0 -d ../$(sgmldir) $$file		;\
	done
#	 UNSURE: do the same for XML stuff? (original comment before Osamu)

#######################################################################
override_dh_lintian:
	dh_lintian
#	 check for bad links but do not stop
	for LINK in $$(find $(prefix) -type l); do \
		TARGET=$$(readlink $$LINK); \
		[ "$$TARGET" != "$${TARGET#/etc}" ] || [ -e $$LINK ] \
		|| echo "dangling symlink: $$LINK -> $$TARGET"; \
	done