Commit 3aa8b37c authored by Łukasz Nowak's avatar Łukasz Nowak

- initialise development of standalone Zope instance recipe


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32505 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b06edc18
Changelog
=========
0.1 (2010-02-12)
----------------
- intial version
[luke]
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.
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]},
)
# 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__)
# 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__)
# -*- 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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment