3 PYTHON_VERSION ?= 2.4.6
4 PYTHON_URL ?= http://www.python.org/ftp/python/$(PYTHON_VERSION)/Python-$(PYTHON_VERSION).tgz
5 SETUPTOOLS_URL ?= http://peak.telecommunity.com/dist/ez_setup.py
7 PIL_URL ?= http://effbot.org/downloads/Imaging-$(PIL_VERSION).tar.gz
9 ###########################################################################
14 PYTHON = $(BASEDIR)/$(PYTHON_DIR)/bin/python
15 EASY_INSTALL = $(BASEDIR)/$(PYTHON_DIR)/bin/easy_install
16 PASTER = $(BASEDIR)/$(PYTHON_DIR)/bin/paster
21 aptitude install build-essential zlibc libjpeg62-dev libfreetype6-dev
23 .PHONY: default debdepends python-unpack python-build python-rebuild python-clean python \
24 setuptools eggs pil-unpack pil-build pil-rebuild pil-clean pil buildout bootstrap \
25 update update-nonet shell init otherinit
27 python-unpack: $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README
28 $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README:
30 wget "$(PYTHON_URL)" -O $(PYTHON_DIR)/python.tgz
31 tar -C $(PYTHON_DIR) -xzf $(PYTHON_DIR)/python.tgz
32 rm -f $(PYTHON_DIR)/python.tgz
34 python-build: $(PYTHON)
36 cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && ./configure --prefix=$(BASEDIR)/$(PYTHON_DIR)
37 cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make
38 cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make install
40 python-rebuild: python-clean python-build
43 cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make clean
46 python: python-unpack python-build
48 setuptools: $(EASY_INSTALL)
50 mkdir $(PYTHON_DIR)/Extensions
51 wget $(SETUPTOOLS_URL) -O $(PYTHON_DIR)/Extensions/ez_setup.py
52 cd $(PYTHON_DIR)/Extensions && $(PYTHON) ez_setup.py
55 $(EASY_INSTALL) ZopeSkel
56 $(EASY_INSTALL) zc.buildout
58 pil-unpack: $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION)/README
59 $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION)/README:
60 wget $(PIL_URL) -O $(PYTHON_DIR)/Extensions/pil.tgz
61 tar -C $(PYTHON_DIR)/Extensions -xzf $(PYTHON_DIR)/Extensions/pil.tgz
62 rm -f $(PYTHON_DIR)/Extensions/pil.tgz
64 pil-build: $(PYTHON_DIR)/bin/pilconvert.py
65 $(PYTHON_DIR)/bin/pilconvert.py:
66 cd $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION) && $(PYTHON) setup.py build --force
67 cd $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION) && $(PYTHON) setup.py install --force
69 pil-rebuild: pil-clean pil-build
72 rm -f $(PYTHON_DIR)/bin/pilconvert.py
74 pil: pil-unpack pil-build
76 buildout: buildout.cfg
78 $(PASTER) create --no-interactive -t plone3_buildout . zope_password=admin
81 sed -i -e '1s/^#!.*\/python/#!$(subst /,\/,$(PYTHON))/' $(PYTHON_DIR)/bin/*
82 $(PYTHON) bootstrap.py
85 @echo "python/" >.gitignore
86 @echo "var/" >>.gitignore
87 @echo "bin/" >>.gitignore
88 @echo "develop-eggs/" >>.gitignore
89 @echo "downloads/" >>.gitignore
90 @echo "eggs/" >>.gitignore
91 @echo "fake-eggs/" >>.gitignore
92 @echo "parts/" >>.gitignore
93 @echo "/.installed.cfg" >>.gitignore
94 @echo "*.pyc" >>.gitignore
97 @PATH=$(BASEDIR)/$(PYTHON_DIR)/bin:$(BASEDIR)/bin:$$PATH $$SHELL
99 init: python setuptools pil eggs buildout otherinit otherupdate bootstrap update .gitignore
108 update-nonet: otherupdate