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
|
#!/usr/bin/make -f
# Commodity variables
DOC_INSTDIR=$(CURDIR)/debian/python-pygraphviz/usr/share/doc
# Needed before including python-distutils.mk
DEB_PYTHON_SYSTEM = pysupport
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk
# Some variables
DEB_PYTHON_MODULE_PACKAGE = pygraphviz
DEB_PYTHON_CLEAN_ARGS = --all
DEB_PYTHON_INSTALL_ARGS_ALL = --no-compile --force
# Install egg-info directories, using setup_egg.py instead of setup.py
DEB_PYTHON_SETUP_CMD = setup_egg.py
DEB_PYTHON_INSTALL_ARGS_ALL += --single-version-externally-managed \
--prefix=/usr
install/python-pygraphviz::
# Fix test.py permissions (not an upstream problem):
for i in `pyversions -s`; do \
chmod +x debian/python-pygraphviz/usr/lib/$$i/site-packages/pygraphviz/tests/test.py; \
done
binary-install/python-pygraphviz::
# Move the documentation
mv $(DOC_INSTDIR)/pygraphviz-$(DEB_UPSTREAM_VERSION)/* \
$(DOC_INSTDIR)/python-pygraphviz
rmdir $(DOC_INSTDIR)/pygraphviz-$(DEB_UPSTREAM_VERSION)
# Remove extraneous license file, and rename the README file
rm $(DOC_INSTDIR)/python-pygraphviz/INSTALL.txt
mv -f $(DOC_INSTDIR)/python-pygraphviz/README.txt \
$(DOC_INSTDIR)/python-pygraphviz/README
# Fix example permissions, until upstream fixes it
chmod a+x $(DOC_INSTDIR)/python-pygraphviz/examples/*.py
# BUILD_ARGS should contain --build-base but it's:
# - neither supported by the setup.py script
# - nor needed
DEB_PYTHON_BUILD_ARGS =
# CDBS doesn't allow separate build steps for module and extension, let's hack it:
# - copied the following target from the python-distutils.mk (CDBS Makefile)
# - deleted arch=all test since we _do_ have an extension => arch=any
python-build-stamp-%::
cd $(DEB_SRCDIR) && python$* $(DEB_PYTHON_SETUP_CMD) build_ext $(DEB_PYTHON_BUILD_ARGS) $(DEB_PYTHON_BUILD_EXTENSION_ARGS)
cd $(DEB_SRCDIR) && python$* $(DEB_PYTHON_SETUP_CMD) build_py $(DEB_PYTHON_BUILD_ARGS)
touch $@
clean::
# Shipped in the source tarball, generated again during the build
rm -rf pygraphviz.egg-info
|