Blob Blame History Raw
%global with_python3 1
%global projectname Yapsy
%global productname yapsy
Name:		python-yapsy
Version:	1.10.423
Release:	2%{?dist}
Summary:	A simple plugin system for Python applications

Group:		Development/Libraries	
License:	BSD and CC-BY-SA
URL:		http://yapsy.sourceforge.net
Source0:	http://downloads.sourceforge.net/project/%{productname}/%{projectname}-%{version}/%{projectname}-%{version}.tar.gz
BuildArch:      noarch
BuildRequires: 	python2-devel
BuildRequires:  python-setuptools
BuildRequires:	python-sphinx
Requires:	python	

%description
Yapsy’s main purpose is to offer a way to easily design a plugin system in
Python. Yapsy only depends on Python’s standard library.

%package -n python-yapsy-doc
Summary:	Documentation for python-yapsy, a plugin system for Python applications
Group:		Development/Libraries
BuildArch:	noarch
%description -n python-yapsy-doc
Documentation for yapsy, a simple plugin system for Python applications.

%if 0%{?with_python3}
%package -n python3-yapsy
Summary:        A simple plugin system for Python3 applications.
Group:          Development/Libraries
BuildArch:      noarch
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
%description -n python3-yapsy
Yapsy’s main purpose is to offer a way to easily design a plugin system in Python3, and motivated by the fact that many other Python plugin system are either too complicated for a basic use or depend on a lot of libraries. Yapsy only depends on Python’s standard library.

%package -n python3-yapsy-doc
Summary:	Documentation for python3-yapsy, a plugin system for Python3 applications.
Group:		Development/Libraries
BuildArch: noarch
BuildRequires:	python3-sphinx
%description -n python3-yapsy-doc
Documentation for yapsy, a simple plugin system for python3 applications.
%endif

%prep

%setup -qn %{projectname}-%{version}

%build
%{__python2} setup.py build
%{__python2} setup.py build_sphinx -s src2/package/doc/
mv build build-py2
%if 0%{?with_python3}
%{__python3} setup.py build
%{__python3} setup.py build_sphinx -s src3/package/doc/
mv build build-py3
%endif

%install
mv build-py2 build
%{__python2} setup.py install --skip-build --root %{buildroot}
mv build build-py2
%if 0%{?with_python3}
mv build-py3 build
%{__python3} setup.py install --skip-build --root %{buildroot}
mv build build-py3
%endif

# https://sourceforge.net/p/yapsy/bugs/20/
find %{buildroot}/%{python2_sitelib}/%{productname}/ -name \*.py -execdir sed -i -e '/^#!\/usr\/bin\/python$/d' {} \;
find %{buildroot}/%{python3_sitelib}/%{productname}/ -name \*.py -execdir sed -i -e '/^#!\/usr\/bin\/python$/d' {} \;
#

%files
%{python2_sitelib}/%{projectname}-%{version}-py2.7.egg-info
%{python2_sitelib}/%{productname}

%files -n python-yapsy-doc
%doc src2/package/{README.txt,LICENSE.txt,CHANGELOG.txt} build-py2/sphinx/html/*.html build-py2/sphinx/html/{_sources,_static}

%files -n python3-yapsy
%{python3_sitelib}/%{projectname}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/%{productname}

%files -n python3-yapsy-doc
%doc src3/package/{README.txt,LICENSE.txt,CHANGELOG.txt} build-py3/sphinx/html/*.html build-py3/sphinx/html/{_sources,_static}

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

* Tue Jun 17 2014 Pete Travis <immanetize@fedoraproject.org> - 1.10.423-1
- Updating to upstream release 1.10.423

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1.10.2-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Fri Oct 04 2013 Pete Travis <immanetize@fedoraproject.org> 1.10.2-3
- Turning on python3 boolean so python3 subpackage actually builds
- Correct build and install sections to properly create python3 subpackage
- Remove ill-conceived patches
- Add python3-yapsy-doc subpackage, as upstream procides py3 sources for docs

* Tue Aug 20 2013 Pete Travis <immanetize@fedoraproject.org> 1.10.2-2
- Updating spec file; cleaned up files section and BuildRequires,add noarch -doc subpackage

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