Remove unneeded files
[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: 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
26
27 python-unpack: $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README
28 $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README:
29         mkdir $(PYTHON_DIR)
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
33
34 python-build: $(PYTHON)
35 $(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
39
40 python-rebuild: python-clean python-build
41
42 python-clean:
43         cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make clean
44         rm -f $(PYTHON)
45
46 python: python-unpack python-build
47
48 setuptools: $(EASY_INSTALL)
49 $(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
53
54 eggs:
55         $(EASY_INSTALL) ZopeSkel
56         $(EASY_INSTALL) zc.buildout
57
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
63
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
68
69 pil-rebuild: pil-clean pil-build
70
71 pil-clean:
72         rm -f $(PYTHON_DIR)/bin/pilconvert.py
73
74 pil: pil-unpack pil-build
75
76 buildout: buildout.cfg
77 buildout.cfg:
78         $(PASTER) create --no-interactive -t plone3_buildout . zope_password=admin
79
80 versions:
81         @echo "# Add the following lines to [versions] in buildout.cfg to pin all packages"
82         @bin/buildout -Novvvvv |sed -ne 's/^Picked: //p' | sort | uniq 
83
84 bootstrap: 
85         sed -i -e '1s/^#!.*\/python/#!$(subst /,\/,$(PYTHON))/' $(PYTHON_DIR)/bin/*
86 #       $(PYTHON) bootstrap.py
87         $(PYTHON) -c 'from zc.buildout.buildout import main; main(["bootstrap"])'
88
89
90 .gitignore:
91         @echo "python/" >.gitignore
92         @echo "var/" >>.gitignore
93         @echo "bin/" >>.gitignore
94         @echo "develop-eggs/" >>.gitignore
95         @echo "downloads/" >>.gitignore
96         @echo "eggs/" >>.gitignore
97         @echo "fake-eggs/" >>.gitignore
98         @echo "parts/" >>.gitignore
99         @echo "/.installed.cfg" >>.gitignore
100         @echo "/bootstrap.py" >>.gitignore
101         @echo "*.pyc" >>.gitignore
102         @echo "*.egg-info/" >>.gitignore
103
104 shell:
105         @PATH=$(BASEDIR)/$(PYTHON_DIR)/bin:$(BASEDIR)/bin:$$PATH $$SHELL
106
107 init: python setuptools pil eggs buildout otherinit otherupdate bootstrap update .gitignore
108
109 otherinit::
110
111 otherupdate::
112
113 update: otherupdate
114         bin/buildout
115
116 update-nonet: otherupdate
117         bin/buildout -No