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