diff --git a/buildout/recipes/erp5.recipe.standaloneinstance/CHANGES.txt b/buildout/recipes/erp5.recipe.standaloneinstance/CHANGES.txt new file mode 100644 index 0000000000000000000000000000000000000000..df67cd5236b15db5eec39054937df3769e53a090 --- /dev/null +++ b/buildout/recipes/erp5.recipe.standaloneinstance/CHANGES.txt @@ -0,0 +1,8 @@ +Changelog +========= + +0.1 (2010-02-12) +---------------- + + - intial version + [luke] diff --git a/buildout/recipes/erp5.recipe.standaloneinstance/README.txt b/buildout/recipes/erp5.recipe.standaloneinstance/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..57a07d31c6987ce62406c3633c7097718e311ee3 --- /dev/null +++ b/buildout/recipes/erp5.recipe.standaloneinstance/README.txt @@ -0,0 +1,19 @@ +Zope standalone instance +======================== + +This recipe is useful to create standalone Zope instance independent from +buildout tree. + +Specification +============= + +This recipe shall provide safe instance creation and updating. It shall mix +Zope level instance creation with ERP5 site bootstrap (erp5.recipe.zope2install ++ erp5.recipe.createsite). On update only filesystem will be *safely* updated +without touch user produced data (mostly from ZODB). + +DISCLAIMER +========== +Until some stability will be met everything can change without any further +notice, without backward compatibility, possibly with *removing* existing data +produced by previous versions. diff --git a/buildout/recipes/erp5.recipe.standaloneinstance/setup.py b/buildout/recipes/erp5.recipe.standaloneinstance/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..54cd8f7bf8fd243c90f398a56ab8390693427016 --- /dev/null +++ b/buildout/recipes/erp5.recipe.standaloneinstance/setup.py @@ -0,0 +1,38 @@ +from setuptools import setup, find_packages + +name = "erp5.recipe.standaloneinstance" +version = '0.1' + +def read(name): + return open(name).read() + +long_description=( + read('README.txt') + + '\n' + + read('CHANGES.txt') + ) + +setup( + name = name, + version = version, + author = "Lukasz Nowak", + author_email = "luke@nexedi.com", + description = "ZC Buildout recipe to install standalone instance", + long_description=long_description, + license = "ZPL 2.1", + keywords = "zope2 buildout", + classifiers=[ + "License :: OSI Approved :: Zope Public License", + "Framework :: Buildout", + "Framework :: Zope2", + ], + packages = find_packages('src'), + include_package_data = True, + package_dir = {'':'src'}, + namespace_packages = ['erp5', 'erp5.recipe'], + install_requires = [ + 'erp5.recipe.zope2instance', + ], + zip_safe=False, + entry_points = {'zc.buildout': ['default = %s:Recipe' % name]}, + ) diff --git a/buildout/recipes/erp5.recipe.standaloneinstance/src/erp5/__init__.py b/buildout/recipes/erp5.recipe.standaloneinstance/src/erp5/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f48ad10528712b2b8960f1863d156b88ed1ce311 --- /dev/null +++ b/buildout/recipes/erp5.recipe.standaloneinstance/src/erp5/__init__.py @@ -0,0 +1,6 @@ +# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) diff --git a/buildout/recipes/erp5.recipe.standaloneinstance/src/erp5/recipe/__init__.py b/buildout/recipes/erp5.recipe.standaloneinstance/src/erp5/recipe/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f48ad10528712b2b8960f1863d156b88ed1ce311 --- /dev/null +++ b/buildout/recipes/erp5.recipe.standaloneinstance/src/erp5/recipe/__init__.py @@ -0,0 +1,6 @@ +# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) diff --git a/buildout/recipes/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/__init__.py b/buildout/recipes/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f993c5a599d35e59eadb59bd126070aa47e80d85 --- /dev/null +++ b/buildout/recipes/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/__init__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +import os +import zc.buildout +import erp5.recipe.zope2instance + +class Recipe(erp5.recipe.zope2instance.Recipe): + def __init__(self, buildout, name, options): + self.egg = zc.recipe.egg.Egg(buildout, options['recipe'], options) + self.buildout, self.options, self.name = buildout, options, name + self.zope2_location = options.get('zope2-location', '') + + standalone_location = options.get('location') + if not standalone_location: + raise zc.buildout.UserError('Location have to be specified') + options['bin-directory'] = os.path.join(standalone_location, 'bin') + options['scripts'] = '' # suppress script generation. + + # Relative path support for the generated scripts + relative_paths = options.get( + 'relative-paths', + buildout['buildout'].get('relative-paths', 'false') + ) + if relative_paths == 'true': + options['buildout-directory'] = buildout['buildout']['directory'] + self._relative_paths = options['buildout-directory'] + else: + self._relative_paths = '' + assert relative_paths == 'false' + + def install(self): + erp5.recipe.zope2instance.Recipe.install(self) + # we return nothing, as this is totally standalone installation + return [] + + def build_zope_conf(self): + # preparation for further fixing (chroot everything inside instance, etc) + erp5.recipe.zope2instance.Recipe.build_zope_conf(self)