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
|
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules for package 'dblatex' that uses debhelper.
# The underlying template was originally written by Joey Hess and Craig Small.
# As a special exception, when the template is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Some targets (e.g. get-orig-source) are not required to be started from the
# package's top level directory.
# Nevertheless they need to know the package's version.
# The version gets determined at runtime by dpkg-parsechangelog using the
# package's changefile.
# The changefile is located in this file's directory.
# Thus this file's directory needs to be determined, which will only work
# reliably when the make variable MAKEFILE_LIST contains exactly one value.
ifneq ($(words $(MAKEFILE_LIST)),1)
$(error Unable to determine location of rules.)
endif
debiandir := $(realpath $(dir $(strip $(MAKEFILE_LIST))))
prefix := $(debiandir)/dblatex
BIN_DIR := $(prefix)/usr/bin
SHARE_DIR := $(prefix)/usr/share/dblatex
TEX_DIR := $(prefix)/usr/share/texmf/tex/latex/dblatex
XSL_DIR := $(prefix)/usr/share/xml/docbook/stylesheet/dblatex
PKG_VERS := $(shell dpkg-parsechangelog -l$(debiandir)/changelog \
| grep ^Version: | cut -d' ' -f2 | cut -d- -f1)
PKG_BZ2 := dblatex-$(PKG_VERS).tar.bz2
PKG_GZ := dblatex_$(PKG_VERS).orig.tar.gz
# Include other makefiles only after debiandir determination
# to avoid breaking the latter.
include /usr/share/dpatch/dpatch.make
build: build-stamp
build-stamp: patch-stamp
dh_testdir
# As the upstream manual page is not necessarily compressed with
# maximum compression, let compression be done by dh_installman.
gunzip --to-stdout docs/manpage/dblatex.1.gz > dblatex.1
touch build-stamp
clean: unpatch
dh_testdir
dh_testroot
rm --force build-stamp
rm --force dblatex.1
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
mkdir --parents $(BIN_DIR)
install --preserve-timestamps --mode=755 dblatex $(BIN_DIR)
mkdir --parents $(TEX_DIR)
cp --archive latex/contrib latex/misc latex/style $(TEX_DIR)
rm $(TEX_DIR)/misc/passivetex/LICENSE
mkdir --parents $(XSL_DIR)
cp --archive xsl $(XSL_DIR)
mkdir --parents $(SHARE_DIR)/lib
cp --archive lib/dbtexmf $(SHARE_DIR)/lib
mkdir --parents $(SHARE_DIR)/latex
cp --archive latex/graphics latex/scripts latex/specs \
$(SHARE_DIR)/latex
ln --symbolic ../../texmf/tex/latex/dblatex/contrib \
$(SHARE_DIR)/latex/contrib
ln --symbolic ../xml/docbook/stylesheet/dblatex/xsl $(SHARE_DIR)/xsl
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs docs/manual.pdf debian/README.Debian-source
dh_installman dblatex.1
dh_pysupport
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.
binary: binary-indep binary-arch
get-orig-source:
wget http://prdownloads.sourceforge.net/dblatex/$(PKG_BZ2)?download
bzip2 --decompress --stdout $(PKG_BZ2) \
| gzip --best --no-name > $(PKG_GZ)
rm --force $(PKG_BZ2)
.PHONY: build clean patch unpatch install binary-indep binary-arch binary get-orig-source
|