cecc27f
%if 0%{?fedora} > 12 || 0%{?rhel} > 7
637b020
%global with_python3 1
637b020
%else
637b020
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
637b020
%endif
637b020
fc69c34
Name:           python-straight-plugin
e5ac099
Version:        1.4.0
9d4283b
Release:        4%{?dist}
fc69c34
Summary:        Python plugin loader
fc69c34
fc69c34
License:        BSD
fc69c34
URL:            https://github.com/ironfroggy/straight.plugin/
fc69c34
e5ac099
Source0:        http://pypi.python.org/packages/source/s/straight.plugin/straight.plugin-1.4.0-post-1.tar.gz
fc69c34
fc69c34
BuildArch:      noarch
fc69c34
BuildRequires:  python2-devel
23cb828
BuildRequires:  python-setuptools
23cb828
637b020
%if 0%{?with_python3}
fc69c34
BuildRequires:  python3-devel
fc69c34
BuildRequires:  python-tools
4f8a6aa
BuildRequires:  python3-setuptools
637b020
%endif
fc69c34
ef4822b
%if (0%{?rhel} && 0%{?rhel} <= 6)  || ( 0%{?fedora} && 0%{?fedora} <= 13 )
bc609bf
BuildRequires:  python-importlib
bc609bf
Requires:       python-importlib
bc609bf
%endif
bc609bf
bc609bf
fc69c34
%description
fc69c34
straight.plugin is a Python plugin loader inspired by twisted.plugin with two
fc69c34
important distinctions:
fc69c34
fc69c34
 - Fewer dependencies
fc69c34
 - Python 3 compatible
fc69c34
fc69c34
The system is used to allow multiple Python packages to provide plugins within
fc69c34
a namespace package, where other packages will locate and utilize. The plugins
fc69c34
themselves are modules in a namespace package where the namespace identifies
fc69c34
the plugins in it for some particular purpose or intent.
fc69c34
fc69c34
637b020
%if 0%{?with_python3}
fc69c34
%package -n     python3-straight-plugin
fc69c34
Summary:        Python plugin loader
fc69c34
fc69c34
%description -n python3-straight-plugin
fc69c34
straight.plugin is a Python plugin loader inspired by twisted.plugin with two
fc69c34
important distinctions:
fc69c34
fc69c34
 - Fewer dependencies
fc69c34
 - Python 3 compatible
fc69c34
fc69c34
The system is used to allow multiple Python packages to provide plugins within
fc69c34
a namespace package, where other packages will locate and utilize. The plugins
fc69c34
themselves are modules in a namespace package where the namespace identifies
fc69c34
the plugins in it for some particular purpose or intent.
637b020
%endif
fc69c34
fc69c34
%prep
e5ac099
%setup -q -c -n straight.plugin-1.4.0-post-1
fc69c34
637b020
%if 0%{?with_python3}
e5ac099
cp -r straight.plugin-%{version}-post-1/ py3-straight.plugin-%{version}-post-1
e5ac099
2to3 --write --nobackups py3-straight.plugin-%{version}-post-1
637b020
%endif
fc69c34
fc69c34
%build
e5ac099
pushd straight.plugin-%{version}-post-1
fc69c34
%{__python} setup.py build
fc69c34
popd
fc69c34
637b020
%if 0%{?with_python3}
e5ac099
pushd py3-straight.plugin-%{version}-post-1
fc69c34
%{__python3} setup.py build
fc69c34
popd
637b020
%endif
fc69c34
fc69c34
%install
fc69c34
rm -rf $RPM_BUILD_ROOT
e5ac099
pushd straight.plugin-%{version}-post-1
fc69c34
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
fc69c34
popd
fc69c34
637b020
%if 0%{?with_python3}
e5ac099
pushd py3-straight.plugin-%{version}-post-1
fc69c34
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
fc69c34
popd
637b020
%endif
fc69c34
e5ac099
#%check
e5ac099
#pushd straight.plugin-%{version}-post-1
e5ac099
#%{__python} tests.py
e5ac099
#popd
e5ac099
#
e5ac099
#%if 0%{?with_python3}
e5ac099
#pushd py3-straight.plugin-%{version}-post-1
e5ac099
#%{__python3} tests.py
e5ac099
#popd
e5ac099
#%endif
fc69c34
fc69c34
%files
fc69c34
# For noarch packages: sitelib
fc69c34
%{python_sitelib}/*
fc69c34
637b020
%if 0%{?with_python3}
fc69c34
%files -n python3-straight-plugin
fc69c34
# For noarch packages: sitelib
fc69c34
%{python3_sitelib}/*
637b020
%endif
fc69c34
fc69c34
%changelog
9d4283b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0-4
9d4283b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
9d4283b
6748eb2
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.4.0-3
6748eb2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
6748eb2
f02012c
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0-2
f02012c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f02012c
e5ac099
* Fri Jan 25 2013 Pierre-Yves Chibon - 1.4.0-1
e5ac099
- Update to 1.4.0
e5ac099
- Remove doc as they are not part of the sources anymore (reported upstream)
e5ac099
- Comment out the tests as they are apparently also not in the sources anymore
4f8a6aa
- Add python{,3}-setuptools as BR
e5ac099
8317db5
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 1.1.1-0.10.20111110.git57ef11c
8317db5
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
8317db5
8f1a7f3
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-0.9.20111110.git57ef11c
8f1a7f3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
8f1a7f3
03870ca
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-0.8.20111110.git57ef11c
03870ca
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
03870ca
ef4822b
* Fri Nov 11 2011 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.1.1-0.7.20111110git57ef11c
ef4822b
- Fix the import of python-importlib (Finally!!)
ef4822b
b46e2b2
* Fri Nov 11 2011 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.1.1-0.6.20111110git57ef11c
b46e2b2
- Fix typo in the use if for python-importlib
b46e2b2
8493fac
* Fri Nov 11 2011 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.1.1-0.5.20111110git57ef11c
8493fac
- Add python-importlib as BR and R on EL6
8493fac
637b020
* Fri Nov 11 2011 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.1.1-0.4.20111110git57ef11c
637b020
- EL6 has no python3 /me should get glasses...
637b020
- Fix comment on how to generate the tarball properly (previous method didn't keep the timestamp)
637b020
fc69c34
* Thu Nov 10 2011 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.1.1-0.3.20111110git57ef11c
fc69c34
- Fix the use of __python3 for the tests and the build
fc69c34
- Change python-devel to python2-devel on the BR
fc69c34
fc69c34
* Thu Nov 10 2011 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.1.1-0.2.20111110git57ef11c
fc69c34
- Rename the package to remove the dot
fc69c34
fc69c34
* Thu Nov 10 2011 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.1.1-0.1.20111110git57ef11c
fc69c34
- Initial packaging work for Fedora