2012-06-20 19:58:13 +00:00
|
|
|
# This Makefile is only used by developers.
|
|
|
|
PYVER:=2.7
|
|
|
|
PYTHON:=python$(PYVER)
|
|
|
|
VERSION:=$(shell $(PYTHON) setup.py --version)
|
|
|
|
ARCHIVE:=dosage-$(VERSION).tar.gz
|
2012-12-12 16:41:29 +00:00
|
|
|
PY_FILES_DIRS := dosage dosagelib scripts tests
|
2012-06-20 19:58:13 +00:00
|
|
|
PY2APPOPTS ?=
|
2012-12-12 16:41:29 +00:00
|
|
|
# Default pytest options:
|
|
|
|
# Do not use parallel testing with -n: it makes some tests fail since
|
|
|
|
# some web servers have limits on the number of parallel connections.
|
|
|
|
# Also note that using -n silently swallows test creation exceptions like
|
|
|
|
# import errors.
|
|
|
|
PYTESTOPTS?=--resultlog=testresults.txt --tb=short
|
2012-06-20 19:58:13 +00:00
|
|
|
CHMODMINUSMINUS:=--
|
2012-09-26 12:42:11 +00:00
|
|
|
# directory or file with tests to run
|
|
|
|
TESTS ?= tests
|
|
|
|
# set test options, eg. to "--verbose"
|
2012-06-20 19:58:13 +00:00
|
|
|
TESTOPTS=
|
|
|
|
|
|
|
|
all:
|
|
|
|
|
|
|
|
chmod:
|
|
|
|
-chmod -R a+rX,u+w,go-w $(CHMODMINUSMINUS) *
|
|
|
|
find . -type d -exec chmod 755 {} \;
|
|
|
|
|
|
|
|
dist:
|
|
|
|
git archive --format=tar --prefix=dosage-$(VERSION)/ HEAD | gzip -9 > ../$(ARCHIVE)
|
|
|
|
[ -f ../$(ARCHIVE).sha1 ] || sha1sum ../$(ARCHIVE) > ../$(ARCHIVE).sha1
|
|
|
|
[ -f ../$(ARCHIVE).asc ] || gpg --detach-sign --armor ../$(ARCHIVE)
|
|
|
|
|
|
|
|
doc/dosage.1.html: doc/dosage.1
|
|
|
|
man2html -r $< | tail -n +2 | sed 's/Time:.*//g' | sed 's@/:@/@g' > $@
|
|
|
|
|
|
|
|
release: distclean releasecheck dist
|
|
|
|
git tag v$(VERSION)
|
2012-11-28 17:15:12 +00:00
|
|
|
@echo "Register at Python Package Index..."
|
|
|
|
$(PYTHON) setup.py register
|
2012-06-20 19:58:13 +00:00
|
|
|
# freecode-submit < dosage.freecode
|
|
|
|
|
|
|
|
|
2012-12-12 16:41:29 +00:00
|
|
|
releasecheck: check
|
2012-06-20 19:58:13 +00:00
|
|
|
@if egrep -i "xx\.|xxxx|\.xx" doc/changelog.txt > /dev/null; then \
|
|
|
|
echo "Could not release: edit doc/changelog.txt release date"; false; \
|
|
|
|
fi
|
|
|
|
# @if ! grep "Version: $(VERSION)" dosage.freecode > /dev/null; then \
|
|
|
|
# echo "Could not release: edit dosage.freecode version"; false; \
|
|
|
|
# fi
|
|
|
|
|
|
|
|
# The check programs used here are mostly local scripts on my private system.
|
|
|
|
# So for other developers there is no need to execute this target.
|
|
|
|
check:
|
|
|
|
[ ! -d .svn ] || check-nosvneolstyle -v
|
|
|
|
check-copyright
|
|
|
|
check-pofiles -v
|
|
|
|
py-tabdaddy
|
|
|
|
py-unittest2-compat tests/
|
2012-09-25 19:03:05 +00:00
|
|
|
$(MAKE) doccheck
|
|
|
|
$(MAKE) pyflakes
|
|
|
|
|
|
|
|
doccheck:
|
|
|
|
py-check-docstrings --force \
|
2012-10-11 16:02:34 +00:00
|
|
|
dosagelib/*.py \
|
2012-09-25 19:03:05 +00:00
|
|
|
dosage \
|
|
|
|
*.py
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
pyflakes:
|
|
|
|
pyflakes $(PY_FILES_DIRS)
|
|
|
|
|
|
|
|
count:
|
2012-12-05 20:52:52 +00:00
|
|
|
@sloccount $(PY_FILES_DIRS) | grep "Total Physical Source Lines of Code"
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
find . -name \*.pyc -delete
|
|
|
|
find . -name \*.pyo -delete
|
|
|
|
rm -rf build dist
|
|
|
|
|
|
|
|
distclean: clean
|
2012-11-28 17:15:12 +00:00
|
|
|
rm -rf build dist Dosage.egg-info dosage.prof test.sh testresults.txt
|
2012-06-20 19:58:13 +00:00
|
|
|
rm -f _Dosage_configdata.py MANIFEST
|
|
|
|
|
2012-10-10 19:13:31 +00:00
|
|
|
localbuild:
|
|
|
|
$(PYTHON) setup.py build
|
|
|
|
|
|
|
|
test: localbuild
|
2012-12-12 16:41:29 +00:00
|
|
|
env LANG=en_US.utf-8 http_proxy="" $(PYTHON) -m pytest $(PYTESTOPTS) $(TESTOPTS) $(TESTS)
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
deb:
|
2012-12-12 16:41:29 +00:00
|
|
|
git-buildpackage --git-upstream-branch=master --git-debian-branch=debian --git-ignore-new
|
2012-06-20 19:58:13 +00:00
|
|
|
|
2012-06-20 20:41:04 +00:00
|
|
|
update-copyright:
|
|
|
|
update-copyright --holder="Bastian Kleineidam"
|
2012-10-10 19:13:31 +00:00
|
|
|
|
2012-11-28 17:15:12 +00:00
|
|
|
.PHONY: update-copyright deb test clean distclean count pyflakes
|
2012-10-10 19:13:31 +00:00
|
|
|
.PHONY: doccheck check releasecheck release dist chmod localbuild
|