Modularize Makefile and add two skeletons: plone3 and zope3
[zope-bootstrap.git] / Makefile.pybase
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
7 ###########################################################################
8
9 PYTHON_DIR=python
10
11 PYTHON       = $(BASEDIR)/$(PYTHON_DIR)/bin/python
12 EASY_INSTALL = $(BASEDIR)/$(PYTHON_DIR)/bin/easy_install
13 PASTER       = $(BASEDIR)/$(PYTHON_DIR)/bin/paster
14
15 ###########################################################################
16
17 python-unpack: $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README
18 $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README:
19         mkdir $(PYTHON_DIR)
20         wget "$(PYTHON_URL)" -O $(PYTHON_DIR)/python.tgz
21         tar -C $(PYTHON_DIR) -xzf $(PYTHON_DIR)/python.tgz
22         rm -f $(PYTHON_DIR)/python.tgz
23 .PHONY: python-unpack
24
25 python-build: $(PYTHON)
26 $(PYTHON):
27         cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && ./configure --prefix=$(BASEDIR)/$(PYTHON_DIR)
28         cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make
29         cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make install
30 .PHONY: python-build
31
32 python-rebuild: python-clean python-build
33 .PHONY: python-rebuild
34
35 python-clean:
36         cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make clean
37         rm -f $(PYTHON)
38 .PHONY: python-clean
39
40 python: python-unpack python-build
41 .PHONY: python
42
43 setuptools: $(EASY_INSTALL)
44 $(EASY_INSTALL):
45         mkdir $(PYTHON_DIR)/Extensions
46         wget $(SETUPTOOLS_URL) -O $(PYTHON_DIR)/Extensions/ez_setup.py
47         cd $(PYTHON_DIR)/Extensions && $(PYTHON) ez_setup.py
48 .PHONY: setuptools
49
50 pybase: python setuptools
51 .PHONY: pybase
52
53 ###########################################################################
54
55 debdepends::
56         aptitude install build-essential zlibc
57
58 eggs::
59         $(EASY_INSTALL) zc.buildout
60
61 .gitignore::
62         @$(gitignore) /python/
63
64 .env::
65         @$(env) PATH $(BASEDIR)/$(PYTHON_DIR)/bin
66
67 clean:: python-clean
68
69 setup:: pybase