Blob Blame History Raw
%global pypi_name pelican
%{!?__python2:%global __python2 %{__python}}
Name:           python-%{pypi_name}
Version:        3.5.0
Release:        4%{?dist}
Summary:        A tool to generate a static blog from reStructuredText or Markdown input files

License:        AGPLv3
URL:            http://getpelican.com/
Source0:        https://github.com/getpelican/pelican/archive/%{version}.tar.gz#/%{pypi_name}-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python-devel
BuildRequires:  python-sphinx
BuildRequires:  python-blinker
BuildRequires:  python-unidecode

BuildRequires:  python-mock
BuildRequires:  python-markdown
BuildRequires:  python-beautifulsoup4
BuildRequires:  python-lxml
BuildRequires:  python-six
BuildRequires:  pytz
BuildRequires:  python-unidecode
BuildRequires:  python-jinja2
BuildRequires:  python-django
BuildRequires:  python-dateutil

Requires:  python-blinker
Requires:  python-six
Requires:  python-unidecode
Requires:  python-jinja2
Requires:  pytz
Requires:  python-pygments
Requires:  python-docutils
Requires:  python-django
Requires:  python-markdown
Requires:  python-feedparser
Requires:  python-dateutil


%description
Pelican is a static site generator, written in Python_.

* Write your weblog entries directly with your editor of choice (vim!)
  in reStructuredText_ or Markdown_
* Includes a simple CLI tool to ...


%prep
%setup -q -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

# make file not zero length to silence rpmlint
echo " " > pelican/themes/simple/templates/tag.html

# remove bagpath #!/usr/bin/env from files
sed -i '1d' pelican/tools/pelican_import.py
sed -i '1d' pelican/tools/pelican_quickstart.py
sed -i '1d' pelican/tools/pelican_themes.py
sed -i '1d' pelican/tools/templates/pelicanconf.py.in

# substitute feedgenerator with it's original django
sed -i 's|feedgenerator|django.utils.feedgenerator|' pelican/writers.py
sed -i "s|'feedgenerator >= 1.6', ||" setup.py
sed -i "s|'pytz >= 0a'|'pytz'|" setup.py


%build
%{__python2} setup.py build

# build docs
sphinx-build docs html

# remove leftovers from sphinxbuild
rm html/_downloads/theme-basic.zip html/_static/theme-basic.zip
rm -rf html/.doctrees html/.buildinfo


%install
%{__python2} setup.py install --skip-build --root %{buildroot}

%check
# disable tests for now. they are a bit unstable due comparing
# html attributes via diff. Failed several times, when attributes
# were ordered differently!
#%{__python2} -m unittest discover

%files
%doc html README.rst LICENSE
%{_bindir}/pelican
%{_bindir}/pelican-import
%{_bindir}/pelican-quickstart
%{_bindir}/pelican-themes
%{python_sitelib}/%{pypi_name}
%{python_sitelib}/%{pypi_name}-*-py?.?.egg-info

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

* Fri Apr 17 2015 Matthias Runge <mrunge@redhat.com> - 3.5.0-3
- change requirements for pytz

* Mon Mar 23 2015 Matthias Runge <mrunge@redhat.com> - 3.5.0-2
- add runtime requirement python-dateutil(rhbz#1204791)

* Tue Mar 10 2015 Matthias Runge <mrunge@redhat.com> - 3.5.0-1
- update to 3.5.0 (rhbz#1200030)

* Mon Sep 01 2014 Matthias Runge <mrunge@redhat.com> - 3.4.0-1
- update to 3.4.0
- add requires: python-feedparser (rhbz#1135665)

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

* Mon Apr 21 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.3.0-4
- add Requires: python-markdown

* Wed Feb 05 2014 Matthias Rugne <mrunge@redhat.com> - 3.3.0-3
- use __python2 instead of __python
- use a tarball from github, as it significantly differs from pypi
- add tests
- build docs


* Sat Jan 25 2014 Matthias Runge <mrunge@redhat.com> - 3.3-1
- Initial package.