Commit 803b32b7 authored by Adrien Di Mascio's avatar Adrien Di Mascio
Browse files

[pkg] new-style cube packaging

parent 6401affb0d06
include *.py include setup.py
include */*.py include README
recursive-include data *.gif *.png *.ico *.css *.js recursive-include cubicweb_awstats/data *.gif *.png *.ico *.css *.js
recursive-include i18n *.po recursive-include cubicweb_awstats/i18n *.po
recursive-include wdoc * include tox.ini
...@@ -35,7 +35,7 @@ find . -name '*.py' -type f -print0 | xargs -0 sed -i '1,3s;^#!.*python.*$;#! / ...@@ -35,7 +35,7 @@ find . -name '*.py' -type f -print0 | xargs -0 sed -i '1,3s;^#!.*python.*$;#! /
%endif %endif
%install %install
NO_SETUPTOOLS=1 %{__python} setup.py --quiet install --no-compile --prefix=%{_prefix} --root="$RPM_BUILD_ROOT" %{__python} setup.py --quiet install --no-compile --prefix=%{_prefix} --root="$RPM_BUILD_ROOT"
# remove generated .egg-info file # remove generated .egg-info file
rm -rf $RPM_BUILD_ROOT/usr/lib/python* rm -rf $RPM_BUILD_ROOT/usr/lib/python*
...@@ -45,4 +45,3 @@ rm -rf $RPM_BUILD_ROOT ...@@ -45,4 +45,3 @@ rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-, root, root) %defattr(-, root, root)
%{_prefix}/share/cubicweb*
...@@ -4,17 +4,20 @@ ...@@ -4,17 +4,20 @@
modname = 'awstats' modname = 'awstats'
distname = 'cubicweb-awstats' distname = 'cubicweb-awstats'
numversion = (0, 2, 0) numversion = (0, 3, 0)
version = '.'.join(str(num) for num in numversion) version = '.'.join(str(num) for num in numversion)
license = 'LGPL' license = 'LGPL'
author = 'LOGILAB S.A. (Paris, FRANCE)' author = 'LOGILAB S.A. (Paris, FRANCE)'
author_email = 'contact@logilab.fr' author_email = 'contact@logilab.fr'
description = 'cubicweb integrated awstats frontend' description = 'cubicweb integrated awstats frontend'
web = 'http://www.cubicweb.org/project/%s' % distname web = 'https://www.cubicweb.org/project/%s' % distname
__depends__ = {'cubicweb': '>= 3.20.0',} __depends__ = {
__recommends__ = {'cubicweb-raphael': None,} 'cubicweb': '>= 3.24.0',
'six': None,
}
__recommends__ = {'cubicweb-raphael': None}
classifiers = [ classifiers = [
'Environment :: Web Environment', 'Environment :: Web Environment',
...@@ -22,27 +25,3 @@ classifiers = [ ...@@ -22,27 +25,3 @@ classifiers = [
'Programming Language :: Python', 'Programming Language :: Python',
'Programming Language :: JavaScript', 'Programming Language :: JavaScript',
] ]
from os import listdir as _listdir
from os.path import join, isdir, exists
from glob import glob
THIS_CUBE_DIR = join('share', 'cubicweb', 'cubes', modname)
def listdir(dirpath):
return [join(dirpath, fname) for fname in _listdir(dirpath)
if fname[0] != '.' and not fname.endswith('.pyc')
and not fname.endswith('~')
and not isdir(join(dirpath, fname))]
data_files = [
# common files
[THIS_CUBE_DIR, [fname for fname in glob('*.py') if fname != 'setup.py']],
]
# check for possible extended cube layout
for dname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', 'wdoc', 'i18n', 'migration'):
if isdir(dname):
data_files.append([join(THIS_CUBE_DIR, dname), listdir(dname)])
# Note: here, you'll need to add subdirectories if you want
# them to be included in the debian package
...@@ -30,12 +30,13 @@ try: ...@@ -30,12 +30,13 @@ try:
from cubicweb import _ from cubicweb import _
except ImportError: except ImportError:
_ = unicode _ = unicode
from cubicweb.view import StartupView from cubicweb.view import StartupView
from cubicweb.web.views import forms from cubicweb.web.views import forms
from cubicweb.web.formfields import StringField, DateField from cubicweb.web.formfields import StringField, DateField
from cubicweb.web import formwidgets as fwdgs, httpcache from cubicweb.web import formwidgets as fwdgs, httpcache
from cubes.awstats.utils import SECTIONSPEC, SECTIONLABELS, \ from cubicweb_awstats.utils import SECTIONSPEC, SECTIONLABELS, \
extract_stats_dict, ORIGIN_LABELS extract_stats_dict, ORIGIN_LABELS
def extract_available_time_periods(form, **attrs): def extract_available_time_periods(form, **attrs):
......
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