summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile62
1 files changed, 62 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f660604
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,62 @@
+#!/usr/bin/make -f
+INSTALL ?= install
+PREFIX ?= /usr/local
+MANPAGES ?= pybuild.1 pybuild-autopkgtest.1 dh_python3.1
+DVERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: (.+),\1,p' || echo 'DEVEL')
+VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p' || echo 'DEVEL')
+
+clean:
+ make -C tests clean
+ make -C pydist clean
+ find . -name '*.py[co]' -delete
+ find . -name __pycache__ -type d | xargs rm -rf
+ rm -f .coverage $(MANPAGES)
+ rm -rf .pybuild
+
+dist:
+ git archive --format=tar --prefix=dh-python-$(VERSION)/ HEAD \
+ | xz -9 -c >../dh-python_$(VERSION).orig.tar.xz
+
+install:
+ $(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/bin \
+ $(DESTDIR)$(PREFIX)/share/debhelper/autoscripts/ \
+ $(DESTDIR)$(PREFIX)/share/perl5/Debian/Debhelper/Sequence/ \
+ $(DESTDIR)$(PREFIX)/share/perl5/Debian/Debhelper/Buildsystem/ \
+ $(DESTDIR)$(PREFIX)/share/dh-python/dhpython/build \
+ $(DESTDIR)$(PREFIX)/share/dh-python/dist
+ $(INSTALL) -m 644 pydist/*_fallback $(DESTDIR)$(PREFIX)/share/dh-python/dist/
+ $(INSTALL) -m 644 dhpython/*.py $(DESTDIR)$(PREFIX)/share/dh-python/dhpython/
+ $(INSTALL) -m 644 dhpython/build/*.py $(DESTDIR)$(PREFIX)/share/dh-python/dhpython/build/
+ $(INSTALL) -m 755 pybuild $(DESTDIR)$(PREFIX)/share/dh-python/
+ $(INSTALL) -m 755 pybuild-autopkgtest $(DESTDIR)$(PREFIX)/share/dh-python/
+ $(INSTALL) -m 755 dh_python3 $(DESTDIR)$(PREFIX)/share/dh-python/
+ sed -i -e 's/DEVELV/$(DVERSION)/' $(DESTDIR)$(PREFIX)/share/dh-python/pybuild
+ sed -i -e 's/DEVELV/$(DVERSION)/' $(DESTDIR)$(PREFIX)/share/dh-python/dh_python3
+
+ $(INSTALL) -m 644 dh/pybuild.pm $(DESTDIR)$(PREFIX)/share/perl5/Debian/Debhelper/Buildsystem/
+ $(INSTALL) -m 644 dh/python3.pm $(DESTDIR)$(PREFIX)/share/perl5/Debian/Debhelper/Sequence/
+ $(INSTALL) -m 644 autoscripts/* $(DESTDIR)$(PREFIX)/share/debhelper/autoscripts/
+
+%.1: %.rst
+ rst2man $< > $@
+
+%.htm: %.rst
+ rst2html $< > $@
+
+manpages: $(MANPAGES)
+
+dist_fallback:
+ make -C pydist $@
+
+# TESTS
+nose:
+ #nosetests3 --verbose --with-doctest --with-coverage
+ nose2-3 --verbose --plugin nose2.plugins.doctests --with-doctest
+
+tests: nose
+ make -C tests
+
+test%:
+ make -C tests $@
+
+.PHONY: clean tests test% check_versions