2010-02-22 20:30:26 +00:00
|
|
|
# This Makefile is only used by developers.
|
2010-02-21 19:18:08 +00:00
|
|
|
VERSION:=$(shell python setup.py --version)
|
2010-02-23 06:37:42 +00:00
|
|
|
ARCHIVE:=patool-$(VERSION).tar.gz
|
2010-03-26 20:15:05 +00:00
|
|
|
ARCHIVE_WIN32:=patool-$(VERSION).win32.exe
|
2010-02-21 11:14:57 +00:00
|
|
|
PY_FILES_DIRS := patool setup.py patoolib tests
|
2010-03-04 13:57:03 +00:00
|
|
|
NUMCPUS := $(shell grep -c '^process' /proc/cpuinfo)
|
2010-02-22 20:30:26 +00:00
|
|
|
# which test modules to run
|
2010-02-21 11:14:57 +00:00
|
|
|
TESTS ?= tests/
|
|
|
|
# set test options, eg. to "--nologcapture"
|
|
|
|
TESTOPTS=
|
2010-03-21 19:03:41 +00:00
|
|
|
# test for nose achievements plugin and use it if available
|
|
|
|
NOSE_ACHIEVEMENTS:=$(shell nosetests --plugins | grep achievements)
|
|
|
|
ifeq ($(strip $(NOSE_ACHIEVEMENTS)),Plugin achievements)
|
|
|
|
TESTOPTS += --with-achievements
|
|
|
|
endif
|
2010-02-21 11:14:57 +00:00
|
|
|
|
|
|
|
all:
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: chmod
|
|
|
|
chmod:
|
|
|
|
-chmod -R a+rX,u+w,go-w -- *
|
|
|
|
find . -type d -exec chmod 755 {} \;
|
|
|
|
|
|
|
|
.PHONY: dist
|
|
|
|
dist:
|
2010-02-23 06:37:42 +00:00
|
|
|
git archive --format=tar --prefix=patool-$(VERSION)/ HEAD | gzip -9 > ../$(ARCHIVE)
|
2010-03-26 20:15:05 +00:00
|
|
|
[ -f ../$(ARCHIVE).sha1 ] || sha1sum ../$(ARCHIVE) > ../$(ARCHIVE).sha1
|
|
|
|
[ -f ../$(ARCHIVE).asc ] || gpg --detach-sign --armor ../$(ARCHIVE)
|
|
|
|
[ -f ../$(ARCHIVE_WIN32).sha1 ] || sha1sum ../$(ARCHIVE_WIN32) > ../$(ARCHIVE_WIN32).sha1
|
|
|
|
[ -f ../$(ARCHIVE_WIN32).asc ] || gpg --detach-sign --armor ../$(ARCHIVE_WIN32)
|
2010-02-21 11:14:57 +00:00
|
|
|
# cd .. && zip -r - patool-git -x "**/.git/**" > $(HOME)/temp/share/patool-devel.zip
|
|
|
|
|
2010-03-08 16:28:59 +00:00
|
|
|
.PHONY: upload
|
|
|
|
upload:
|
2010-03-26 20:15:05 +00:00
|
|
|
rsync -avP -e ssh ../$(ARCHIVE)* ../$(ARCHIVE_WIN32)* calvin,patool@frs.sourceforge.net:/home/frs/project/p/pa/patool/$(VERSION)/
|
2010-03-08 16:28:59 +00:00
|
|
|
|
|
|
|
|
2010-03-04 08:03:36 +00:00
|
|
|
.PHONY: release
|
2010-03-08 16:28:59 +00:00
|
|
|
release: clean releasecheck dist upload
|
2010-03-04 08:03:36 +00:00
|
|
|
@echo "Register at Python Package Index..."
|
2010-03-04 16:17:25 +00:00
|
|
|
python setup.py register
|
2010-03-04 08:03:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: releasecheck
|
|
|
|
releasecheck: check test
|
|
|
|
@if egrep -i "xx\.|xxxx|\.xx" doc/changelog.txt > /dev/null; then \
|
|
|
|
echo "Could not release: edit doc/changelog.txt release date"; false; \
|
|
|
|
fi
|
2010-10-04 17:32:04 +00:00
|
|
|
@if [ ! -f ../$(ARCHIVE_WIN32) ]; then \
|
|
|
|
echo "Missing WIN32 distribution archive at ../$(ARCHIVE_WIN32)"; \
|
|
|
|
false; \
|
|
|
|
fi
|
2010-03-04 08:03:36 +00:00
|
|
|
|
2010-02-21 11:14:57 +00:00
|
|
|
# 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.
|
|
|
|
.PHONY: check
|
|
|
|
check:
|
|
|
|
[ ! -d .svn ] || check-nosvneolstyle -v
|
|
|
|
check-copyright
|
|
|
|
check-pofiles -v
|
|
|
|
py-tabdaddy
|
2010-03-06 10:19:20 +00:00
|
|
|
py-unittest2-compat tests/
|
2010-02-21 11:14:57 +00:00
|
|
|
$(MAKE) pyflakes
|
|
|
|
|
|
|
|
.PHONY: pyflakes
|
|
|
|
pyflakes:
|
|
|
|
pyflakes $(PY_FILES_DIRS)
|
|
|
|
|
|
|
|
.PHONY: count
|
|
|
|
count:
|
|
|
|
@sloccount patool patoolib | grep "Total Physical Source Lines of Code"
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
find . -name \*.pyc -delete
|
|
|
|
find . -name \*.pyo -delete
|
2010-03-01 15:01:23 +00:00
|
|
|
rm -rf build dist
|
2010-02-21 11:14:57 +00:00
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
2010-03-04 13:57:03 +00:00
|
|
|
nosetests -v --processes=$(NUMCPUS) -m "^test_.*" $(TESTOPTS) $(TESTS)
|
2010-02-21 11:14:57 +00:00
|
|
|
|
|
|
|
doc/patool.txt: doc/patool.1
|
2010-03-19 12:09:07 +00:00
|
|
|
cols=`stty size | cut -d" " -f2`; stty cols 72; man -l doc/patool.1 | perl -pe 's/.\cH//g' > doc/patool.txt; stty cols $$cols
|
2010-02-21 18:38:22 +00:00
|
|
|
|
|
|
|
.PHONY: deb
|
|
|
|
deb:
|
|
|
|
git-buildpackage --git-export-dir=../build-area/ --git-upstream-branch=master --git-debian-branch=debian --git-ignore-new
|