Blob Blame History Raw
%global with_python3 1

%global commit d956c31576e1fc9a40e584bfe79906128e371835
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name: python-nikola	
Version:	7.7.4
Release:	1%{?dist}
Summary:	A static website and blog generator
License:	MIT
URL:		http://getnikola.com
Source0: https://github.com/getnikola/nikola/archive/v%{version}.tar.gz
Patch0:  0001-adjust-requires-for-rawhide-2016-01-10.patch
BuildArch:	noarch
BuildRequires:	python2-devel
BuildRequires:	python-setuptools
Requires:	python-doit >= 0.28.0
Requires:	python-pygments >= 1.6
Requires:	python-pillow >= 2.4.0
Requires: python-dateutil >= 2.4.0
Requires:	python-docutils >= 0.12
Requires:	python-mako >= 1.0.0
Requires:	python-unidecode >= 0.04.16
Requires:	python-lxml >= 3.3.5
Requires:	python-yapsy >= 1.11.223
Requires:	python-PyRSS2Gen >= 1.1
Requires:	python-logbook >= 0.7.0
Requires:	python-blinker >= 1.3
Requires:	python-natsort >= 3.5.2
Requires: python-requests >= 2.2.0
Requires: python-husl >= 4.0.1 
# upstream has 4.0.2 

Requires: glyphicons-halflings-fonts

# test requires
BuildRequires: python-mock >= 1.0.1 
# == 1.3.0
BuildRequires: python-coverage >= 4.0.3 
# == 4.0.3
BuildRequires: pytest >= 2.8.5 
# == 2.8.5
BuildRequires: python-pytest-cov >= 2.2.0 
# == 2.2.0
BuildRequires: python-freezegun >= 0.3.2 
# == 0.3.5
# BuildRequires: python-coveralls == 2.5.0
BuildRequires: python-colorama >= 0.3.2
# >= 0.3.4
BuildRequires: python-lxml
BuildRequires: libxslt-devel
BuildRequires:	python-pillow >= 2.4.0
BuildRequires: python-husl >= 4.0.1 
BuildRequires:	python-requests >= 2.2.0

%description
Nikola is a static site and blog generator using Python. It generates sites 
with tags, feeds, archives, comments, and more from plain text files. Source
 can be unformatted, or formatted with reStructuredText or Markdown. 
It also automatically builds image galleries.

%package -n python-nikola-extras
Summary: Extra functionality for python-nikola
#begin optional dependencies
Requires:	python-nikola == %{version}
Requires:	python-requests >= 2.2.0
Requires:	python-markdown >= 2.4.0
Requires:	python-jinja2 >= 2.7.2
Requires:	python-pyphen >= 0.9.1
# Requires: python-micawber >= 0.3.0 
Requires:	python-pygal >= 2.0.0
# Requires: python-typogriphy >= 2.0.4
# Requires: python-phpserialize >= 1.3
Requires:	python-webassets >= 0.10.1
Requires:	python-ipython-notebook >= 1.2.1
# Requires: python-ipykernel >= 4.0.0
# Requires: python-ghpimport2 >= 1.0.0
# Requires: python-ws4py == 0.3.4
Requires: python-watchdog >= 0.8.2 

%description -n python-nikola-extras
This package adds optional dependencies for python-nikola, 
expanding functionality.


%if 0%{?with_python3}
%package -n python3-nikola
Summary:	A static website and blog generator using Python3	
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
Requires:	python3-doit >= 0.28.0
Requires:	python3-pygments >= 1.6
Requires:	python3-pillow >= 2.4.0
Requires: python3-dateutil >= 2.4.0
Requires:	python3-docutils >= 0.12
Requires:	python3-mako >= 1.0.0
Requires:	python3-unidecode >= 0.04.16
Requires:	python3-lxml >= 3.3.5
Requires:	python3-yapsy >= 1.10.423
Requires:	python3-PyRSS2Gen >= 1.1
Requires:	python3-logbook >= 0.7.0
Requires:	python3-blinker >= 1.3
Requires:	python3-natsort >= 3.5.2
Requires: python3-requests >= 2.2.0
Requires: python3-husl >= 4.0.1 
# upstream has 4.0.2 
Requires: glyphicons-halflings-fonts
BuildRequires: python3-husl >= 4.0.1 

# test requires
BuildRequires: python3-mock >= 1.0.1 
# == 1.3.0
BuildRequires: python3-coverage >= 4.0.3 
# == 4.0.3
BuildRequires: python3-pytest >= 2.8.5 
# == 2.8.5
BuildRequires: python3-pytest-cov >= 2.2.0 
# == 2.2.0
BuildRequires: python3-freezegun >= 0.3.2 
# == 0.3.5
# BuildRequires: python3-coveralls == 2.5.0
BuildRequires: python3-colorama >= 0.3.2
# >= 0.3.4
BuildRequires: python3-lxml
BuildRequires: libxslt-devel
BuildRequires:	python3-pillow >= 2.4.0
BuildRequires: python3-requests >= 2.2.0

