Blob Blame History Raw
# Requires python 3.5 (included in Fedora 25 and beyond), or Python
# 2.7
%if 0%{fedora} >= 24
%global use_py3 1
%else
%global use_py3 0
%endif

Name:               sshuttle
Version:            0.78.0
Release:            3%{?dist}
Summary:            Transparent Proxy VPN

Source0:            https://pypi.python.org/packages/source/s/%{name}/%{name}-%{version}.tar.gz

URL:                https://github.com/%{name}/%{name}
Group:              Applications/Internet
License:            LGPLv2+
BuildArch:          noarch

%if %{use_py3}
BuildRequires:      python3-devel
BuildRequires:      python3-setuptools
BuildRequires:      python3-setuptools_scm
%else
BuildRequires:      python2-devel
BuildRequires:      python2-setuptools
BuildRequires:      python2-setuptools_scm
%endif

# For building docs. Here we duplicate a requirement for
# setuptools_scm, without specifying the python version. The intention
# is to pull in the correct version of setuptools_scm for use with
# sphinx-build (whichever version of Python that is using).
BuildRequires:      python-sphinx
BuildRequires:      python-setuptools_scm
BuildRequires:      texinfo

Requires:           iptables
Requires:           openssh-clients

Requires(post):     info
Requires(preun):    info

%description
Transparent proxy server that works as a poor man's VPN. Forwards over ssh.
Doesn't require admin. Works with Linux and MacOS. Supports DNS tunneling.

%prep
%autosetup -p1 -n %{name}-%{version}

# This file is a script, so shouldn't be installed under
# site-packages. We'll remove it for now.
rm %{name}/stresstest.py

%build
%if %{use_py3}
%py3_build
%else
%py2_build
%endif

# Build docs
pushd docs
make man
make info
popd

%install
%if %{use_py3}
%py3_install
%else
%py2_install
%endif

# Install docs
pushd docs
# Man
mkdir -p %{buildroot}/%{_mandir}/man1
mv _build/man/%{name}.1 %{buildroot}/%{_mandir}/man1
# Info
mkdir -p %{buildroot}/%{_infodir}
mv _build/texinfo/%{name}.info %{buildroot}/%{_infodir}
popd

%post
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

%preun
if [ $1 = 0 ] ; then
  /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi

%files
%license LICENSE
%{_mandir}/man1/%{name}.1.*
%{_infodir}/%{name}.info.*
%if %{use_py3}
%{python3_sitelib}/%{name}
%{python3_sitelib}/%{name}*.egg-info
%else
%{python2_sitelib}/%{name}
%{python2_sitelib}/%{name}*.egg-info
%endif
%{_bindir}/sshuttle

%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.78.0-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Mon Apr 11 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.78.0-2
- Use PyPi source tarball rather than rolling our own (only needed
  when building git snapshots)

* Sun Apr 10 2016 Kevin Fenzi <kevin@scrye.com> - 0.78.0-1
- Update to 0.78.0. Fixes bug #1325602
- Drop upstreamed patches

* Sat Apr  2 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.77.3-0.1.20160402git6e15e691
- Update to git snapshot
- Add patch to work with older python versions on server end

* Mon Mar  7 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.77.2-1
- Update to 0.77.2
- Use PyPi tarball instead of rolling our own from git
- Fixup typos in spec file changelog

* Sat Mar  5 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.77-5
- Build and package info file
- Use macros more consistently in spec file
- Move building of docs to %%build section of spec
- Remove the stresstest.py script

* Sat Mar  5 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.77-4
- Move to using hand-rolled tar balls rather than the github release
- Drop patch to set version manually
- Build and package man page
- BuildRequire the correct version of setuptools_scm

* Sat Mar  5 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.77-3
- Build with Python 3 on F24 too

* Sat Mar  5 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.77-2
- Use Python 3 for Fedora 25 and beyond, otherwise Python 2

* Sat Mar  5 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.77-1
- Update to 0.77
- Disable doc building for now
- Add patch to set version to allow build to complete
- Use python3 by default
- Use python packaging macros

* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-12.20120810git9ce2fa0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-11.20120810git9ce2fa0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

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

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-9.20120810git9ce2fa0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-8.20120810git9ce2fa0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Mon Jan 07 2013 Marcel Wysocki <maci@satgnu.net> - 0-7.20120810git9ce2fa0
- don't use doc macro for files in mandir

* Fri Nov 23 2012 Marcel Wysocki <maci@satgnu.net> - 0-6.20120810git9ce2fa0
- fixed hash ( woops, where did that g come from )
- fixed date to be commit date and not clone date
- use version 0 
- use datadir instead of /usr/local
- remove sshuttle.md in favor of the manpage
- remove make from BR
- added comment on how to create the source tarball

* Wed Oct 31 2012 Marcel Wysocki <maci@satgnu.net> - 20121019-5.gitg9ce2fa0
- remove python from deps and builddeps, rpm picks it up automatically 
- add manual page
- add missing builddep for manual generation

* Mon Oct 22 2012 Marcel Wysocki <maci@satgnu.net> - 20121019-4.gitg9ce2fa0
- add missing dependencies

* Mon Oct 22 2012 Marcel Wysocki <maci@satgnu.net> - 20121019-3.gitg9ce2fa0
- Don't use macros for rm, install, chmod and cp.
- Remove defattr, since we're not going for EPEL4.
- Remove the clean section since we're not going for EPEL5.

* Fri Oct 19 2012 Marcel Wysocki <maci@satgnu.net> - 20121019-2.gitg9ce2fa0
- use .tar.gz instead of .zip

* Fri Oct 19 2012 Marcel Wysocki <maci@satgnu.net> - 20121019-1.gitg9ce2fa0
- update to newer spapshot
- adhere more to packaging guidelines

* Thu Oct 18 2012 Marcel Wysocki <maci@satgnu.net> - 0.20121018-3
- update to newer spapshot
- fedora port
- adhere more to packaging guidelines

* Wed May  4 2011 pascal.bleser@opensuse.org
- initial version (0.20110503)