%if 0%{?fedora} > 12 %global with_python3 1 %endif %global pypi_name pelican %{!?__python2:%global __python2 %{__python}} Name: python-%{pypi_name} Version: 3.6.3 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 %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 ... %package -n python2-%{pypi_name} Summary: A tool to generate a static blog from reStructuredText or Markdown input files Obsoletes: python-%{pypi_name} < 3.6.3-3 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-jinja2 BuildRequires: python-django BuildRequires: python-dateutil BuildRequires: python-nose BuildRequires: python-nose-cov 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 -n python2-%{pypi_name} 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 ... %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: A tool to generate a static blog from reStructuredText or Markdown input files BuildRequires: python3-devel BuildRequires: python3-blinker BuildRequires: python3-unidecode BuildRequires: python3-mock BuildRequires: python3-markdown BuildRequires: python3-beautifulsoup4 BuildRequires: python3-lxml BuildRequires: python3-six BuildRequires: python3-pytz BuildRequires: python3-jinja2 BuildRequires: python3-django BuildRequires: python3-dateutil Requires: python3-blinker Requires: python3-six Requires: python3-unidecode Requires: python3-jinja2 Requires: python3-pytz Requires: python3-pygments Requires: python3-docutils Requires: python3-django Requires: python3-markdown Requires: python3-feedparser Requires: python3-dateutil %description -n python3-%{pypi_name} 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 ... %endif %prep %setup -qc mv %{pypi_name}-%{version} python2 pushd python2 # copy LICENSE etc. to top level dir cp -a LICENSE .. cp -a README.rst .. # 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 popd %if 0%{?with_python3} cp -a python2 python3 %endif %build pushd python2 %{__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 mv html .. popd %if 0%{?with_python3} pushd python3 %{__python3} setup.py build popd %endif %install %if 0%{?with_python3} pushd python3 %{__python3} setup.py install --skip-build --root %{buildroot} popd # rename helpers mv %{buildroot}/%{_bindir}/pelican %{buildroot}/%{_bindir}/py3-pelican mv %{buildroot}/%{_bindir}/pelican-import %{buildroot}/%{_bindir}/py3-pelican-import mv %{buildroot}/%{_bindir}/pelican-quickstart %{buildroot}/%{_bindir}/py3-pelican-quickstart mv %{buildroot}/%{_bindir}/pelican-themes %{buildroot}/%{_bindir}/py3-pelican-themes %endif pushd python2 %{__python2} setup.py install --skip-build --root %{buildroot} popd %check # disable tests for now. they are a bit unstable due comparing # html attributes via diff. Failed several times, when attributes # were ordered differently! #pushd python2 #nosetests -sv --with-coverage --cover-package=pelican pelican #popd %files -n python2-%{pypi_name} %doc html README.rst %license LICENSE %{_bindir}/pelican %{_bindir}/pelican-import %{_bindir}/pelican-quickstart %{_bindir}/pelican-themes %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-*-py?.?.egg-info %if 0%{?with_python3} %files -n python3-pelican %doc html README.rst %license LICENSE %{_bindir}/py3-pelican %{_bindir}/py3-pelican-import %{_bindir}/py3-pelican-quickstart %{_bindir}/py3-pelican-themes %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-*-py?.?.egg-info %endif %changelog * Thu Feb 04 2016 Fedora Release Engineering - 3.6.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Mon Nov 16 2015 Matthias Runge - 3.6.3-3 - properly provide python2-pelican (rhbz#1282229) * Tue Nov 10 2015 Fedora Release Engineering - 3.6.3-2 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Wed Nov 04 2015 Matthias Runge - 3.6.3-1 - update to 3.6.3 * Mon Jun 22 2015 Matthias Runge - 3.6.0-1 - update to 3.6.0 - add python3 support (rhbz#1227982) * Thu Jun 18 2015 Fedora Release Engineering - 3.5.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Fri Apr 17 2015 Matthias Runge - 3.5.0-3 - change requirements for pytz * Mon Mar 23 2015 Matthias Runge - 3.5.0-2 - add runtime requirement python-dateutil(rhbz#1204791) * Tue Mar 10 2015 Matthias Runge - 3.5.0-1 - update to 3.5.0 (rhbz#1200030) * Mon Sep 01 2014 Matthias Runge - 3.4.0-1 - update to 3.4.0 - add requires: python-feedparser (rhbz#1135665) * Sat Jun 07 2014 Fedora Release Engineering - 3.3.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Mon Apr 21 2014 Jamie Nguyen - 3.3.0-4 - add Requires: python-markdown * Wed Feb 05 2014 Matthias Rugne - 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 - 3.3-1 - Initial package.