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
|
#!/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.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
package := docbook-xml
# directory abstraction
prefix := debian/$(package)
sgmldir := $(prefix)/usr/share/xml
dtddir := $(sgmldir)/docbook/schema/dtd
legacydtddir := $(prefix)/usr/share/sgml/docbook/dtd/xml
docdir := $(prefix)/usr/share/doc/$(package)
confdir := $(prefix)/etc/sgml/$(package)
# tool abstraction
install_file := install -o root -g root -m 644 -p
install_script := install -o root -g root -m 755 -p
make_dir := install -d -o root -g root -m 755
compress := gzip -9f
# determine our version numbers
SRC_VERSION := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | sed 's/^Version: *//')
UPSTREAM_VERSION:= $(shell echo $(SRC_VERSION) | sed -e 's/^\(.*\)-[^-]*$$/\1/')
ifndef UPSTREAM_VERSION
FOO:=$(error cannot determine upstream version)
endif
# latest version of various DTDs
3_VERSION := 3.1.7
4_VERSION := $(UPSTREAM_VERSION)
41_VERSION := 4.1.2
build:
# nothing to be done
clean:
$(checkdir)
# be sure to remove specifically derived files
dh_clean debian/sgmlcatalogs debian/links
test:
$(checkdir)
# check that maintainer scripts are good
sh -n debian/preinst
sh -n debian/postinst
binary-indep: build test
$(checkdir)
$(checkroot)
dh_clean -k
$(make_dir) $(prefix)/DEBIAN $(dtddir) $(confdir)
# note that throughout we have to be careful to try to retain
# the expected system entity names (dir and file names) as
# shipped, in the hope to accomodate XML tools that don't
# understand SGML Open Catalogs
:> debian/sgmlcatalogs
:> debian/links
chmod a+x ./debian/install-dtds
./debian/install-dtds $(prefix) $(dtddir)
dh_installcatalogs -i
dh_link -i
dh_installxmlcatalogs -i
##
## make "supported versions" symlinks, comitting to keep this over time
##
ln -sf $(4_VERSION) $(dtddir)/4
ln -sf $(4_VERSION) $(legacydtddir)/4
ln -sf $(41_VERSION) $(dtddir)/4.1
ln -sf $(41_VERSION) $(legacydtddir)/4.1
ln -sf $(3_VERSION) $(dtddir)/3
ln -sf $(3_VERSION) $(legacydtddir)/3
ln -sf $(3_VERSION) $(dtddir)/3.1
ln -sf $(3_VERSION) $(legacydtddir)/3.1
# install examples
dh_installdocs -i
dh_installchangelogs -i $(UPSTREAM_VERSION)/ChangeLog
dh_installexamples -i debian/examples/*
dh_fixperms -i
# check for bad links
for LINK in $$(find $(prefix) -type l); do \
TARGET=$$(readlink $$LINK); \
[ "$$TARGET" != "$${TARGET#/etc}" ] || [ -e $$LINK ] \
|| echo "dangling symlink: $$LINK -> $$TARGET"; \
done
dh_compress -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build
# nothing to be done
define checkdir
test -f 4.1.2/docbookx.dtd
test -f debian/rules
endef
# Below here is fairly generic really
binary: binary-indep binary-arch
define checkroot
test `id -u` = 0
endef
.PHONY: binary binary-arch binary-indep clean test
#Local variables:
#mode: makefile
#End:
|