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
|
#!/usr/bin/make -f
# -*- makefile -*-
#
# Invoke each target with `./debian/rules <target>'. All targets should be
# invoked with the package root as the current directory.
#
# The `binary' target must be run as root, as it needs to install files with
# specific ownerships.
package=fweb
# be paranoid...
export LC_ALL=C
# This has to be exported to make some magic below work.
export DH_OPTIONS
topdir = $(shell pwd)
tmpdir = ${topdir}/debian/$(package)
texdir = ${tmpdir}/usr/share/texmf/tex/latex/litprog
docdir = ${topdir}/debian/$(package)-doc/usr/share/doc/${package}
infodir = ${topdir}/debian/$(package)-doc/usr/share/info
mandir = ${tmpdir}/usr/share/man
htmldocdir= ${docdir}/html-info
INSTALLFLAGS =
CFLAGS = -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALLFLAGS += -s
endif
installdoc=install -m 644
installbin=install -m 755 ${INSTALLFLAGS}
build: build-stamp
build-stamp: configure-stamp
dh_testdir
${MAKE} -C Web CFLAGS="${CFLAGS}" \
tch_src both idxmerge ../Manual/fweb.info
cd Manual && makeinfo --html fweb.texi
touch build-stamp
configure-stamp:
dh_testdir
cd Web; ./configure --prefix=/usr
touch configure-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# The problem is that Makefile includes defaults.mk which is a
# ./configure generated file, but it does not exist when clean
# is being run.
touch Web/defaults.mk
$(MAKE) -C Web distclean
-rm -f Web/idxmerge Web/idxmerge.c Web/custom.h Web/config.h \
Manual/fweb.info* Manual/fweb*.html
rm -rf Manual/fweb/
rm -f Web/fweave.mds Web/fweave.ndx
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_prep
mkdir ${tmpdir}
cd ${tmpdir} && mkdir -p usr/bin usr/share/man/man1
mkdir -p $(infodir)
install -d ${texdir} ${htmldocdir}
# upstream binaries
${MAKE} -C Web CFLAGS=-O2 LDFLAGS=-s \
INSTALL_PROGRAM='install -c ${INSTALLFLAGS}' \
prefix=${tmpdir}/usr texdir=${texdir} \
infodir=$(infodir) \
mandir=${mandir}/man1 \
install
# documentation
${installdoc} Manual/fweb/* ${htmldocdir}/
${installdoc} Manual/fweb.texi ${docdir}/
${installdoc} debian/idxmerge.1 ${mandir}/man1/
ln -s fweb.1.gz ${mandir}/man1/fweave.1.gz
ln -s fweb.1.gz ${mandir}/man1/ftangle.1.gz
binary-indep: DH_OPTIONS=-i
binary-indep: install
dh_testdir
dh_testroot
dh_installdocs
dh_installexamples
dh_installinfo ${topdir}/Manual/fweb.info
dh_installtex
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
build-arch: build-stamp
build-indep: build-stamp
binary-arch: DH_OPTIONS=-a
binary-arch: install
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Below here is fairly generic really
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean
|