Пакет python-module-pelican: Specfile

%define pypi_name pelican

Name: python-module-%pypi_name
Version: 4.0.1
Release: alt1
Summary: A tool to generate a static blog from reStructuredText or Markdown input files
Group: Development/Python

License: AGPLv3
Url: http://getpelican.com/
# https://github.com/getpelican/pelican/archive/%version.tar.gz#/%pypi_name-%version.tar.gz
Source: %pypi_name-%version.tar

BuildArch: noarch

BuildRequires: python-devel python-module-blinker python-module-dateutil
BuildRequires: python-module-sphinx python-module-pytz
BuildRequires: python-module-unidecode python-module-mock
BuildRequires: python-module-pelican

# for django.utils.feedgenerator
BuildPreReq: python-module-django

%add_findreq_skiplist %python_sitelibdir/%pypi_name/tools/templates/*

%py_requires unidecode

%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 pelican
Summary: A tool to generate a static blog from reStructuredText or Markdown input files
Group: Publishing
Requires: python-module-pelican
Requires: python-module-markdown
Requires: python-module-Pygments-tests

%description -n pelican
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 -n %pypi_name-%version
# Remove bundled egg-info
rm -rf %pypi_name.egg-info

# 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

# 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

%build
%python_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
%python_install

%check
# disable tests for now. they are a bit unstable due comparing
# html attributes via diff. Failed several times, when attributes
# were ordered differently!
LC_ALL=en_US.UTF-8 python -m unittest discover ||:

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

%files -n pelican

%changelog
* Tue Dec 04 2018 Andrey Cherepanov <cas@altlinux.org> 4.0.1-alt1
- New version.

* Fri Nov 16 2018 Andrey Cherepanov <cas@altlinux.org> 4.0.0-alt1
- New version.

* Sat Jan 28 2017 Andrey Cherepanov <cas@altlinux.org> 3.7.1-alt1
- new version 3.7.1

* Thu Jul 14 2016 Andrey Cherepanov <cas@altlinux.org> 3.6.3-alt2
- Add metapackage pelican with all requirements needed for generation

* Wed Jul 13 2016 Andrey Cherepanov <cas@altlinux.org> 3.6.3-alt1
- new version 3.6.3

* Wed Apr 01 2015 Gleb F-Malinovskiy <glebfm@altlinux.org> 3.5.0-alt1
- Initial build.