Skip to content
Snippets Groups Projects
Commit 77156bfa authored by Yaroslav Halchenko's avatar Yaroslav Halchenko
Browse files

RF: use pandas rules approach to shuffle things into -lib etc

parent 235f256c
Branches
Tags
No related merge requests found
usr/lib/python2*/dist-packages/sklearn/*.so
usr/lib/python2*/dist-packages/sklearn/*/*.so
usr/lib/python2*/dist-packages/sklearn/*/*/*.so
usr/lib/python2*/dist-packages/sklearn/*/*/*/*.so
usr/lib/python2*/
usr/lib/python3/dist-packages/sklearn/*.so
usr/lib/python3/dist-packages/sklearn/*/*.so
usr/lib/python3/dist-packages/sklearn/*/*/*.so
usr/lib/python3/dist-packages/sklearn/*/*/*/*.so
usr/lib/python3/
......@@ -22,10 +22,14 @@ RECONF = $(shell dpkg --compare-versions $(CYTHON_VER) ge 0.20.1 && echo ",autor
NOSEARGS :=
# --exclude='test_(sparse_svc_clone_with_callable_kernel|spectral_clustering_sparse|ovr_fit_predict)'
# try to prevent unsunctioned downloads
export http_proxy=http://127.0.0.1:9/
export https_proxy=http://127.0.0.1:9/
# Mega rule
%:
: # Explicit build system to avoid use of all-in-1 Makefile
dh $@ --buildsystem=python_distutils --with python2$(RECONF)
dh $@ --buildsystem=python_distutils --with python2,python3$(RECONF)
cythonize:
@echo "D: removing previously generated by Cython sources"
......@@ -42,13 +46,13 @@ override_dh_clean:
override_dh_auto_install: ${PYVERS:%=python-install%} ${PY3VERS:%=python-install%} ${PYVERS:%=python-test%} ${PY3VERS:%=python-test%}
# Per Python version logic -- install, test, move .so into -lib
python-install%:
python$* setup.py install --install-layout=deb --root=$(PACKAGE$*_ROOT_DIR)
python$* setup.py install --install-layout=deb --root=$(CURDIR)/debian/tmp
python-test%: python-install%
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
: # Run unittests here against installed scikits.learn
echo "$*" | grep -q '^3' && PY=3 || PY=$*; \
export PYTHONPATH=`/bin/ls -d $$PWD/$(PACKAGE$*_ROOT_DIR)/usr/lib/python$$PY/*/`; \
export PYTHONPATH=`/bin/ls -d $$PWD/debian/tmp/usr/lib/python$$PY/*/`; \
export MPLCONFIGDIR=$(CURDIR)/build HOME=$(CURDIR)/build; \
export JOBLIB_MULTIPROCESSING=0; \
cd build/; python$* /usr/bin/nosetests -s -v $(NOSEARGS) sklearn && \
......@@ -64,7 +68,7 @@ ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
ifneq (,$(findstring -a,$(DH_INTERNAL_OPTIONS)))
: # not building documentation in -a
else
export PYTHONPATH=`/bin/ls -d $$PWD/$(PACKAGE2_ROOT_DIR)/usr/lib/python$(PYVER)/*`; \
export PYTHONPATH=`/bin/ls -d $$PWD/debian/tmp/usr/lib/python$(PYVER)/*`; \
export MPLCONFIGDIR=$(CURDIR)/build HOME=$(CURDIR)/build; \
cd doc; $(MAKE) html
endif
......@@ -80,17 +84,12 @@ endif
override_dh_installchangelogs:
dh_installchangelogs doc/whats_new.rst
## move binary libraries into -lib
override_dh_python*:
: # Move platform-specific libraries into -lib
set -e; \
for lib in $$(find $(PACKAGE$*_ROOT_DIR)/usr -name '*.so'); do \
sdir=$$(dirname $$lib) ; \
tdir=$(PACKAGE$*_ROOT_DIR)-lib/$${sdir#*$(PACKAGE$*_NAME)/} ; \
mkdir -p $$tdir ; \
echo "Moving '$$lib' into '$$tdir'." ; \
mv $$lib $$tdir ; \
done
## remove .so libraries from main package, and call dh_numpy*
## while removing 2 if not present
_dh_python%:
if [ -d debian/python*-sklearn/usr/lib ]; then \
find debian/python*-sklearn/usr/lib -name "*.so" -delete; \
fi
[ -e /usr/bin/dh_numpy$(*:2=) ] && dh_numpy$(*:2=) -p$(PACKAGE$*_NAME)-lib || :
: # Prune scikits/__init__.py to avoid conflicts
find debian -wholename \*scikits/__init__.py -delete
......@@ -106,6 +105,10 @@ override_dh_python*:
fi
dh_python$*
## "Instantiate" both rules so dh sees them
override_dh_python2: _dh_python2
override_dh_python3: _dh_python3
## immediately useable documentation and exemplar scripts/data
override_dh_compress:
dh_compress -X.py -X.html -X.pdf -X.css -X.jpg -X.txt -X.js -X.json -X.rtc -Xobjects.inv
......@@ -117,6 +120,6 @@ dfsg-%:
git checkout dfsg
-git merge --no-commit $*
-git rm -rf sklearn/externals/joblib
# -git rm -f ./sklearn/svm/src/libsvm/svm.*
: # -git rm -f ./sklearn/svm/src/libsvm/svm.*
git commit -m "Merge $* into DFSG (pruning externals: joblib)" -a
git checkout debian
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment