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