Blob Blame History Raw
%global pkgname sievelib

Name:           python-%{pkgname}
Version:        0.8
Release:        3%{?dist}
Summary:        Client-side SIEVE library

Group:          Development/Languages
License:        MIT
URL:            https://github.com/tonioo/sievelib
Source:         https://pypi.python.org/packages/source/s/%{pkgname}/%{pkgname}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel 
BuildRequires:  python-setuptools

%description
Client-side Sieve and Managesieve library written in Python.
* Sieve : An Email Filtering Language (RFC 5228)
* ManageSieve : A Protocol for Remotely Managing Sieve Scripts (RFC 5804)


%prep
%setup -qn %{pkgname}-%{version}
# remove bundled egg-info
rm -rf %{pkgname}.egg-info


%build
%{__python2} setup.py build

%install
%{__python2} setup.py install --skip-build --root %{buildroot}
# Remove shebang from libraries
for lib in %{buildroot}%{python2_sitelib}/%{pkgname}/*.py; do
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
 touch -r $lib $lib.new &&
 mv $lib.new $lib
done


%files
%doc README.rst PKG-INFO
%license COPYING
%{python2_sitelib}/%{pkgname}
%{python2_sitelib}/%{pkgname}-%{version}-py*.egg-info

%changelog
* Thu Apr 09 2015 Juan Orti Alcaine <jorti@fedoraproject.org> - 0.8-3
- Use license macro

* Wed Dec 03 2014 Juan Orti <jorti@fedoraproject.org> - 0.8-2
- Remove python shebang from libraries
- Change URL to GitHub
- Include license file

* Tue Dec 02 2014 Juan Orti <jorti@fedoraproject.org> - 0.8-1
- Spec file cleanup

* Sat May 24 2014 Didier Fabert <didier.fabert@gmail.com> 0.0.4-1
- Initial RPM release