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
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DOC=usr/share/doc
PYVERS := $(shell pyversions -vs)
PYVER := $(shell python -c 'import sys; print sys.version[:3]')
CURDIR := $(shell pwd)
patch: patch-stamp
patch-stamp:
dpatch apply-all
build: patch build-stamp
build-stamp: $(PYVERS:%=build-python%)
build-python%:
python$* setup.py build
touch $@
clean:
dh_testdir
dh_testroot
rm -rf *-stamp build build-python*
-find . -name "*.pyc" |xargs -r rm
dh_clean
install: build install-prereq $(PYVERS:%=install-python%)
install-prereq:
dh_testdir
dh_testroot
dh_clean -k
install-python%:
dh_installdirs -ppython-codespeak-lib \
usr/share/doc/python-codespeak-lib \
usr/bin
/usr/bin/python$* setup.py install --root debian/python-codespeak-lib
# for f in debian/python$*-codespeak-lib/usr/bin/py.*; do \
# b=`basename $$f`; \
# t=debian/python$*-codespeak-lib/usr/bin/$${b}.python$*; \
# sed "1s|.*|#!/usr/bin/python$*|" $$f > $$t; \
# chmod 755 $$t; \
# rm $$f; \
# done
rm -rf debian/python-codespeak-lib/usr/bin/_findpy.py
rm -rf debian/python-codespeak-lib/usr/bin/_makepyrelease.py
rm -rf debian/python-codespeak-lib/usr/bin/*.cmd
chmod 644 debian/python-codespeak-lib/usr/lib/python$*/site-packages/py/execnet/script/shell.py
-find debian/python-codespeak-lib -name '*.png' -o -name '*.gif' | xargs chmod 644
rm -rf debian/python-codespeak-lib/usr/lib/python$*/site-packages/py/test/testing/data/syntax_error.py
rm -rf debian/python-codespeak-lib/usr/lib/python$*/site-packages/py/bin
-find . -name "*.py[co]" |xargs rm
: # Replace all '#!' calls to python with /usr/bin/python
: # and make them executable
for i in `find debian/python-codespeak-lib -type f`; do \
sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\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
rm -rf debian/python-codespeak-lib/usr/share/doc/python-codespeak-lib/*
mv debian/python-codespeak-lib/usr/lib/python$*/site-packages/py/documentation/* \
debian/python-codespeak-lib/usr/share/doc/python-codespeak-lib/
rmdir debian/python-codespeak-lib/usr/lib/python$*/site-packages/py/documentation
dh_link -ppython-codespeak-lib \
/usr/share/doc/python-codespeak-lib \
/usr/lib/python$*/site-packages/py/documentation
rm -rf debian/python-codespeak-lib/usr/lib/python$*/site-packages/py/LICENSE
# Build architecture independant packages using the common target.
binary-indep: build install
# Build architecture dependant packages using the common target.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs -a
dh_installdocs -a
dh_installexamples -a
dh_strip -a
dh_compress -a -X.py
dh_fixperms -a
dh_pycentral -a
dh_python -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install
|