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
|
#! /usr/bin/make -f
export DH_VERBOSE = 1
export PYBUILD_NAME=pymzml
export PYBUILD_SYSTEM=distutils
TMPDIR="debian/tmp"
DOCDIR="debian/doc"
SRCDIR=$(CURDIR)
PYTHON_VERSION="$(shell python3 --version | sed 's/.*\(3\.[^\.\d]*\).*$/\1/g')"; \
echo $(PYTHON_VERSION)
python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python3 --version 2>&1)))
python_version_major := $(word 1,${python_version_full})
python_version_minor := $(word 2,${python_version_full})
VERSION_OF_PYTHON := ${python_version_major}.${python_version_minor}
%:
dh $@ --buildsystem=pybuild --with sphinxdoc
override_dh_compress:
dh_compress -X.py -X.idx -X.mzml -X.mzML \
-Xexample_scripts \
-Xtests
override_dh_clean:
dh_clean
rm -rfv debian/source/include-binaries
rm -rfv $(DOCDIR)
override_dh_install:
dh_install
# Remove the symbolic link.
rm -vf debian/python3-pymzml/usr/share/doc/python3-pymzml/example_scripts/pymzml
#
# Remove all the pyc files.
rm -vf debian/python3-pymzml/usr/share/doc/python3-pymzml/example_scripts/*.pyc
#
# Remove the license file
rm -vf debian/python3-pymzml/usr/share/doc/python3-pymzml/COPYING.txt
rm -vf debian/python3-pymzml-doc/usr/share/doc/python-pymzml-doc/COPYING.txt
#
# Make sure we list properly all the binary files that are made during
# the documentation build in debian/source/include-binaries:
sh debian/list-binary-files.sh
#
# Remove the exec bit from all the *.gz files.
chmod a-x debian/python3-pymzml/usr/lib/python3.*/dist-packages/pymzml/obo/*.gz
# Same for version.txt
chmod a-x debian/python3-pymzml/usr/lib/python3.*/dist-packages/pymzml/version.txt
#
# Move the test.dat.igzip file erroneously installed to dist-packages/.
mv debian/python3-pymzml/usr/lib/python$(VERSION_OF_PYTHON)/dist-packages/test.dat.igzip debian/python3-pymzml/usr/lib/python$(VERSION_OF_PYTHON)/dist-packages/pymzml
prepare_docs:
rm -rfv docs-for-build
cp -rpfv docs docs-for-build
# No more pdf_doc because that is too painful.
html_doc: prepare_docs
cd docs-for-build && make html
override_dh_auto_build-indep: html_doc
cd $(SRCDIR) && \
mkdir -p $(DOCDIR) && \
rm -rfv $(DOCDIR)/* && \
cp -rpfv docs-for-build/build/html $(DOCDIR) && \
rm -rfv docs-for-build
RUN_TESTS_COMMAND = PYTHONPATH=$(SRCDIR) pybuild --test --test-pytest -i python{version} -p 3.12
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
RUN_TESTS = $(RUN_TESTS_COMMAND)
else
RUN_TESTS = echo "Not running the tests"
endif
override_dh_auto_test:
$(RUN_TESTS)
|