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
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=3
PWD := $(shell pwd)
# The versions of python currently supported
PYVERS = 2.1 2.2 2.3 2.4
PY_INTERPRETER = /usr/bin/python
build: build-stamp
build-stamp: $(PYVERS:%=build-python%)
touch $@
build-python%:
cd reportlab && python$* setup.py build
# renderPM tries ...
#LIBART_VERSION := $(shell dpkg -s libart-2.0-dev | sed -n '/^Version/s/.* \([0-9.]*\).*/\1/p')
#LIBART_DIR := $(shell pkg-config --cflags-only-I libart-2.0| sed 's/-I//g')
#LIBART_LIB := $(shell pkg-config --libs-only-l libart-2.0| sed 's/-l//g')
#build-render:
# cd renderPM && \
# LIBART_DIR=$(LIBART_DIR) \
# LIBART_LIB=$(LIBART_LIB) \
# LIBART_VERSION=$(LIBART_VERSION) \
# python2.3 setup.py build
# needs installed python-imaging (and renderPM ???)
gendocs:
cd reportlab/docs \
&& PYTHONPATH=$(PWD) python genAll.py
clean:
dh_testdir
dh_testroot
rm -f *-stamp
rm -rf reportlab/compile reportlab/build
find -name '*.py[co]' -exec rm -f {} \;
rm -rf *.log *.pdf # test runs ...
dh_clean
install: build-stamp install-prereq $(PYVERS:%=install-python%)
install-prereq: build-stamp
dh_testdir
dh_testroot
dh_clean -k
install-python%: install-prereq
cd reportlab \
&& python$* setup.py install --root $(PWD)/debian/python$*-reportlab
find debian/python$*-reportlab -name '*.py[co]' -exec rm -f {} \;
install -d debian/python-reportlab-doc/usr/share/doc/python-reportlab
: # remove test, docs and demo files
rm -rf debian/python$*-reportlab/usr/lib/python$*/site-packages/reportlab/demos
rm -rf debian/python$*-reportlab/usr/lib/python$*/site-packages/reportlab/docs
rm -rf debian/python$*-reportlab/usr/lib/python$*/site-packages/reportlab/test
rm debian/python$*-reportlab/usr/lib/python$*/site-packages/reportlab/README
rm debian/python$*-reportlab/usr/lib/python$*/site-packages/reportlab/changes
-find debian -name '*.so' | xargs rm -f
: # Replace all '#!' calls to python with $(PY_INTERPRETER)$*
: # and make them executable
for i in `find debian/python$*-reportlab -type f`; do \
sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)$*\1,' \
$$i > $$i.temp; \
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
mv -f $$i.temp $$i; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
fi; \
done
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
dh_testdir -i
dh_testroot -i
# dh_installdebconf -i
dh_installdocs -i reportlab/README
dh_installdocs -ppython-reportlab-doc reportlab/docs/*.pdf
dh_installexamples -ppython-reportlab-doc reportlab/demos/*
rm -rf debian/python-reportlab-doc/usr/share/doc/python-reportlab-doc/examples/tests
cp -p debian/testdemos.py debian/python-reportlab-doc/usr/share/doc/python-reportlab-doc/examples/.
: # Replace all '#!' calls to python with $(PY_INTERPRETER)
: # and make them executable
for i in `find debian/python-reportlab-doc -mindepth 3 -type f`; do \
sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)\1,' \
$$i > $$i.temp; \
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
mv -f $$i.temp $$i; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
fi; \
done
dh_installmenu -i
# dh_installman -i
dh_installinfo -i
# dh_undocumented -i
dh_installchangelogs -i reportlab/changes
dh_link -i
dh_compress -i -X.py -X.pdf -X.odyssey.txt
dh_fixperms -i
dh_python -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
|