# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif %global pythonver %(%{__python} -c "import sys; print sys.version[:3]" 2>/dev/null || echo 0.0) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" 2>/dev/null)} Name: python-SocksiPy-branch Version: 1.01 Release: 1.%{__distinit}%{__distvers} Summary: A Python SOCKS module Group: Development/Languages License: BSD URL: https://code.google.com/p/socksipy-branch/ Source0: https://socksipy-branch.googlecode.com/files/SocksiPy-branch-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildArch: noarch BuildRequires: coreutils BuildRequires: python2-devel # This fork supersedes the original python-SocksiPy Obsoletes: python-SocksiPy < %{version}-%{release} Provides: python-SocksiPy = %{version}-%{release} %description SocksiPy provides a socket-like interface that supports connections to any TCP service through the use of a SOCKS4, SOCKS5 or HTTP proxy. The original version was developed by Dan Haim and can be found in the python-SocksiPy package. This is an unofficial branch created by Mario Vilas to address some open issues, as the original project seems to have been abandoned circa 2007. %prep %setup -q -n SocksiPy-branch-%{version} %build %{__python} setup.py build %install rm -rf %{buildroot} %{__python} setup.py install -O1 --skip-build --root %{buildroot} # See if there's any egg-info if [ -f %{buildroot}%{python_sitelib}/SocksiPy_branch-%{version}-py%{pythonver}.egg-info ]; then echo %{python_sitelib}/SocksiPy_branch-%{version}-py%{pythonver}.egg-info fi > egg-info %clean rm -rf %{buildroot} %files -f egg-info %if 0%{?_licensedir:1} %license LICENSE %else %doc LICENSE %endif %doc BUGS PKG-INFO README %{python_sitelib}/socks.py* %changelog * Sat Oct 10 2015 Paul Howarth - 1.01-1 - Initial RPM version