File python-baruwa.spec of Package python-baruwa

#
# spec file for package python-baruwa
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           python-baruwa
Version:        2.0.1
Release:        0
Url:            http://www.topdog.za.net/baruwa
Summary:        Ajax enabled MailScanner web frontend
License:        GPL-2.0+
Group:          Development/Libraries/Python
Source:         baruwa-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  fdupes
BuildRequires:  python-PasteScript
BuildRequires:  python-devel
BuildRequires:  python-setuptools
Requires:       cron
Requires:       python-GeoIP
Requires:       python-PasteScript
Requires:       python-django
Requires:       python-django-south
Requires:       python-ipy
Requires:       python-lxml
Requires:       python-mysql
Requires:       python-python-dateutil
Requires:       python-reportlab
Requires:       python-uuid
Recommends:     %{name}-lang
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
Baruwa (swahili for letter or mail) is a mailwatch inspired MailScanner front-end.
It provides an easy to use interface for users to view details of messages processed
by MailScanner as well as perform operations such as releasing quarantined messages,
spam learning,whitelisting and blacklisting addresses etc. Baruwa has implemented
web 2.0 features (AJAX) where deemed fit, graphing is also implemented on the client
side using SVG.
It also provides reporting functionality with an easy to use query builder, results
can be displayed as message lists or graphed as colorful and pretty graphs. The goal
of the initial version will be to address the various quarks that exist in mailwatch
at the moment. Baruwa will initially be a drop in replacement for mailwatch, future
releases will however break compatibility with mailwatch. This enables easing of
end users in to the new interface.

%lang_package

%prep
%setup -q -n baruwa-%{version}

%{__cat} <<'EOF' > baruwa.cron
#!/bin/sh
#
# %{name} - %{version}
#

# send quarantine reports
%{python_sitelib}/%{name}/manage.py sendquarantinereports
# clean quarantine 
%{python_sitelib}/%{name}/manage.py cleanquarantine
# clean up the DB
%{python_sitelib}/%{name}/manage.py dbclean
# update sa rule definitions
%{python_sitelib}/%{name}/manage.py updatesarules
# clean up stale sessions
%{python_sitelib}/%{name}/manage.py cleanup
# update geoip database
perl /usr/share/doc/GeoIP-*/fetch-geoipdata.pl
EOF

%build
CFLAGS="%{optflags}" python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%{__install} -D -m 0755 baruwa.cron %{buildroot}%{_sysconfdir}/cron.daily/baruwa
rm %{buildroot}%{python_sitelib}/baruwa/public/js/baruwa/.gitignore
%fdupes -s %{buildroot}%{python_sitelib}/*

%files
%defattr(-,root,root,-)
%{_bindir}/eximqf2mbox.py
%{_bindir}/import-mbox.py
%{_bindir}/test-smtpauth.py
%{_sysconfdir}/cron.daily/baruwa
%{python_sitelib}/*
%exclude %{python_sitelib}/baruwa/i18n

%files lang
%defattr(-,root,root,-)
%{python_sitelib}/baruwa/i18n

%changelog
openSUSE Build Service is sponsored by