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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
|
PY3VERS := $(shell py3versions -vs)
VER3 := $(shell /usr/bin/python3 -c 'import sys; print(sys.version[:3])')
include /usr/share/python3/python.mk
setup_options = --no-download-t1-files
build-arch: build
build-indep: build
build: build-stamp
build-stamp: $(PY3VERS:%=build3-python%) $(PY3VERS:%=dbg-build3-python%)
touch $@
build3-python%:
python$* setup.py build $(setup_options)
touch $@
dbg-build3-python%:
python$*-dbg setup.py build $(setup_options)
touch $@
build-doc-stamp:
set -x; \
cd docs \
&& PYTHONPATH=$(wildcard $(CURDIR)/build/lib.*-*-$(VER3)) python3 genAll.py
PYTHONPATH=$(wildcard $(CURDIR)/build/lib.*-*-$(VER3)) $(MAKE) -C docs html PAPER=a4
touch $@
clean:
dh_testdir
dh_testroot
rm -f *-stamp build3-python* dbg-build3-python*
rm -rf compile build debian/tmp-dbg
find -name '*.py[co]' -exec rm -f {} \;
rm -rf *.log *.pdf
rm -rf docs/build docs/*.pdf
dh_clean
install: build-stamp install-prereq \
$(PY3VERS:%=install3-python%) $(PY3VERS:%=install3-dbg-python%)
install-prereq: build-stamp
dh_testdir
dh_testroot
dh_prep
install3-python%: install-prereq
python$* setup.py install \
$(setup_options) \
--root $(CURDIR)/debian/python3-reportlab \
--install-layout=deb
find debian/python3-reportlab -name '*.ttf' | xargs -r rm -f
find debian/python3-reportlab -name '*.py[co]' | xargs -r rm -f
find debian/python3-reportlab -name '__pycache__' | xargs -r rm -rf
mkdir -p debian/python3-renderpm/$(call py_libdir,$*)/reportlab/graphics
abitag=.$$(python$* -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"); \
mv debian/python3-reportlab/$(call py_libdir,$*)/reportlab/graphics/_renderPM$$abitag*.so \
debian/python3-renderpm/$(call py_libdir,$*)/reportlab/graphics/
mkdir -p debian/python3-reportlab-accel/$(call py_libdir,$*)/reportlab/lib
abitag=.$$(python$* -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"); \
mv debian/python3-reportlab/$(call py_libdir,$*)/reportlab/lib/*$$abitag*.so \
debian/python3-reportlab-accel/$(call py_libdir,$*)/reportlab/lib/
:
rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/demos
rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/tools/pythonpoint/demos
rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/docs
rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/test
rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/fonts
rm -f debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/README.txt
rm -f debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/CHANGES.txt
:
:
for i in `find debian/python3-reportlab -type f`; do \
sed '1s,
$$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
install3-dbg-python%: install-prereq
python$*-dbg setup.py install \
$(setup_options) \
--root $(CURDIR)/debian/python3-reportlab-accel-dbg \
--install-layout=deb
find debian/python3-reportlab-accel-dbg ! -type d ! -name '*3?d*-*.so' | xargs rm -f
find debian/python3-reportlab -name '__pycache__' | xargs -r rm -rf
find debian/python3-reportlab-accel-dbg -depth -empty -exec rmdir {} \;
mkdir -p debian/python3-renderpm-dbg/$(call py_libdir,$*)/reportlab/graphics
abitag=.$$(python$*-dbg -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"); \
mv debian/python3-reportlab-accel-dbg/$(call py_libdir,$*)/reportlab/graphics/_renderPM$$abitag*.so \
debian/python3-renderpm-dbg/$(call py_libdir,$*)/reportlab/graphics
binary-indep: build build-doc-stamp install
dh_testdir
dh_testroot
dh_installdocs -i README.txt
dh_installdocs -ppython-reportlab-doc -X.buildinfo docs/*.pdf docs/build/html
dh_sphinxdoc -i
dh_installexamples -ppython-reportlab-doc 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/.
cp -rp tools/pythonpoint/demos debian/python-reportlab-doc/usr/share/doc/python-reportlab-doc/pythonpoint-demos
:
:
for i in `find debian/python-reportlab-doc -mindepth 3 -type f`; do \
sed '1s,
$$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_installchangelogs -i
dh_link -i
dh_compress -i -X.py -X.pdf -X.js -Xodyssey.txt -X.xml
dh_fixperms -i
dh_python3 -ppython3-reportlab
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs -a
dh_installchangelogs -a
rm -rf debian/python3-renderpm-dbg/usr/share/doc/python3-renderpm-dbg
ln -s python3-renderpm debian/python3-renderpm-dbg/usr/share/doc/python3-renderpm-dbg
rm -rf debian/python3-reportlab-accel-dbg/usr/share/doc/python3-reportlab-accel-dbg
ln -s python3-reportlab-accel debian/python3-reportlab-accel-dbg/usr/share/doc/python3-reportlab-accel-dbg
dh_compress -a -X.py -X.pdf -Xodyssey.txt -X.xml
dh_fixperms -a
dh_python3 \
-ppython3-renderpm -ppython3-reportlab-accel \
-ppython3-renderpm-dbg -ppython3-reportlab-accel-dbg
dh_strip -ppython3-renderpm --dbg-package=python3-renderpm-dbg
dh_strip -ppython3-reportlab-accel --dbg-package=python3-reportlab-accel-dbg
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
|