--- a/__pkginfo__.py Fri Oct 15 19:50:34 2010 +0200
+++ b/__pkginfo__.py Fri Oct 15 19:51:01 2010 +0200
@@ -96,7 +96,13 @@
else:
pydir = join('python' + _pyversion, 'site-packages')
+# data files that shall be copied into the main package directory
+package_data = {
+ 'cubicweb.web.views':['*.pt'],
+ }
+
try:
+ # data files that shall be copied outside the main package directory
data_files = [
# server data
[join('share', 'cubicweb', 'schemas'),
@@ -119,10 +125,6 @@
[join(_wdocimages_dir, fname) for fname in listdir(_wdocimages_dir)]],
[join('share', 'cubicweb', 'cubes', 'shared', 'i18n'),
[join(_i18n_dir, fname) for fname in listdir(_i18n_dir)]],
- # XXX: drop .pt files
- [join('lib', pydir, 'cubicweb', 'web', 'views'),
- [join(_views_dir, fname) for fname in listdir(_views_dir)
- if fname.endswith('.pt')]],
# skeleton
]
except OSError:
--- a/cwctl.py Fri Oct 15 19:50:34 2010 +0200
+++ b/cwctl.py Fri Oct 15 19:51:01 2010 +0200
@@ -63,7 +63,10 @@
raise ExecutionError('can\'t kill process %s' % pid)
def list_instances(regdir):
- return sorted(idir for idir in listdir(regdir) if isdir(join(regdir, idir)))
+ if isdir(regdir):
+ return sorted(idir for idir in listdir(regdir) if isdir(join(regdir, idir)))
+ else:
+ return []
def detect_available_modes(templdir):
modes = []
--- a/debian/control Fri Oct 15 19:50:34 2010 +0200
+++ b/debian/control Fri Oct 15 19:51:01 2010 +0200
@@ -7,7 +7,7 @@
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>,
Aurélien Campéas <aurelien.campeas@logilab.fr>,
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
-Build-Depends: debhelper (>= 5), python-dev (>=2.5), python-central (>= 0.5)
+Build-Depends: debhelper (>= 5), python-dev (>=2.5), python-central (>= 0.5), python-sphinx, logilab-doctools
Standards-Version: 3.8.0
Homepage: http://www.cubicweb.org
XS-Python-Version: >= 2.5, << 2.7
--- a/debian/cubicweb-common.install.in Fri Oct 15 19:50:34 2010 +0200
+++ b/debian/cubicweb-common.install.in Fri Oct 15 19:51:01 2010 +0200
@@ -1,5 +1,5 @@
debian/tmp/usr/lib/PY_VERSION/site-packages/cubicweb/common/ usr/lib/PY_VERSION/site-packages/cubicweb
debian/tmp/usr/lib/PY_VERSION/site-packages/cubicweb/entities/ usr/lib/PY_VERSION/site-packages/cubicweb
debian/tmp/usr/lib/PY_VERSION/site-packages/cubicweb/ext/ usr/lib/PY_VERSION/site-packages/cubicweb
-debian/tmp/usr/share/cubicweb/cubes/shared/i18n usr/share/cubicweb/cubes/shared/
+debian/tmp/usr/share/cubicweb/cubes/ usr/share/cubicweb/
debian/tmp/usr/lib/PY_VERSION/site-packages/cubicweb/*.py usr/share/pyshared/cubicweb
--- a/debian/cubicweb-documentation.install.in Fri Oct 15 19:50:34 2010 +0200
+++ b/debian/cubicweb-documentation.install.in Fri Oct 15 19:51:01 2010 +0200
@@ -1,2 +1,1 @@
-doc/book usr/share/doc/cubicweb-documentation
debian/cubicweb-doc usr/share/doc-base/cubicweb-doc
--- a/debian/rules Fri Oct 15 19:50:34 2010 +0200
+++ b/debian/rules Fri Oct 15 19:51:01 2010 +0200
@@ -38,6 +38,8 @@
# Put all the python library and data in cubicweb-common
# and scripts in cubicweb-server
+ # build doc
+ BUILDDIR=${PWD}/debian/tmp/cubicweb-book/en make -e -C doc/book/en html
dh_install -vi
# cwctl in the cubicweb-ctl package
rm -f debian/cubicweb-common/usr/share/pyshared/cubicweb/cwctl.py
@@ -53,8 +55,6 @@
rm -rf debian/cubicweb-common/usr/lib/${PY_VERSION}/site-packages/cubicweb/ext/test
rm -rf debian/cubicweb-common/usr/lib/${PY_VERSION}/site-packages/cubicweb/entities/test
- # cubes directory must be managed as a valid python module
- touch debian/cubicweb-common/usr/share/cubicweb/cubes/__init__.py
%: %.in
sed "s/PY_VERSION/${PY_VERSION}/g" < $< > $@
--- a/devtools/qunit.py Fri Oct 15 19:50:34 2010 +0200
+++ b/devtools/qunit.py Fri Oct 15 19:51:01 2010 +0200
@@ -11,6 +11,7 @@
from logilab.common.testlib import unittest_main, with_tempdir, InnerTest
import os
+from os.path import expanduser
import cubicweb
from cubicweb.view import StartupView
from cubicweb.web.controller import Controller
@@ -53,15 +54,19 @@
stdout = TemporaryFile()
stderr = TemporaryFile()
try:
- check_call(['firefox', '-no-remote', '-CreateProfile',
- '%s %s' % (self._profile_name, self._tmp_dir)],
- stdout=stdout, stderr=stderr)
+ home = expanduser('~')
+ user = os.getlogin()
+ assert os.access(home, os.W_OK), \
+ 'No write access to your home directory, Firefox will crash.'\
+ ' Are you sure "%s" is a valid home for user "%s"' % (home, user)
+ check_call(['firefox', '-no-remote', '-CreateProfile',
+ '%s %s' % (self._profile_name, self._tmp_dir)],
+ stdout=stdout, stderr=stderr)
except CalledProcessError, cpe:
stdout.seek(0)
stderr.seek(0)
raise VerboseCalledProcessError(cpe.returncode, cpe.cmd, stdout.read(), stderr.read())
-
def start(self, url):
self.stop()
fnull = open(os.devnull, 'w')
--- a/doc/book/en/conf.py Fri Oct 15 19:50:34 2010 +0200
+++ b/doc/book/en/conf.py Fri Oct 15 19:51:01 2010 +0200
@@ -32,8 +32,16 @@
# serve to show the default value.
import sys, os
+from os import path as osp
-from cubicweb import __pkginfo__ as cw
+path = __file__
+path = osp.dirname(path) #./doc/book/en
+path = osp.dirname(path) #./doc/book/
+path = osp.dirname(path) #./doc/
+path = osp.dirname(path) #./
+path = osp.join(path,'__pkginfo__.py') #./__pkginfo__.py
+cw = {}
+execfile(path,{},cw)
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
@@ -64,9 +72,9 @@
# other places throughout the built documents.
#
# The short X.Y version.
-version = '.'.join(str(n) for n in cw.numversion[:2])
+version = '.'.join(str(n) for n in cw['numversion'][:2])
# The full version, including alpha/beta/rc tags.
-release = cw.version
+release = cw['version']
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
--- a/setup.py Fri Oct 15 19:50:34 2010 +0200
+++ b/setup.py Fri Oct 15 19:51:01 2010 +0200
@@ -36,6 +36,7 @@
from distutils.core import setup
from distutils.command import install_lib
USE_SETUPTOOLS = False
+from distutils.command import install_data
# import required features
from __pkginfo__ import modname, version, license, description, web, \
@@ -60,7 +61,7 @@
data_files = getattr(__pkginfo__, 'data_files', None)
subpackage_of = getattr(__pkginfo__, 'subpackage_of', None)
ext_modules = getattr(__pkginfo__, 'ext_modules', None)
-
+package_data = getattr(__pkginfo__, 'package_data', {})
BASE_BLACKLIST = ('CVS', 'debian', 'dist', 'build', '__buildlog')
IGNORED_EXTENSIONS = ('.pyc', '.pyo', '.elc')
@@ -163,6 +164,45 @@
dest = join(self.install_dir, base, directory)
export(directory, dest, verbose=False)
+# write required share/cubicweb/cubes/__init__.py
+class MyInstallData(install_data.install_data):
+ """A class That manages data files installation"""
+ def run(self):
+ """overridden from install_data class"""
+ install_data.install_data.run(self)
+ path = join(self.install_dir, 'share', 'cubicweb', 'cubes', '__init__.py')
+ ini = open(path, 'w')
+ ini.write('# Cubicweb cubes directory\n')
+ ini.close()
+
+# re-enable copying data files in sys.prefix
+if USE_SETUPTOOLS:
+ # overwrite MyInstallData to use sys.prefix instead of the egg directory
+ MyInstallMoreData = MyInstallData
+ class MyInstallData(MyInstallMoreData):
+ """A class that manages data files installation"""
+ def run(self):
+ _old_install_dir = self.install_dir
+ if self.install_dir.endswith('egg'):
+ self.install_dir = sys.prefix
+ MyInstallMoreData.run(self)
+ self.install_dir = _old_install_dir
+ try:
+ import setuptools.command.easy_install # only if easy_install avaible
+ # monkey patch: Crack SandboxViolation verification
+ from setuptools.sandbox import DirectorySandbox as DS
+ old_ok = DS._ok
+ def _ok(self, path):
+ """Return True if ``path`` can be written during installation."""
+ out = old_ok(self, path)
+ realpath = os.path.normcase(os.path.realpath(path))
+ if realpath.startswith(sys.prefix):
+ out = True
+ return out
+ DS._ok = _ok
+ except ImportError:
+ pass
+
def install(**kwargs):
"""setup entry point"""
if USE_SETUPTOOLS:
@@ -183,12 +223,14 @@
if USE_SETUPTOOLS:
kwargs['install_requires'] = install_requires
kwargs['packages'] = packages
+ kwargs['package_data'] = package_data
return setup(name=distname, version=version, license=license, url=web,
description=description, long_description=long_description,
author=author, author_email=author_email,
scripts=ensure_scripts(scripts), data_files=data_files,
ext_modules=ext_modules,
- cmdclass={'install_lib': MyInstallLib},
+ cmdclass={'install_lib': MyInstallLib,
+ 'install_data': MyInstallData},
**kwargs
)