%global shortname stem
%global with_python3 1
Name: python-stem
Version: 1.1.0
Release: 1%{?dist}
Summary: Python controller library for Tor
Group: Development/Libraries
# All source code is LGPLv3 except stem/util/ordereddict.py which is MIT
License: LGPLv3 and MIT
URL: https://stem.torproject.org/
Source0: https://pypi.python.org/packages/source/s/stem/%{shortname}-%{version}.tar.bz2
# https://www.torproject.org/docs/signing-keys.html.en
Source1: https://pypi.python.org/packages/source/s/stem/%{shortname}-%{version}.tar.bz2.asc
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-sphinx
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif
%description
Stem is a python controller library for Tor.
It uses Tor’s control protocol to help developers program against the
Tor process.
%if 0%{?with_python3}
%package -n python3-stem
Summary: Python3 controller library for Tor
Group: Development/Libraries
%description -n python3-stem
Stem is a python controller library for Tor.
It uses Tor’s control protocol to help developers program against the
Tor process.
%endif
%package doc
Summary: Python controller library for Tor - Documentation
Group: Documentation
%description doc
Stem is a python controller library for Tor.
It uses Tor’s control protocol to help developers program against the
Tor process.
This package contains documentation files for Stem.
%prep
%setup -q -n %{shortname}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
pushd docs
make %{?_smp_mflags} html
make %{?_smp_mflags} man
popd
%install
%{__python} setup.py install --skip-build --root %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif
mv -f docs/_build/html docs/
rm -f docs/html/.buildinfo
install -d %{buildroot}%{_mandir}/man1/
install -m 0644 docs/_build/man/%{shortname}.1 %{buildroot}%{_mandir}/man1/
%files
%doc LICENSE
%{python_sitelib}/%{shortname}
%{python_sitelib}/%{shortname}-*.egg-info
%if 0%{?with_python3}
%files -n python3-stem
%doc LICENSE
%{python3_sitelib}/%{shortname}
%{python3_sitelib}/%{shortname}-*.egg-info
%endif
%files doc
%doc LICENSE docs/html
%{_mandir}/man1/%{shortname}.1*
%changelog
* Tue Oct 15 2013 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.1.0-1
- Version 1.1.0
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sun Apr 28 2013 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.0.1-4
- Enable parallel make
* Sun Apr 28 2013 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.0.1-3
- Add doc subpackage
* Sun Apr 07 2013 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.0.1-2
- Update Source URL
* Wed Mar 27 2013 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.0.1-1
- Add python3 subpackage
- Update to 1.0.1
* Wed Mar 27 2013 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.0.0-1
- Version 1.0.0
* Tue Feb 26 2013 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.2.20130226gitbe9a532
- Update source code
* Sun Jan 13 2013 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.1.20130113git
- Initial packaging