Blob Blame History Raw
%global with_python3 1
Name: python-nikola	
Version:	7.3.0
Release:	2%{?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
BuildArch:	noarch
BuildRequires:	python2-devel
BuildRequires:	python-setuptools
Requires:	python-doit >= 0.23.0
Requires:	python-pygments >= 1.6
Requires:	python-pillow >= 2.4.0
# Upstream requirements.txt v7.3.0 shows python-dateutil==2.4 but this is probably ok
Requires: python-dateutil >= 2.2
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.10.423
Requires:	python-PyRSS2Gen >= 1.1
Requires:	python-logbook >= 0.7.0
Requires:	python-blinker >= 1.3
Requires:	python-natsort >= 3.3.0
Requires: glyphicons-halflings-fonts

%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
Requires:	python-requests >= 2.2.0
Requires:	python-markdown >= 2.4.0

#Requires:	python-livereload >= 2.3.1 
# https://bugzilla.redhat.com/show_bug.cgi?id=1030755

Requires:	python-jinja2 >= 2.7.2
Requires:	python-pyphen >= 0.9.1

#Requires:	python-micawber	
# https://bugzilla.redhat.com/show_bug.cgi?id=1030968

Requires:	python-pygal >= 1.6.1
#https://bugzilla.redhat.com/show_bug.cgi?id=1167733

#Requires:	python-typogrify >= 2.0.4
#	https://github.com/mintchaos/typogrify

#Requires:	python-phpserialize	>= 1.3
#	https://github.com/mitsuhiko/phpserialize

Requires:	python-webassets >= 0.10.1
# webassets bump pending, https://bugzilla.redhat.com/show_bug.cgi?id=1142514
Requires:	python-ipython >= 1.2.1

Requires: python-ghp-import >= 0.4.1

%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.23.0
Requires:	python3-pygments >= 1.6
Requires:	python3-pillow >= 2.4.0
Requires: python3-dateutil >= 2.2
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.3.0
Requires: glyphicons-halflings-fonts
%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:	python3-nikola
Requires:	python3-requests >= 2.2.0
Requires:	python3-markdown >= 2.4.0
#Requires:	python3-livereload >= 2.3.1 
Requires:	python3-jinja2 >= 2.7.2
Requires:	python3-pyphen >= 0.9.1
#Requires:	python3-micawber >= 0.3.0
Requires:	python3-pygal >= 1.5.1
#Requires:  python2-typogrify >= 2.0.4
#Requires:	python3-phpserialize >= 1.3
Requires:	python3-webassets	>= 0.10.1
Requires:	python3-ipython >= 1.2.1
Requires: python3-ghp-import >= 0.4.1

%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}
find . -empty -exec rm {} \;
sed -i -e 's/^setuptools>=5.4.1/setuptools/' requirements.txt

%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
/usr/bin/install -m 0644 -Dp docs/man/nikola.1 %{buildroot}/%{_mandir}/man1/nikola2.1
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 -empty -execdir rm -f {} \;
find %{buildroot}/%{python3_sitelib}/nikola/ -type f -execdir chmod a-x {} \;
/usr/bin/install -m 0644 -Dp docs/man/nikola.1 %{buildroot}/%{_mandir}/man1/nikola3.1
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
 
%files
%{_bindir}/nikola
%{_bindir}/nikola2
%{python2_sitelib}/Nikola-%{version}-py%{python2_version}.egg-info
%{python2_sitelib}/nikola
%{_mandir}/man1/nikola2.1*
%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/nikola3.1*
%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 18 2015 Pete Travis <me@petetravis.com> - 7.3.0-2
- Add python-ghp-import to extras
* Sun Jan 18 2015 Pete Travis <me@petetravis.com> - 7.3.0-1
- Update to upstream 7.3.0

* Fri Nov 21 2014 Pete Travis <me@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