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
|
#! /usr/bin/make -f
PYVERS := $(shell pyversions -vr debian/control)
p := python-xmms
pd := python-xmms-doc
dd := debian/$(pd)
MANPAGE_SOURCE := debian/pyxmms.sgml
MANPAGE := pyxmms.3
WGET := wget
# README.Debian for "slave" packages, i.e. packages that don't hold their
# own documentation (which is located in $(pd)).
DEBIAN_SLAVE_README := debian/README.Debian
# According to Debian Policy 3.7.2
PY_BUILD_FLAGS += --debug
build: build-arch build-indep
build-arch: build-arch-stamp
build-arch-stamp:
set -e; \
for v in $(PYVERS); do \
python$$v ./setup.py build $(PY_BUILD_FLAGS); \
done
touch $@
build-indep: build-indep-stamp
# Dependencies:
# - on build24-stamp because we need the .so files to generate the
# documentation (pydoc imports the modules, and we are using Python 2.4
# in order to run pydoc)
# - on $(MANPAGE_SOURCE) because the manual page belongs to the debian
# package (not provided upstream) and therefore might be modified by the
# debian maintainer between successive builds of the package (well, the
# dependency is not needed if he calls the clean target between those
# builds)... not really necessary, but not harmful.
build-indep-stamp: build-arch $(MANPAGE_SOURCE)
dh_testdir build-documentation.py src/_xmmscontrolmodule.c \
debian/pyxmms.sgml
rm -f build-indep-stamp
# The docs are best formatted IMHO with Python >= 2.3.
python ./build-documentation.py
docbook-to-man "$(MANPAGE_SOURCE)" >"$(MANPAGE)"
touch build-indep-stamp
clean:
dh_testdir src/_xmmscontrolmodule.c
dh_testroot
-rm -f *-stamp
rm -rf build MANIFEST "$(MANPAGE)"
for module in common control config; do \
rm -f doc/xmms.$${module}.html; \
done
dh_clean
binary-indep: build-indep
dh_testdir doc/xmms.control.html debian/pyxmms.sgml
dh_testroot
dh_clean -k
# It is important to have python-xmms before python-xmms-doc in the control
# file because I don't want the README.Debian in python-xmms-doc but
# dh_installdocs automatically installs it in the first binary package listed
# in the control file...
dh_installdocs -p$(pd) README
dh_installdocs -p$(p) "$(DEBIAN_SLAVE_README)" NEWS
dh_installdirs -p$(pd) usr/share/doc/python-xmms-doc/html
dh_install -p$(pd) doc/* usr/share/doc/python-xmms-doc/html
dh_installman -p$(pd) "$(MANPAGE)"
dh_installchangelogs -i ChangeLog
dh_compress -i -X.py
dh_pycentral -i
dh_python -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build-arch
dh_testdir src/_xmmscontrolmodule.c
dh_testroot
dh_clean -k
# We want no precompiled files in the .deb files. We will generate them in
# postinst.
for v in $(PYVERS); do \
python$$v ./setup.py install --prefix="$$PWD/debian/$(p)/usr" --no-compile; \
done
dh_strip -a
dh_installdocs -A -a $(DEBIAN_SLAVE_README) NEWS
dh_installchangelogs -a ChangeLog
dh_compress -a -X.py
dh_pycentral -a
dh_python -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
# FIXME: mktemp(1) says:
# Debian packages using mktemp in maintainer scripts must depend on
# debianutils >= 1.7.
# but is it really necessary when it is only used in get-orig-source?
# And, agreed, it is not essential here...
get-orig-source:
TMPFILE="`mktemp -t PyXMMS.XXXXXXXXXX`" && \
$(WGET) -O "$$TMPFILE" \
http://www.via.ecp.fr/~flo/2002/PyXMMS/dist/latest && \
LATEST_UPSTREAM_VERSION=`tar tzf "$$TMPFILE" | head -1 \
| sed 's/.*-\([0-9]*\.[0-9]*\)\//\1/'` && \
mv "$$TMPFILE" pyxmms_$${LATEST_UPSTREAM_VERSION}.orig.tar.gz
.PHONY: clean build build-arch build-indep binary binary-arch binary-indep \
get-orig-source
|