Blob Blame History Raw
%global with_python3 1
Name: python-nikola	
Version:	6.4.0
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
BuildArch:	noarch
BuildRequires:	python2-devel
BuildRequires:	python-setuptools
Requires:	python-doit >= 0.23.0
Requires:	python-pygments
Requires:	python-pillow >= 2.0.0
Requires:	python-docutils
Requires:	python-mako >= 0.6
Requires:	python-unidecode
Requires:	python-lxml
Requires:	python-yapsy
Requires:	python-PyRSS2Gen
Requires:	pytz
Requires:	python-logbook
Requires:	python-blinker
Requires:	python-colorama
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-mock >= 1.0.0
Requires:	python-requests >= 1.0
Requires:	python-markdown
#Requires:	python-bbcode # optional, considering packaging it
# https://bugzilla.redhat.com/show_bug.cgi?id=1030751
#Requires:	python-livereload 
# https://bugzilla.redhat.com/show_bug.cgi?id=1030755
Requires:	python-jinja2 >= 2.7
Requires:	python-pyphen
Requires:	python-dateutil
#Requires:	python-micawber	
# https://bugzilla.redhat.com/show_bug.cgi?id=1030968
Requires:	python-pygal
#Requires:	python-typogrify	#not packaged yet, considering
#	https://github.com/mintchaos/typogrify
#Requires:	python-phpserialize	#not packaged, considering
#	https://github.com/mitsuhiko/phpserialize
Requires:	python-webassets
#Requires:	python-ipython >= 1.0.0
#	Required version not yet packaged
#	https://github.com/ipython/ipython
%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
Requires:	python3-pillow >= 2.0.0
Requires:	python3-docutils
Requires:	python3-mako >= 0.6
Requires:	python3-unidecode
Requires:	python3-lxml
Requires:	python3-yapsy
Requires:	python3-PyRSS2Gen
Requires:	python3-pytz
Requires:	python3-logbook
Requires:	python3-blinker
Requires:	python3-colorama
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-mock >= 1.0.0
Requires:	python3-requests >= 1.0
Requires:	python3-markdown
#Requires:	python3-bbcode # optional, considering packaging it
#Requires:	python3-livereload # optional, considering packaging it.
Requires:	python3-jinja2 >= 2.7
Requires:	python3-pyphen
Requires:	python3-dateutil
#Requires:	python3-micawber # optional, under consideration.
Requires:	python3-pygal
#Requires:  python2-typogrify #not packaged yet, considering
#Requires:	python3-phpserialize #not packaged, considering
Requires:	python3-webassets	
#Requires:	python3-ipython
%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 {} \;

%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
* 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