dd36484eba46464769798e3d17d655e39def0ece
[zope-bootstrap.git] / Makefile.master
1 # -*- makefile -*-
2
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
6 PIL_VERSION    ?= 1.1.6
7 PIL_URL        ?= http://effbot.org/downloads/Imaging-$(PIL_VERSION).tar.gz
8
9 ###########################################################################
10
11 PYTHON_DIR=python
12 BASEDIR=$(shell pwd)
13
14 PYTHON       = $(BASEDIR)/$(PYTHON_DIR)/bin/python
15 EASY_INSTALL = $(BASEDIR)/$(PYTHON_DIR)/bin/easy_install
16 PASTER       = $(BASEDIR)/$(PYTHON_DIR)/bin/paster
17
18 default: update-nonet
19
20 .PHONY: python-unpack python-build python setuptools eggs pil-unpack pil-build pil buildout \
21         bootstrap update update-nonet shell init otherinit
22
23 python-unpack: $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README
24 $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README:
25         mkdir $(PYTHON_DIR)
26         wget "$(PYTHON_URL)" -O $(PYTHON_DIR)/python.tgz
27         tar -C $(PYTHON_DIR) -xzf $(PYTHON_DIR)/python.tgz
28         rm -f $(PYTHON_DIR)/python.tgz
29
30 python-build: $(PYTHON)
31 $(PYTHON):
32         cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && ./configure --prefix=$(BASEDIR)/$(PYTHON_DIR)
33         cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make
34         cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make install
35
36 python: python-unpack python-build
37
38 setuptools: $(EASY_INSTALL)
39 $(EASY_INSTALL):
40         mkdir $(PYTHON_DIR)/Extensions
41         wget $(SETUPTOOLS_URL) -O $(PYTHON_DIR)/Extensions/ez_setup.py
42         cd $(PYTHON_DIR)/Extensions && $(PYTHON) ez_setup.py
43
44 eggs:
45         $(EASY_INSTALL) ZopeSkel
46         $(EASY_INSTALL) zc.buildout
47
48 pil-unpack: $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION)/README
49 $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION)/README:
50         wget $(PIL_URL) -O $(PYTHON_DIR)/Extensions/pil.tgz
51         tar -C $(PYTHON_DIR)/Extensions -xzf $(PYTHON_DIR)/Extensions/pil.tgz
52         rm -f $(PYTHON_DIR)/Extensions/pil.tgz
53
54 pil-build: $(PYTHON_DIR)/bin/pilconvert.py
55 $(PYTHON_DIR)/bin/pilconvert.py:
56         cd $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION) && $(PYTHON) setup.py install
57
58 pil: pil-unpack pil-build
59
60 buildout: buildout.cfg
61 buildout.cfg:
62         $(PASTER) create --no-interactive -t plone3_buildout . zope_password=admin
63
64 bootstrap: 
65         sed -i -e '1s/^#!.*\/python/#!$(subst /,\/,$(PYTHON))/' $(PYTHON_DIR)/bin/*
66         $(PYTHON) bootstrap.py
67
68 .gitignore:
69         @echo "python/" >.gitignore
70         @echo "var/" >>.gitignore
71         @echo "bin/" >>.gitignore
72         @echo "develop-eggs/" >>.gitignore
73         @echo "downloads/" >>.gitignore
74         @echo "eggs/" >>.gitignore
75         @echo "fake-eggs/" >>.gitignore
76         @echo "parts/" >>.gitignore
77         @echo "/.installed.cfg" >>.gitignore
78         @echo "*.pyc" >>.gitignore
79
80 shell:
81         @PATH=$(BASEDIR)/$(PYTHON_DIR)/bin:$(BASEDIR)/bin:$$PATH $$SHELL
82
83 init: python setuptools pil eggs buildout otherinit otherupdate bootstrap update .gitignore
84
85 otherinit::
86
87 otherupdate::
88
89 update: otherupdate
90         bin/buildout
91
92 update-nonet: otherupdate
93         bin/buildout -No