File sshuttle.spec of Package sshuttle

#
# spec file for package sshuttle
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/


Name:           sshuttle
Version:        0.78.1
Release:        0
License:        LGPL-2.1
Summary:        VPN over an SSH tunnel
Url:            https://github.com/sshuttle/sshuttle
Group:          Development/Languages/Python
Source0:        https://pypi.python.org/packages/48/be/c1c9ead0c38383c4b2a192de4679f09413ddc6701988ca56bd220c64ec50/sshuttle-%{version}.tar.gz
# Buildtime dependencies not required for runtime
# but required to be able to build package as is...
# pytest-runner-2.9.tar.gz#md5=2212a2e34404b0960b2fdc2c469247b2
Source1:        https://pypi.python.org/packages/11/d4/c335ddf94463e451109e3494e909765c3e5205787b772e3b25ee8601b86a/pytest-runner-2.9.tar.gz
# setuptools_scm-1.15.0.tar.gz#md5=b6916c78ed6253d6602444fad4279c5b
Source2:        https://pypi.python.org/packages/80/b7/31b6ae5fcb188e37f7e31abe75f9be90490a5456a72860fa6e643f8a3cbc/setuptools_scm-1.15.0.tar.gz
# setuptools-18.0.1.tar.gz#md5=cecd172c9ff7fd5f2e16b2fcc88bba51
Source3:        https://pypi.python.org/packages/8c/04/f4a2dce4364c0bfbb1992e4b3a8e01eb196bb46202f96a62e73927a752ef/setuptools-18.0.1.tar.gz
BuildRequires:  python-devel
BuildRequires:  python-setuptools
%if (0%{?suse_version} >= 1320 || 0%{?suse_version} == 1310)
BuildRequires:  python-Sphinx
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
Transparent proxy server that works as a poor man's VPN. Forwards over ssh.
Doesn't require admin. Supports DNS tunneling.
sshuttle is a program that solves the following case:
- You have access to a remote network via ssh.
- You don't necessarily have admin access on the remote network.
- The remote network has no VPN, or only complex VPN
  protocols (IPsec, PPTP, etc).
- You don't want to create an SSH port forward for every
  single host/port on the remote network.
- You can't use openssh's PermitTunnel feature because
  it's disabled by default on openssh servers; plus it does
  TCP-over-TCP, which has terrible performance.

%prep
%setup -q -n sshuttle-%{version}
%setup -T -D -a 1
%setup -T -D -a 2
%setup -T -D -a 3
mkdir -p .eggs
sed -i '/.bin.env/d' sshuttle/stresstest.py


%build
PYTHONPATH="$(pwd)/.eggs/:$PYTHONPATH"
export PYTHONPATH
%if (0%{?suse_version} >= 1320 || 0%{?suse_version} == 1310)
(
cd docs/;
sed -i '/_scm/d' conf.py
sed -ri 's/(version = )get_version.*/\1 "%{version}"/g' conf.py
make man
)
%endif
#%%if (0%%{?suse_version} <=1310)
(cd setuptools-18.0.1; python setup.py bdist_egg; cp dist/*.egg ../.eggs/)
(cd setuptools_scm-1.15.0; python setup.py bdist_egg; cp dist/*.egg ../.eggs/)
(cd pytest-runner-2.9; python setup.py bdist_egg; cp dist/*.egg ../.eggs/)
#%%endif

python setup.py build

%install
PYTHONPATH="$(pwd)/.eggs/:$PYTHONPATH"
export PYTHONPATH
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

%if (0%{?suse_version} >= 1320 || 0%{?suse_version} == 1310)
mkdir -pm0755  %{buildroot}/%{_mandir}/man1/
install -m0644 docs/_build/man/sshuttle.1 %{buildroot}/%{_mandir}/man1/
%endif

%files
%defattr(-,root,root,-)
%{python_sitelib}/*
%{_bindir}/sshuttle
%if (0%{?suse_version} >= 1320 || 0%{?suse_version} == 1310)
%{_mandir}/man1/sshuttle.1*
%endif

%changelog
openSUSE Build Service is sponsored by