Hello community, here is the log from the commit of package prewikka for openSUSE:Factory checked in at 2017-11-13 13:59:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/prewikka (Old) and /work/SRC/openSUSE:Factory/.prewikka.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "prewikka" Mon Nov 13 13:59:46 2017 rev:4 rq:538198 version:4.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/prewikka/prewikka.changes 2017-03-24 02:21:53.406064971 +0100 +++ /work/SRC/openSUSE:Factory/.prewikka.new/prewikka.changes 2017-11-13 14:00:00.542934949 +0100 @@ -1,0 +2,12 @@ +Wed Oct 04 07:00:00 UTC 2017 - thomas.andre...@gmail.com + +- Update to 4.0.0 +- Create python2-prewikka and python3-prewikka + packages since prewikka is python 3 compatible +- Move to Python Singlespec +- Remove patch prewikka-ez_setup.patch because we can only be + compatible with Factory/Tumbleweed because of Python Singlespec +- Add patch prewikka-fix_python3.patch to make prewikka fully + compatible with Python 3 + +------------------------------------------------------------------- Old: ---- prewikka-3.1.0.tar.gz prewikka-ez_setup.patch New: ---- prewikka-4.0.0.tar.gz prewikka-fix_python3.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ prewikka.spec ++++++ --- /var/tmp/diff_new_pack.FTZOK8/_old 2017-11-13 14:00:01.138913525 +0100 +++ /var/tmp/diff_new_pack.FTZOK8/_new 2017-11-13 14:00:01.142913381 +0100 @@ -16,36 +16,60 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} + Name: prewikka -Version: 3.1.0 +Version: 4.0.0 Release: 0 Summary: Graphical front-end analysis console for the Prelude Framework License: GPL-2.0+ Group: Productivity/Networking/Web/Frontends Url: https://www.prelude-siem.org Source0: https://www.prelude-siem.org/pkg/src/%{version}/%{name}-%{version}.tar.gz -# Backport ez_setup to be compatible with old (Open)SuSE -Patch0: prewikka-ez_setup.patch +Patch0: prewikka-fix_python3.patch +BuildRequires: %{python_module Babel} +BuildRequires: %{python_module lesscpy} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes BuildRequires: gettext -BuildRequires: python-cheetah BuildRequires: python-devel -BuildRequires: python-lesscpy -BuildRequires: python-setuptools -Requires: python-babel -Requires: python-cheetah -Requires: python-dateutil +BuildRequires: python-rpm-macros +BuildRequires: python3-devel +Requires: prewikka-core >= %{version} +Requires: prewikka-lang >= %{version} +Requires: python-Babel +Requires: python-Mako +Requires: python-PyYAML +Requires: python-Werkzeug Requires: python-libprelude Requires: python-libpreludedb +Requires: python-python-dateutil Requires: python-pytz Requires: xorg-x11-fonts BuildArch: noarch +%python_subpackages + %description Prewikka is the graphical front-end analysis console for the Prelude Universal SIM. Prewikka provides alert aggregation and sensor and hearbeat views, and has user management and configurable filters, as well as access to external tools such as whois and traceroute. +%package core +Summary: Prewikka core files +Group: Productivity/Networking/Web/Frontends + +%description core +Core files for prewikka. + +%package lang +Summary: Prewikka lang files +Group: Productivity/Networking/Web/Frontends + +%description lang +Lang files for prewikka. + %prep %setup -q %patch0 @@ -53,21 +77,42 @@ %build %install -python setup.py install -O1 --root=%{buildroot} +install -d -m 0755 %{buildroot}%{_sbindir} + +%{python_expand $python setup.py install -O1 --force --root %{buildroot} +mv %{buildroot}%{_bindir}/%{name}-httpd %{buildroot}%{_sbindir}/%{name}-httpd-%{$python_bin_suffix} +%fdupes %{buildroot}%{$python_sitelib}/prewikka +} + +ln -s ./%{name}-httpd-%{python3_bin_suffix} %{buildroot}%{_sbindir}/%{name}-httpd + +install -d -m 0755 %{buildroot}%{_datadir}/locale +cp -r %{buildroot}%{python2_sitelib}/%{name}/locale/* %{buildroot}%{_datadir}/locale/ +rm -rf %{buildroot}%{python2_sitelib}/%{name}/locale +rm -rf %{buildroot}%{python3_sitelib}/%{name}/locale +ln -s %{_datadir}/locale %{buildroot}%{python2_sitelib}/%{name}/locale +ln -s %{_datadir}/locale %{buildroot}%{python3_sitelib}/%{name}/locale + +rm %{buildroot}%{_sysconfdir}/%{name}/*-dist + mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-%{version} -mkdir -p %{buildroot}%{_sbindir}/ -mv %{buildroot}/%{_bindir}/%{name}-httpd %{buildroot}/%{_sbindir}/%{name}-httpd -find %{buildroot} -type f -name '*.pyo' -delete + %find_lang %{name} --with-python -%files -f %{name}.lang +%files -n %{name}-core %defattr(-, root, root, -) %attr(0750, -,-) %dir %{_sysconfdir}/%{name}/ %config(noreplace) %attr(0640, -,-) %{_sysconfdir}/%{name}/%{name}.conf +%config(noreplace) %attr(0640, -,-) %{_sysconfdir}/%{name}/menu.yml %{_datadir}/%{name} -%{_sbindir}/%{name}-httpd -%{python_sitelib}/%{name}/ -%{python_sitelib}/%{name}*.egg-info %doc COPYING* AUTHORS README NEWS HACKING.README +%files -n %{name}-lang -f %{name}.lang + +%files %python_files +%{python_sitelib}/prewikka/ +%{python_sitelib}/prewikka*.egg-info +%{_sbindir}/prewikka-httpd-%{python_bin_suffix} +%python3_only %{_sbindir}/prewikka-httpd + %changelog ++++++ prewikka-3.1.0.tar.gz -> prewikka-4.0.0.tar.gz ++++++ ++++ 55520 lines of diff (skipped) ++++++ prewikka-fix_python3.patch ++++++ From: Thomas Andrejak <thomas.andre...@gmail.com> Date: 2017-10-04 23:25:00 +0100 References: no Upstream: no Subject: Python 3 compatibility --- prewikka/dataprovider/__init__.py 2017-07-18 13:45:57.000000000 +0200 +++ prewikka/dataprovider/__init__.py 2017-10-07 17:10:09.140721871 +0200 @@ -22,12 +22,15 @@ import copy import time import types +import sys from datetime import datetime from prewikka import error, hookmanager, pluginmanager from prewikka.utils import AttrObj, CachingIterator, compat, json from prewikka.utils.timeutil import parser +if sys.version_info >= (3, 0): + long = int def _str_to_datetime(date): if date.isdigit(): --- prewikka/session/session.py 2017-07-18 13:45:57.000000000 +0200 +++ prewikka/session/session.py 2017-10-07 17:13:02.224865916 +0200 @@ -23,6 +23,7 @@ import os import struct import time +import sys from prewikka import database, hookmanager, log, pluginmanager, usergroup, utils from prewikka.error import PrewikkaUserError, RedirectionError @@ -137,7 +138,11 @@ t = time.time() self._db.delete_expired_sessions(t - self._expiration) - sessionid = text_type(binascii.hexlify(os.urandom(16) + struct.pack(b">d", t))) + sessionid = binascii.hexlify(os.urandom(16) + struct.pack(b">d", t)) + if sys.version_info >= (3, 0): + sessionid = sessionid.decode('ascii') + + sessionid = text_type(sessionid) self._db.create_session(sessionid, user, int(t)) self.__set_session(request, sessionid) --- prewikka/utils/json.py 2017-07-18 13:45:57.000000000 +0200 +++ prewikka/utils/json.py 2017-10-07 17:14:59.718248149 +0200 @@ -21,6 +21,7 @@ import datetime import json +from six import with_metaclass from prewikka.utils import html @@ -36,8 +37,7 @@ return nclass -class JSONObject(object): - __metaclass__ = _JSONMetaClass +class JSONObject(with_metaclass(_JSONMetaClass, object)): def __jsonobj__(self): return { "__prewikka_class__": (self.__class__.__name__, self.__json__()) } --- prewikka/utils/url.py 2017-07-18 13:45:57.000000000 +0200 +++ prewikka/utils/url.py 2017-10-07 17:16:41.927970738 +0200 @@ -56,7 +56,11 @@ else: authority = tpl[0].encode('idna') + ":%s" % tpl[1] - return urlunsplit((scheme.encode(encoding), authority, + sc = scheme.encode(encoding) + if sys.version_info >= (3, 0): + sc = quote(sc, safe) + + return urlunsplit((sc, authority, quote(path.encode(encoding), safe), quote(query.encode(encoding), safe), quote(frag.encode(encoding), safe))) --- prewikka/web/request.py 2017-07-18 13:45:57.000000000 +0200 +++ prewikka/web/request.py 2017-10-07 17:21:21.645737400 +0200 @@ -40,7 +40,11 @@ self._buffersize = buffersize def flush(self): - self._wcb(''.join(self._dlist)) + if sys.version_info >= (3, 0): + self._wcb(''.join((x.decode('utf-8') for x in self._dlist)).encode('utf-8')) + else: + self._wcb(''.join(self._dlist)) + self._dlist = [] self._len = 0 @@ -97,10 +101,16 @@ # Join is used in place of concatenation / formatting, because we # prefer performance over readability in this place if event: - self._buffer.write("".join(["event: ", event.encode("utf8"), "\n"])) + if sys.version_info >= (3, 0): + self._buffer.write("".join(["event: ", text_type(event), "\n"]).encode("utf8")) + else: + self._buffer.write("".join(["event: ", event.encode('utf-8'), "\n"])) if data: - self._buffer.write("".join(["data: ", data.encode("utf8"), "\n\n"])) + if sys.version_info >= (3, 0): + self._buffer.write("".join(["data: ", text_type(data), "\n\n"]).encode("utf8")) + else: + self._buffer.write("".join(["data: ", data.encode('utf-8'), "\n\n"])) if sync: self._buffer.flush()