Refaktor Makefiles and autogenerate easyshop.cfg
Stefan Bund [Tue, 20 Oct 2009 13:28:30 +0000 (15:28 +0200)]
Makefile
Makefile.easyshop [new file with mode: 0644]
Makefile.master [new file with mode: 0644]
buildout.cfg
easyshop.cfg [deleted file]

index cb0cacd..fbd7dd9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,102 +1,9 @@
 # -*- makefile -*-
 
-PYTHON_URL     = http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz
 PYTHON_VERSION = 2.4.6
-SETUPTOOLS_URL = http://peak.telecommunity.com/dist/ez_setup.py
-PIL_URL        = http://effbot.org/downloads/Imaging-1.1.6.tar.gz
 PIL_VERSION    = 1.1.6
 
-EASYSHOP_URL   = http://easyshop-for-plone.googlecode.com/svn/buildout/3.0-Anonymous
-
-###########################################################################
-
-PYTHON_DIR=python
-BASEDIR=$(shell pwd)
-
-PYTHON       = $(BASEDIR)/$(PYTHON_DIR)/bin/python
-EASY_INSTALL = $(BASEDIR)/$(PYTHON_DIR)/bin/easy_install
-PASTER       = $(BASEDIR)/$(PYTHON_DIR)/bin/paster
-
-default: update-nonet
-
-.PHONY: python-unpack python-build python setuptools eggs pil-unpack pil-build pil buildout \
-       bootstrap update update-nonet shell init userinit
-
-python-unpack: $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README
-$(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README:
-       mkdir $(PYTHON_DIR)
-       wget "$(PYTHON_URL)" -O $(PYTHON_DIR)/python.tgz
-       tar -C $(PYTHON_DIR) -xzf $(PYTHON_DIR)/python.tgz
-       rm -f $(PYTHON_DIR)/python.tgz
-
-python-build: $(PYTHON)
-$(PYTHON):
-       cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && ./configure --prefix=$(BASEDIR)/$(PYTHON_DIR)
-       cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make
-       cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make install
-
-python: python-unpack python-build
-
-setuptools: $(EASY_INSTALL)
-$(EASY_INSTALL):
-       mkdir $(PYTHON_DIR)/Extensions
-       wget $(SETUPTOOLS_URL) -O $(PYTHON_DIR)/Extensions/ez_setup.py
-       cd $(PYTHON_DIR)/Extensions && $(PYTHON) ez_setup.py
-
-eggs:
-       $(EASY_INSTALL) ZopeSkel
-       $(EASY_INSTALL) zc.buildout
-
-pil-unpack: $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION)/README
-$(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION)/README:
-       wget $(PIL_URL) -O $(PYTHON_DIR)/Extensions/pil.tgz
-       tar -C $(PYTHON_DIR)/Extensions -xzf $(PYTHON_DIR)/Extensions/pil.tgz
-       rm -f $(PYTHON_DIR)/Extensions/pil.tgz
-
-pil-build: $(PYTHON_DIR)/bin/pilconvert.py
-$(PYTHON_DIR)/bin/pilconvert.py:
-       cd $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION) && $(PYTHON) setup.py install
-
-pil: pil-unpack pil-build
-
-buildout: buildout.cfg
-buildout.cfg:
-       $(PASTER) create --no-interactive -t plone3_buildout . zope_password=admin
-
-bootstrap: 
-       sed -i -e '1s/^#!.*\/python/#!$(subst /,\/,$(PYTHON))/' $(PYTHON_DIR)/bin/*
-       $(PYTHON) bootstrap.py
-
-.gitignore:
-       @echo "python/" >.gitignore
-       @echo "var/" >>.gitignore
-       @echo "bin/" >>.gitignore
-       @echo "develop-eggs/" >>.gitignore
-       @echo "downloads/" >>.gitignore
-       @echo "eggs/" >>.gitignore
-       @echo "fake-eggs/" >>.gitignore
-       @echo "parts/" >>.gitignore
-       @echo "/.installed.cfg" >>.gitignore
-       @echo "*.pyc" >>.gitignore
-
-shell:
-       @PATH=$(BASEDIR)/$(PYTHON_DIR)/bin:$(BASEDIR)/bin:$$PATH $$SHELL
-
-init: python setuptools pil eggs buildout bootstrap userinit update .gitignore
-
-userinit::
-
-update::
-       bin/buildout
-
-update-nonet::
-       bin/buildout -No
-
 ###########################################################################
 
-easyshop-svn: easyshop/README.txt
-easyshop/README.txt:
-       svn co $(EASYSHOP_URL) easyshop
-
-.PHONY: easyshop-svn
-userinit:: easyshop-svn
+include Makefile.master
+include Makefile.easyshop
diff --git a/Makefile.easyshop b/Makefile.easyshop
new file mode 100644 (file)
index 0000000..8e62887
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- makefile -*-
+
+EASYSHOP_URL   ?= http://easyshop-for-plone.googlecode.com/svn/buildout/3.0-Anonymous
+
+###########################################################################
+
+easyshop-svn: easyshop/README.txt easyshop/easyshop.cfg
+easyshop/README.txt:
+       svn co $(EASYSHOP_URL) easyshop
+easyshop/easyshop.cfg:
+       @(                                                                                          \
+           echo "[easyshop]";                                                                      \
+           echo;                                                                                   \
+           sed -n -e '/^zcml *=/,/^$$/p' easyshop/buildout.cfg;                                    \
+           echo "eggs =";                                                                          \
+           echo "    \$${easyshop:zcml}";                                                          \
+           echo;                                                                                   \
+           sed -n -e '/^develop *=/,/^$$/p' easyshop/buildout.cfg | sed -e 's/src/easyshop\/src/'; \
+           echo "products =";                                                                      \
+           echo "    easyshop/products";                                                           \
+           sed -n -e '/^urls *=/,/^$$/p' easyshop/buildout.cfg                                     \
+       ) >$@ || ( rm -f $@; false )
+
+.PHONY: easyshop-svn
+otherinit:: easyshop-svn
diff --git a/Makefile.master b/Makefile.master
new file mode 100644 (file)
index 0000000..5d2bbe6
--- /dev/null
@@ -0,0 +1,91 @@
+# -*- makefile -*-
+
+PYTHON_VERSION ?= 2.4.6
+PYTHON_URL     ?= http://www.python.org/ftp/python/$(PYTHON_VERSION)/Python-$(PYTHON_VERSION).tgz
+SETUPTOOLS_URL ?= http://peak.telecommunity.com/dist/ez_setup.py
+PIL_VERSION    ?= 1.1.6
+PIL_URL        ?= http://effbot.org/downloads/Imaging-$(PIL_VERSION).tar.gz
+
+###########################################################################
+
+PYTHON_DIR=python
+BASEDIR=$(shell pwd)
+
+PYTHON       = $(BASEDIR)/$(PYTHON_DIR)/bin/python
+EASY_INSTALL = $(BASEDIR)/$(PYTHON_DIR)/bin/easy_install
+PASTER       = $(BASEDIR)/$(PYTHON_DIR)/bin/paster
+
+default: update-nonet
+
+.PHONY: python-unpack python-build python setuptools eggs pil-unpack pil-build pil buildout \
+       bootstrap update update-nonet shell init otherinit
+
+python-unpack: $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README
+$(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README:
+       mkdir $(PYTHON_DIR)
+       wget "$(PYTHON_URL)" -O $(PYTHON_DIR)/python.tgz
+       tar -C $(PYTHON_DIR) -xzf $(PYTHON_DIR)/python.tgz
+       rm -f $(PYTHON_DIR)/python.tgz
+
+python-build: $(PYTHON)
+$(PYTHON):
+       cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && ./configure --prefix=$(BASEDIR)/$(PYTHON_DIR)
+       cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make
+       cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make install
+
+python: python-unpack python-build
+
+setuptools: $(EASY_INSTALL)
+$(EASY_INSTALL):
+       mkdir $(PYTHON_DIR)/Extensions
+       wget $(SETUPTOOLS_URL) -O $(PYTHON_DIR)/Extensions/ez_setup.py
+       cd $(PYTHON_DIR)/Extensions && $(PYTHON) ez_setup.py
+
+eggs:
+       $(EASY_INSTALL) ZopeSkel
+       $(EASY_INSTALL) zc.buildout
+
+pil-unpack: $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION)/README
+$(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION)/README:
+       wget $(PIL_URL) -O $(PYTHON_DIR)/Extensions/pil.tgz
+       tar -C $(PYTHON_DIR)/Extensions -xzf $(PYTHON_DIR)/Extensions/pil.tgz
+       rm -f $(PYTHON_DIR)/Extensions/pil.tgz
+
+pil-build: $(PYTHON_DIR)/bin/pilconvert.py
+$(PYTHON_DIR)/bin/pilconvert.py:
+       cd $(PYTHON_DIR)/Extensions/Imaging-$(PIL_VERSION) && $(PYTHON) setup.py install
+
+pil: pil-unpack pil-build
+
+buildout: buildout.cfg
+buildout.cfg:
+       $(PASTER) create --no-interactive -t plone3_buildout . zope_password=admin
+
+bootstrap: 
+       sed -i -e '1s/^#!.*\/python/#!$(subst /,\/,$(PYTHON))/' $(PYTHON_DIR)/bin/*
+       $(PYTHON) bootstrap.py
+
+.gitignore:
+       @echo "python/" >.gitignore
+       @echo "var/" >>.gitignore
+       @echo "bin/" >>.gitignore
+       @echo "develop-eggs/" >>.gitignore
+       @echo "downloads/" >>.gitignore
+       @echo "eggs/" >>.gitignore
+       @echo "fake-eggs/" >>.gitignore
+       @echo "parts/" >>.gitignore
+       @echo "/.installed.cfg" >>.gitignore
+       @echo "*.pyc" >>.gitignore
+
+shell:
+       @PATH=$(BASEDIR)/$(PYTHON_DIR)/bin:$(BASEDIR)/bin:$$PATH $$SHELL
+
+init: python setuptools pil eggs buildout bootstrap otherinit update .gitignore
+
+otherinit::
+
+update::
+       bin/buildout
+
+update-nonet::
+       bin/buildout -No
index 2ece77b..df68650 100644 (file)
@@ -8,7 +8,7 @@ parts =
 # Change the number here to change the version of Plone being used
 extends = 
     http://dist.plone.org/release/3.3.1/versions.cfg 
-    easyshop.cfg
+    easyshop/easyshop.cfg
 versions = versions
 
 # Add additional egg download sources here. dist.plone.org contains archives
diff --git a/easyshop.cfg b/easyshop.cfg
deleted file mode 100644 (file)
index e014ba7..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-[easyshop]
-
-zcml =
-    easyshop.core
-    easyshop.carts
-    easyshop.catalog
-    easyshop.checkout
-    easyshop.criteria
-    easyshop.customers    
-    easyshop.discounts
-    easyshop.groups
-    easyshop.information
-    easyshop.kss  
-    easyshop.login
-    easyshop.management
-    easyshop.order      
-    easyshop.payment    
-    easyshop.shipping      
-    easyshop.shop
-    easyshop.stocks
-    easyshop.taxes
-
-eggs = 
-    elementtree
-    ${easyshop:zcml}
-
-develop = 
-    easyshop/src/easyshop.core
-    easyshop/src/easyshop.carts
-    easyshop/src/easyshop.catalog
-    easyshop/src/easyshop.checkout
-    easyshop/src/easyshop.criteria
-    easyshop/src/easyshop.customers    
-    easyshop/src/easyshop.discounts        
-    easyshop/src/easyshop.groups
-    easyshop/src/easyshop.information
-    easyshop/src/easyshop.kss  
-    easyshop/src/easyshop.login
-    easyshop/src/easyshop.management
-    easyshop/src/easyshop.order      
-    easyshop/src/easyshop.payment    
-    easyshop/src/easyshop.shipping      
-    easyshop/src/easyshop.shop
-    easyshop/src/easyshop.stocks
-    easyshop/src/easyshop.taxes
-
-products =
-    easyshop/products
-
-urls = 
-    http://plone.org/products/datagridfield/releases/1.6/datagridfield-1-6-0-beta2-tar.gz