%description -n python3-nikola
Nikola is a static site and blog generator using Python. It generates sites
with tags, feeds, archives, comments, and more from plain text files. Source
 can be unformatted, or formatted with reStructuredText or Markdown.
It also automatically builds image galleries.

%package -n python3-nikola-extras
Summary:	 Extra functionality for python3-nikola
#begin optional dependencies
Requires:	python-nikola == %{version}
Requires:	python-requests >= 2.2.0
Requires:	python-markdown >= 2.4.0
Requires:	python-jinja2 >= 2.7.2
Requires:	python-pyphen >= 0.9.1
# Requires: python-micawber >= 0.3.0 
Requires:	python-pygal >= 2.0.0
# Requires: python-typogriphy >= 2.0.4
# Requires: python-phpserialize >= 1.3
Requires:	python-webassets >= 0.10.1
Requires:	python-ipython-notebook >= 1.2.1
# Requires: python-ipykernel >= 4.0.0
# Requires: python-ghpimport2 >= 1.0.0
# Requires: python-ws4py == 0.3.4
Requires: python-watchdog >= 0.8.2 

%description -n python3-nikola-extras
This package adds optional dependencies for python3-nikola,
expanding functionality.


%endif

%package -n python-nikola-doc
Summary:	Documentation for Nikola, a static site generator

%description -n python-nikola-doc
python-nikola-doc contains detailed usage instructions for Nikola, a static
website and blog generator in python.

%prep
%setup -qn nikola-%{version}
%patch0 -p1

%build
%if 0%{?with_python3}
%{__python3} setup.py build
mv build build3
%endif

%{__python2} setup.py build
mv build build2
echo "This is a stub package to provide optional dependencies for nikola" > README.extras
%install
# There's renaming here to accomodate both python2 and python3. The unversioned symlinks
# assume python2 as the default; these should be re-evaluated if python3 becomes default.
mv build2 build
%{__python2} setup.py install --skip-build --root %{buildroot}
mv %{buildroot}/%{_bindir}/nikola %{buildroot}/%{_bindir}/nikola2
mv %{buildroot}/%{_mandir}/man1/nikola.1.gz %{buildroot}/%{_mandir}/man1/nikola%{python2_version}.1.gz
rm -rf %{buildroot}/%{python2_sitelib}/nikola/data/themes/bootstrap3/assets/fonts
ln -s %{_datadir}/fonts/glyphicons-halflings \
 %{buildroot}/%{python2_sitelib}/nikola/data/themes/bootstrap3/assets/fonts

## communicated to upstream, fix pending:
#find %{buildroot}/%{python2_sitelib}/nikola/ -name \*.py -execdir sed -i -e '/^#!\/usr\/bin\/python$/d' {} \;
#find %{buildroot}/%{python2_sitelib}/nikola/ -type f -execdir chmod a-x {} \;
##
rm -rf build

%if 0%{?with_python3}
mv build3 build
%{__python3} setup.py install --skip-build --root %{buildroot}
mv %{buildroot}/%{_bindir}/nikola %{buildroot}/%{_bindir}/nikola%{python3_version}
find %{buildroot}/%{python3_sitelib}/nikola/ -name \*.py -execdir sed -i -e '/^#!\/usr\/bin\/python$/d' {} \;
find %{buildroot}/%{python3_sitelib}/nikola/ -type f -execdir chmod a-x {} \;
mv %{buildroot}/%{_mandir}/man1/nikola.1.gz %{buildroot}/%{_mandir}/man1/nikola%{python3_version}.1.gz
ls
rm -rf %{buildroot}/%{python3_sitelib}/nikola/data/themes/bootstrap3/assets/fonts
ln -s %{_datadir}/fonts/glyphicons-halflings \
 %{buildroot}/%{python3_sitelib}/nikola/data/themes/bootstrap3/assets/fonts
%endif

rm -rf %{buildroot}%{_datadir}/doc/nikola
ln -s %{_bindir}/nikola2 %{buildroot}/%{_bindir}/nikola
ln -s %{_mandir}/man1/nikola%{python2_version}.1.gz %{buildroot}/%{_mandir}/man1/nikola.1.gz

%check
%{__python2} setup.py test
%{__python3} setup.py test

%files
%{_bindir}/nikola
%{_bindir}/nikola2
%{python2_sitelib}/Nikola-%{version}-py%{python2_version}.egg-info
%{python2_sitelib}/nikola
%{_mandir}/man1/nikola%{python2_version}*
%{_mandir}/man1/nikola.1.gz
%doc AUTHORS.txt CHANGES.txt CONTRIBUTING.rst LICENSE.txt README.rst

