summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2009-12-18 00:59:11 +0200
committerMarius Gedminas <marius@gedmin.as>2009-12-18 00:59:11 +0200
commite05168cec36b798820e28d975db621dadb0ad564 (patch)
tree178dd58458a4bcda0333d1a805af0a2df6dfed01
parent951536abdb96377dc23d5888f4b7c261bb22c392 (diff)
Add a Makefile, primarily for 'make distcheck'. Add a MANIFEST.in, make
'make distcheck' pass. The sdist should now work.
-rw-r--r--MANIFEST.in8
-rw-r--r--Makefile63
2 files changed, 71 insertions, 0 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..deb56c6
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,8 @@
+include *.txt
+include Makefile
+include gtimelog
+include gtimelog.desktop
+include gtimelogrc.example
+include runtests
+include scripts/*.py
+recursive-include src *.png *.glade
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ab6c0ac
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,63 @@
+#
+# Options
+#
+
+PYTHON = python
+
+#
+# Interesting targets
+#
+
+.PHONY: all
+all:
+ @echo "There's nothing that needs building. Just run ./gtimelog"
+
+.PHONY: check test
+check test:
+ ./runtests
+
+.PHONY: dist
+dist:
+ $(PYTHON) setup.py sdist
+
+.PHONY: distcheck
+distcheck: check dist
+ pkg_and_version=`$(PYTHON) setup.py --name`-`$(PYTHON) setup.py --version` && \
+ rm -rf tmp && \
+ mkdir tmp && \
+ bzr export tmp/tree && \
+ cd tmp && \
+ tar xvzf ../dist/$$pkg_and_version.tar.gz && \
+ diff -ur $$pkg_and_version tree -x PKG-INFO -x setup.cfg -x '*.egg-info' && \
+ cd $$pkg_and_version && \
+ make dist check && \
+ cd .. && \
+ mkdir one two && \
+ cd one && \
+ tar xvzf ../../dist/$$pkg_and_version.tar.gz && \
+ cd ../two/ && \
+ tar xvzf ../$$pkg_and_version/dist/$$pkg_and_version.tar.gz && \
+ cd .. && \
+ diff -ur one two -x SOURCES.txt && \
+ cd .. && \
+ rm -rf tmp && \
+ echo "sdist seems to be ok"
+# I'm ignoring SOURCES.txt since it appears that the second sdist gets a new
+# source file, namely, setup.cfg. Setuptools/distutils black magic, may it rot
+# in hell forever.
+
+release:
+ @$(PYTHON) setup.py --version | grep -qv dev || { \
+ echo "Please remove the 'dev' suffix from the version number in src/gtimelog/__init__.py"; exit 1; }
+ @$(PYTHON) setup.py --long-description | rst2html --exit-status=2 > /dev/null
+ @ver_and_date="`$(PYTHON) setup.py --version` (`date +%Y-%m-%d`)" && \
+ grep -q "^$$ver_and_date$$" NEWS.txt || { \
+ echo "NEWS.txt has no entry for $$ver_and_date"; exit 1; }
+ make distcheck
+ test -z "`bzr status 2>&1`" || { echo; echo "Your working tree is not clean" 1>&2; bzr status; exit 1; }
+ # I'm chicken so I won't actually do these things yet
+ @echo Please run $(PYTHON) setup.py sdist register upload
+ @echo Please run bzr tag `$(PYTHON) setup.py --version`
+ @echo Please increment the version number in src/gtimelog/__init__.py
+ @echo Please add a new empty entry in NEWS.txt
+