debian swirl logo

Back to the packages list mlpy

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

include /usr/share/cdbs/1/rules/debhelper.mk
DEB_PYTHON_SYSTEM = pysupport
# for earlier cdbs versions
DEB_PYTHON_MODULE_PACKAGE = python-mlpy
# for cdbs >= 0.4.54
DEB_PYTHON_MODULE_PACKAGES = python-mlpy python-mlpy-lib
include /usr/share/cdbs/1/class/python-distutils.mk

BUILD_SCRIPTS_DIR= build/scripts-$(cdbs_python_current_version)
BUILD_PYTHONPATH= $(CURDIR)/$(shell ls -d build/lib.*-*-$(cdbs_python_current_version))
MLPY_VERSION = $(shell awk -F\' '/version *=/{print $$2;}' setup.py)

doc: doc-stamp
doc-stamp: build/python-mlpy
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	PYTHONPATH= $(BUILD_PYTHONPATH) $(MAKE) -C docs html latex
	PYTHONPATH= $(BUILD_PYTHONPATH) $(MAKE) -C docs/build/latex all-pdf
		touch $@
endif

# Build basic manpages
man: man-stamp
man-stamp: build/python-mlpy
		-rm -f $(BUILD_SCRIPTS_DIR)/*.1
		mkdir -p build/man
		for f in $(BUILD_SCRIPTS_DIR)/*; do \
		fn= $${f##*/}; \
		PYTHONPATH= $(BUILD_PYTHONPATH) help2man -N -S mlpy -s 1 \
			  -n "Command line interface to $${fn} in mlpy (version $(MLPY_VERSION))" \
			  --version-string=$(MLPY_VERSION) $$f >| build/man/$${fn}.1;\
    done
		touch $@

clean::
		-rm -rf build docs/build doc-stamp man-stamp

build/python-mlpy:: man
build/python-mlpy-doc:: doc

# use jquery from Debian package
# symlinked by debhelper
install/python-mlpy-doc::
		-rm docs/build/html/_static/jquery.js

install/python-mlpy-lib::
	# move libraries into the python-mlpy-lib package
		for lib in $$(find debian/python-mlpy/usr -name '*.so'); do \
	   sdir= $$(dirname $$lib) ; \
	   tdir= debian/python-mlpy-lib/$${sdir#*python-mlpy/} ; \
		   mkdir -p $$tdir ; \
		   echo "Moving '$$lib' into '$$tdir'." ; \
		   mv $$lib $$tdir ; \
		done

# we need to move libraries away first, hence dependence on -lib
# Also without this step, movemodules from pysupport would not
# move arch-indep part of the module under pyshared
install/python-mlpy:: install/python-mlpy-lib

# install directly into package directory (despite multiple packages)
DEB_DESTDIR = $(CURDIR)/debian/python-mlpy
# immediately useable documentation
# and exemplar data (they are small excerpts anyways)
DEB_COMPRESS_EXCLUDE := .py .pdf .html .css .jpg .txt .js .json .rtc .par .bin
# Man pages
DEB_INSTALL_MANPAGES_python-mlpy := build/man/*.1
# -doc package contents
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
DEB_INSTALL_DOCS_python-mlpy-doc := docs/build/html docs/build/latex/mlpy.pdf
endif

Builds:

python-mlpy-doc
documention and examples for mlpy
python-mlpy
high-performance python package for predictive modeling
python-mlpy-lib
low-level implementations and bindings for mlpy