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

[pkg] new-style cube packaging

parent 6401affb0d06
include *.py
include */*.py
recursive-include data *.gif *.png *.ico *.css *.js
recursive-include i18n *.po
recursive-include wdoc *
include setup.py
include README
recursive-include cubicweb_awstats/data *.gif *.png *.ico *.css *.js
recursive-include cubicweb_awstats/i18n *.po
include tox.ini
......@@ -35,7 +35,7 @@ find . -name '*.py' -type f -print0 | xargs -0 sed -i '1,3s;^#!.*python.*$;#! /
%endif
%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
rm -rf $RPM_BUILD_ROOT/usr/lib/python*
......@@ -45,4 +45,3 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%{_prefix}/share/cubicweb*
......@@ -4,17 +4,20 @@
modname = 'awstats'
distname = 'cubicweb-awstats'
numversion = (0, 2, 0)
numversion = (0, 3, 0)
version = '.'.join(str(num) for num in numversion)
license = 'LGPL'
author = 'LOGILAB S.A. (Paris, FRANCE)'
author_email = 'contact@logilab.fr'
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',}
__recommends__ = {'cubicweb-raphael': None,}
__depends__ = {
'cubicweb': '>= 3.24.0',
'six': None,
}
__recommends__ = {'cubicweb-raphael': None}
classifiers = [
'Environment :: Web Environment',
......@@ -22,27 +25,3 @@ classifiers = [
'Programming Language :: Python',
'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:
from cubicweb import _
except ImportError:
_ = unicode
from cubicweb.view import StartupView
from cubicweb.web.views import forms
from cubicweb.web.formfields import StringField, DateField
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
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