Blob Blame History Raw
%global with_python3 1

Name:           python-icalendar
Version:        3.9.0
Release:        4%{?dist}
Summary:        Parser/generator of iCalendar files following the RFC 2445

License:        BSD
URL:            http://pypi.python.org/pypi/icalendar
Source0:        https://github.com/collective/icalendar/archive/%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  pytz
BuildRequires:  python-dateutil
BuildRequires:  python-tox
BuildRequires:  python-pip
%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pip
BuildRequires:  python3-pytz
BuildRequires:  python3-dateutil
%endif # if with_python3

Requires:       pytz
Requires:       python-dateutil

%description
iCalendar specification (RFC 2445) defines calendaring format used
by many applications (Zimbra, Thunderbird and others). This
module is a parser/generator of iCalendar files for use with
Python. It follows the RFC 2445 (iCalendar) specification.
The aim is to make a package that is fully compliant with RFC 2445,
well designed, simple to use and well documented.


%if 0%{?with_python3}
%package -n python3-icalendar
Summary:        Parser/generator of iCalendar files following the RFC 2445 for Python 3
Requires:       python3-pytz
Requires:       python3-dateutil

%description -n python3-icalendar
Setuptools is a collection of enhancements to the Python 3 distutils that allow
you to more easily build and distribute Python 3 packages, especially ones that
have dependencies on other packages.

This package contains the runtime components of setuptools, necessary to
execute the software that requires pkg_resources.py.
%endif # with_python3

%prep
%setup -q -n icalendar-%{version}%{?veradd}

# we have only 2.7 and 3.3
sed -i 's/py26,//' tox.ini

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3

%build
%{__python} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3

%install
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
popd
%endif # with_python3


#check
# commented out because tox tries to download stuff which doesn't work on koji
# We need to define locale for tests otherwise python3-pip fails to decode
# because it assumes ascii files
#LC_ALL=en_US.UTF-8 tox

%files
%doc README.rst CHANGES.rst LICENSE.rst
%{python_sitelib}/icalendar
%{python_sitelib}/*.egg-info

%if 0%{?with_python3}
%files -n python3-icalendar
%doc README.rst CHANGES.rst LICENSE.rst
%{python3_sitelib}/icalendar
%{python3_sitelib}/*.egg-info
%endif # with_python3

%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Mar 28 2015 Jon Ciesla <limburgher@gmail.com> - 3.9.0-1
- Latest upstream, BZ 1206758.

* Tue Jan 20 2015 Jon Ciesla <limburgher@gmail.com> - 3.8.4-1
- Latest upstream.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.6.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 3.6.2-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Thu Apr 24 2014 Jon Ciesla <limburgher@gmail.com> - 3.6.2-1
- Latest upstream.

* Tue Jan 07 2014 Stanislav Ochotnicky <sochotnicky@rdhat.com> - 3.6.1-1
- Update to latest upstream
- Add python3 subpackage

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu May 30 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.4-2
- Install LICENSE file as well

* Thu May 30 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.4-1
- Update to latest upstream version (#824323)

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.1-0.3.b2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.1-0.2.b2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Wed May 30 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0.1-0.1.b2
- Update to 3.0b2
- Change license to BSD (see https://github.com/collective/icalendar/issues/2)

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Aug  5 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.1-3
- Install examples
- Fix tests for Python 2.7 and run them
- Add GPLv2 for parser.py to licenses

* Wed Aug  4 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.1-2
- State correct licenses

* Tue Aug  3 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.1-1
- Initial package version