%files -n python3-nikola
%{_bindir}/nikola%{python3_version}
%{python3_sitelib}/Nikola-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/nikola
%{_mandir}/man1/nikola%{python3_version}*
%doc AUTHORS.txt CHANGES.txt CONTRIBUTING.rst LICENSE.txt README.rst

%files -n python-nikola-doc
%doc docs/*.txt

%files -n python-nikola-extras
%doc README.extras

%files -n python3-nikola-extras
%doc README.extras

%changelog
* Sun Jan 10 2016 Pete Travis <immanetize@fedoraproject.org> - 7.7.4-1
- Bump to latest upstream, info at https://github.com/getnikola/nikola/releases/tag/v7.7.3
- Do tests.
 
* Sat Nov 14 2015 Pete Travis <immanetize@fedoraproject.org> - 7.7.3-1
- Bump to latest upstream, info at https://github.com/getnikola/nikola/releases/tag/v7.7.3

* Wed Aug 26 2015 Pete Travis <immanetize@fedoraproject.org> - 7.7.3-1
- Bump to latest upstream, info at https://github.com/getnikola/nikola/releases/tag/v7.7.3

* Wed Aug 26 2015 Pete Travis <immanetize@fedoraproject.org> - 7.6.4-1
- Bump to latest upstream, info at https://github.com/getnikola/nikola/releases/tag/v7.6.4

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

* Sat Apr 04 2015 Pete Travis <immanetize@fedoraproject.org> - 7.3.1-2
- Fix manpage handling

* Sat Apr 04 2015 Pete Travis <immanetize@fedoraproject.org> - 7.3.1-1
- Update to upstream 7.3.1
- Primarily a bugfix release, refer to https://github.com/getnikola/nikola/releases/tag/v7.3.1

* Wed Feb 25 2015 Pete Travis <immanetize@fedoraproject.org> - 7.3.0-5
- Stop removing empty files, really.

* Tue Feb 24 2015 Pete Travis <immanetize@fedoraproject.org> - 7.3.0-4
- comment out python-ghp-import requires, pacakge review pending.

* Tue Feb 10 2015 Pete Travis <immanetize@petetravis.com> - 7.3.0-3
- leave some empty files so all the modules load.

* Sun Jan 18 2015 Pete Travis <immanetize@petetravis.com> - 7.3.0-2
- Add python-ghp-import to extras
* Sun Jan 18 2015 Pete Travis <immanetize@petetravis.com> - 7.3.0-1
- Update to upstream 7.3.0

* Fri Nov 21 2014 Pete Travis <immanetize@petetravis.com> - 7.2.0-2
- drop versioned requirements on python-setuptools

* Sat Nov 08 2014 Pete Travis <immanetize@fedoraproject.org> 7.2.0-1
- Update to upstream 7.2.0, see https://github.com/getnikola/nikola/releases/tag/v7.2.0

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

* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 6.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Wed Mar 12 2014 Pete Travis <immanetize@fedoraproject.org> 6.4.0-1
- Update to upstream 6.4.0, see https://github.com/getnikola/nikola/releases/tag/v6.4.0
- Add python-colorama to Requires

* Mon Feb 17 2014 Pete Travis <immanetize@fedoraproject.org> 6.3.0-1
- Update to upstream 6.3.0, see https://github.com/getnikola/nikola/releases/tag/v6.3.0
- Added python-pygal and python-webassets to -extras

* Sun Nov 10 2013 Pete Travis <immanetize@fedoraproject.org> 6.2.1-1
- Update to upstream 6.2.1, see https://github.com/getnikola/nikola/releases/tag/v6.2.1
- Added -extras subpackage; optional dependencies for added value.

* Sat Oct 26 2013 Pete Travis <immanetize@fedoraproject.org> 6.0.4-2
- Installing manpages for all appropriate subpackages, and ensuring they match their binaries.
- Adding package docs to subpackages.
- Ensure build environments for python2 and python3 packages don't get mixed up.

* Fri Oct 04 2013 Pete Travis <immanetize@fedoraproject.org> 6.0.4-1
- Updating to upstream release 6.0.4 - bugfix release, details included in package.
- Changed source to use main project github, getnikola, instead of primary developer's branch.
- Added subpackage for documentation.
- Provide python3 support in subpackage.

* Sun Sep 22 2013 Pete Travis <immanetize@fedoraproject.org> 6.0.1-1
- Updating to upstream release 6.0.1. 
- The release includes numerous bugfixes and feature improvents. See CHANGES.txt for details.

* Mon Aug 19 2013 Pete Travis <immanetize@fedoraproject.org> 5.5.1-1
- Initial packaging