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