2010-02-22 20:30:26 +00:00
|
|
|
# This Makefile is only used by developers.
|
2011-12-27 16:47:28 +00:00
|
|
|
PYVER:=2.7
|
|
|
|
PYTHON:=python$(PYVER)
|
2012-08-03 19:41:45 +00:00
|
|
|
APPNAME:=patool
|
2011-12-27 16:47:28 +00:00
|
|
|
VERSION:=$(shell $(PYTHON) setup.py --version)
|
2012-08-03 19:41:45 +00:00
|
|
|
ARCHIVE:=$(APPNAME)-$(VERSION).tar.gz
|
2012-08-04 14:52:20 +00:00
|
|
|
ARCHIVE_RPM:=$(APPNAME)-$(VERSION)-1.x86_64.rpm
|
2012-08-04 12:15:01 +00:00
|
|
|
ARCHIVE_WIN32:=$(APPNAME)-$(VERSION).exe
|
2010-02-21 11:14:57 +00:00
|
|
|
PY_FILES_DIRS := patool setup.py patoolib tests
|
2011-12-27 16:47:28 +00:00
|
|
|
PY2APPOPTS ?=
|
|
|
|
ifeq ($(shell uname),Darwin)
|
|
|
|
CHMODMINUSMINUS:=
|
|
|
|
else
|
|
|
|
CHMODMINUSMINUS:=--
|
|
|
|
endif
|
2012-11-14 19:24:34 +00:00
|
|
|
# Pytest options:
|
2012-11-18 19:43:14 +00:00
|
|
|
# --resultlog: write test results in file
|
|
|
|
# -s: do not capture stdout/stderr (some tests fail otherwise)
|
|
|
|
PYTESTOPTS:=--resultlog=testresults.txt -s
|
2010-02-22 20:30:26 +00:00
|
|
|
# which test modules to run
|
2010-02-21 11:14:57 +00:00
|
|
|
TESTS ?= tests/
|
2012-11-14 19:24:34 +00:00
|
|
|
# set test options
|
2010-02-21 11:14:57 +00:00
|
|
|
TESTOPTS=
|
|
|
|
|
|
|
|
all:
|
|
|
|
|
|
|
|
|
|
|
|
chmod:
|
2011-12-27 16:47:28 +00:00
|
|
|
-chmod -R a+rX,u+w,go-w $(CHMODMINUSMINUS) *
|
2010-02-21 11:14:57 +00:00
|
|
|
find . -type d -exec chmod 755 {} \;
|
|
|
|
|
|
|
|
dist:
|
2012-08-03 19:41:45 +00:00
|
|
|
git archive --format=tar --prefix=$(APPNAME)-$(VERSION)/ HEAD | gzip -9 > ../$(ARCHIVE)
|
2012-08-04 14:52:20 +00:00
|
|
|
# cd .. && zip -r - patool-git -x "**/.git/**" > $(HOME)/temp/share/patool-devel.zip
|
|
|
|
|
|
|
|
sign:
|
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)
|
2012-08-04 14:52:20 +00:00
|
|
|
[ -f dist/$(ARCHIVE_RPM).sha1 ] || sha1sum dist/$(ARCHIVE_RPM) > dist/$(ARCHIVE_RPM).sha1
|
|
|
|
[ -f dist/$(ARCHIVE_RPM).asc ] || gpg --detach-sign --armor dist/$(ARCHIVE_RPM)
|
2010-02-21 11:14:57 +00:00
|
|
|
|
2012-08-04 14:52:20 +00:00
|
|
|
upload: doc/README.md sign
|
|
|
|
rsync -avP -e ssh doc/README.md ../$(ARCHIVE)* ../$(ARCHIVE_WIN32)* dist/$(ARCHIVE_RPM)* calvin,patool@frs.sourceforge.net:/home/frs/project/p/pa/patool/$(VERSION)/
|
2010-03-08 16:28:59 +00:00
|
|
|
|
2012-08-04 12:17:35 +00:00
|
|
|
doc/README.md: doc/README-Download.md.tmpl doc/changelog.txt
|
2012-08-03 19:41:45 +00:00
|
|
|
# copying readme for sourceforge downloads
|
|
|
|
sed -e 's/{APPNAME}/$(APPNAME)/g' -e 's/{VERSION}/$(VERSION)/g' $< > $@
|
|
|
|
# append changelog
|
|
|
|
awk '/released/ {c++}; c==2 {exit}; {print " " $$0}' doc/changelog.txt >> $@
|
|
|
|
|
2010-03-08 16:28:59 +00:00
|
|
|
|
|
|
|
release: clean releasecheck dist upload
|
2012-08-04 14:55:17 +00:00
|
|
|
git tag upstream/$(VERSION)
|
2010-03-04 08:03:36 +00:00
|
|
|
@echo "Register at Python Package Index..."
|
2011-12-27 16:47:28 +00:00
|
|
|
$(PYTHON) setup.py register
|
|
|
|
freecode-submit < patool.freecode
|
2010-03-04 08:03:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
2012-01-30 20:01:08 +00:00
|
|
|
@if ! grep "Version: $(VERSION)" patool.freecode > /dev/null; then \
|
|
|
|
echo "Could not release: edit patool.freecode version"; false; \
|
2010-11-20 20:01:46 +00:00
|
|
|
fi
|
2010-03-04 08:03:36 +00:00
|
|
|
|
2011-12-27 16:47:28 +00:00
|
|
|
# Build OSX installer
|
|
|
|
app: clean chmod
|
|
|
|
$(PYTHON) setup.py py2app $(PY2APPOPTS)
|
|
|
|
|
2012-08-04 14:52:20 +00:00
|
|
|
rpm:
|
|
|
|
$(PYTHON) setup.py bdist_rpm
|
|
|
|
|
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.
|
|
|
|
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
|
|
|
|
|
|
|
pyflakes:
|
|
|
|
pyflakes $(PY_FILES_DIRS)
|
|
|
|
|
|
|
|
count:
|
|
|
|
@sloccount patool patoolib | grep "Total Physical Source Lines of Code"
|
|
|
|
|
|
|
|
clean:
|
|
|
|
find . -name \*.pyc -delete
|
|
|
|
find . -name \*.pyo -delete
|
2012-11-19 20:23:52 +00:00
|
|
|
rm -rf build dist doc/README.md
|
2010-02-21 11:14:57 +00:00
|
|
|
|
|
|
|
test:
|
2012-11-14 19:24:34 +00:00
|
|
|
$(PYTHON) -m pytest $(PYTESTOPTS) $(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
|
|
|
|
|
|
|
deb:
|
2012-12-13 06:32:23 +00:00
|
|
|
git-buildpackage --git-upstream-branch=master --git-debian-branch=debian --git-ignore-new
|
2011-12-27 16:47:28 +00:00
|
|
|
|
|
|
|
update-copyright:
|
|
|
|
update-copyright --holder="Bastian Kleineidam"
|
2012-04-09 10:05:26 +00:00
|
|
|
|
|
|
|
changelog:
|
|
|
|
sftrack_changelog patool calvin@users.sourceforge.net doc/changelog.txt $(DRYRUN)
|
2012-11-14 19:24:34 +00:00
|
|
|
|
|
|
|
.PHONY: changelog update-copyright deb test clean count pyflakes check rpm app
|
|
|
|
.PHONY: releasecheck release upload sign dist chmod all
|