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 134 135 136 137 138 139 140 141 142 143 144 145 146
|
#!/usr/bin/make -f
#
# Rules makefile for linuxdoc-tools package
#
# Copyright (C) 2007-2016 Agustin Martin <agmartin@debian.org>
#
# Based on debhelper examples by Joey Hess and former Debian/rules
# by Taketoshi Sano and Sven Rudolph
# --------------------------------------------------------------
SHELL = /bin/bash
package = linuxdoc-tools
copyright = debian/$(package).copyright
DESTDIR = $(CURDIR)/debian/tmp
# -- For FHS transition
MANDIR = /usr/share/man
# Get default build flags for maximum hardening (Needs dpkg-dev >= 1.16.1.1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
# -- Create linuxdoc-tools copyright file by merging some files
define build_ldt_copyright
cat debian/copyright > $(copyright)
echo -e '\n------------------\n The linuxdoc-tools license\n' >> $(copyright)
cat COPYING >> $(copyright)
echo -e '\n------------------\n The sgmls license\n' >> $(copyright)
cat sgmls-1.1/LICENSE >> $(copyright)
# sp is no longer included.
# echo -e '\n------------------\n The sp license\n' >>\
# debian/$(package).copyright
# cat sp/COPYING >> debian/$(package).copyright
echo -e '\n------------------\n The iso-entities license\n' >> $(copyright)
cat iso-entities/COPYING >> $(copyright)
echo -e '\n------------------\n The entity-map license\n' >> $(copyright)
cat entity-map/COPYING >> $(copyright)
endef
# The next section may have to be extensively modified
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp:
dh_testdir
./configure --prefix=/usr \
--mandir=$(MANDIR) \
--with-installed-nsgmls \
--with-auxbindir=/usr/lib/linuxdoc-tools \
--with-perllibdir=/usr/share/perl5 \
--with-texdir=/usr/share/texmf/tex/latex/misc
$(MAKE) CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
$(build_ldt_copyright)
for i in text latex info; do \
ln -sf copyright.dependencies \
debian/$(package)-$$i.copyright; \
done
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
rm -f debian/$(package)-{text,latex,info}.copyright
rm -f debian/$(package).copyright
rm -f linuxdoc.new LinuxDocTools.pm.new doc/linuxdoc-sgml.info
[ ! -f Makefile ] || $(MAKE) distclean
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# --- do 'make install'
$(MAKE) DESTDIR=$(DESTDIR) install
# --- Install shell scripts for sgml2{txt,latex,info}
for i in txt latex info; do \
install -m 755 debian/addition/sgml2$$i \
$(DESTDIR)/usr/bin/sgml2$$i; \
done
# ---
cat debian/linuxdoc-tools.info-base doc/guide.info > doc/linuxdoc-sgml.info
dh_installinfo doc/linuxdoc-sgml.info
# ---
mkdir -p $(DESTDIR)/usr/share/sgml
( cd $(DESTDIR)/usr/share/linuxdoc-tools && mv dtd ../sgml )
binary-indep:
dh_testdir -i
dh_testroot -i
dh_installchangelogs -i
dh_installdocs -i
dh_installman -i
dh_link -i
dh_strip -i
dh_compress -i -X.pdf
dh_fixperms -i
dh_installdeb -i
dh_shlibdeps -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installchangelogs -a
# - Docs are installed by dh_installdocs
# - We use entities from sgml-data package
dh_install -a --sourcedir=$(DESTDIR) -Xusr/share/doc -Xusr/share/sgml/iso-entities-8879.1986 '*'
dh_installdocs -a -Xdoc/guide.info
dh_installman -a
dh_link -a usr/share/info/linuxdoc-sgml.info.gz \
usr/share/doc/linuxdoc-tools/linuxdoc-sgml.info.gz
dh_link -a usr/share/sgml/dtd usr/share/linuxdoc-tools/dtd
dh_installcatalogs -a
dh_perl -a
dh_strip -a
dh_compress -a -X.pdf
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
# Below here is fairly generic really
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean
|