Wrote man page embryos.
[joel/kofoto.git] / Makefile
1 PREFIX = /usr/local
2
3 VERSION = $(shell sed -n 's/^version = "\(.*\)"$$/\1/p' src/lib/kofoto/version.py)
4
5 help:
6         @echo "Available targets:"
7         @echo
8         @echo "clean"
9         @echo "install [PREFIX=prefix]"
10
11 clean:
12         $(MAKE) -C src/web clean
13         rm -rf build dist
14         find . \( -name '*~' -o -name '.*~' -o -name '.#*' -o -name '*.pyc' \
15                   -o -name '*.orig' -o -name '*.bak' -o -name '*.rej' \
16                   -o -name MANIFEST \
17                \) -exec rm -f {} \;
18
19 install:
20         ./setup.py install --prefix=$(PREFIX)
21
22 ifeq "$(shell echo $(VERSION) | grep pre)" ""
23 dist: clean dist_all
24 else
25 dist: clean dist_pre
26 endif
27
28 dist_all: dist_pre dist_rpm dist_debian
29 dist_pre: dist_source dist_binary_targz dist_windows_installer
30
31 dist_source:
32         ./setup.py sdist --formats=gztar,zip
33
34 dist_binary_targz:
35         ./setup.py bdist --formats=gztar
36
37 dist_windows_installer:
38         ./setup.py windows bdist_wininst --install-script gkofoto-windows-postinstall.py
39
40 dist_rpm:
41         ./setup.py bdist --formats=rpm
42
43 dist_debian:
44         mkdir dist/debiantmp
45         cp dist/kofoto-$(VERSION).tar.gz dist/debiantmp/kofoto_$(VERSION).orig.tar.gz
46         cd dist/debiantmp && tar xzf kofoto_$(VERSION).orig.tar.gz
47         cp -r packaging/debian dist/debiantmp/kofoto-$(VERSION)
48         cd dist/debiantmp/kofoto-$(VERSION) && debuild
49         mkdir -p dist/debian
50         mv dist/debiantmp/kofoto_$(VERSION)-*.deb dist/debian
51         mv dist/debiantmp/kofoto_$(VERSION).orig.tar.gz dist/debian
52         mv dist/debiantmp/kofoto_$(VERSION)-*.diff.gz dist/debian
53         mv dist/debiantmp/kofoto_$(VERSION)-*.dsc dist/debian
54         cd dist/debian && dpkg-scanpackages . /dev/null 2>/dev/null | gzip -9c >Packages.gz
55         cd dist/debian && dpkg-scansources . /dev/null 2>/dev/null | gzip -9c >Sources.gz
56         rm -rf dist/debiantmp
57
58 check:
59         python src/test/alltests.py
60
61 .PHONY: help clean install dist check