File tsocks.spec of Package tsocks

Name:           tsocks
Version:        1.8.beta5
Release:        1
License:        GPL-2.0+
Group:          Productivity/Networking/Other
Summary:        Provide transparent network access through a SOCKS proxy
Url:            http://tsocks.sourceforge.net/
Source:         http://dl.sourceforge.net/sourceforge/tsocks/%{name}-%{version}.tar.bz2
Source1:        tsocks.sh
Patch0:         00_patch_from_1.8beta5-9.2.patch
Patch1:         01_symbolexport.patch
Patch2:         02_hyphenfix.patch
Patch3:         03_fixloop.patch
Patch4:         04_getpeername.patch
Patch5:         05_config_in_home.patch
Patch6:         06_fallback.patch
Patch7:         07_tsocks-1.8_beta5-hostname-config-fix.patch
Patch8:         08_manpages-fixes.patch
Patch9:         09_multiarch_paths.patch
Patch10:        10_hardening.patch
Patch11:        11_always_init_function_pointers.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf automake libtool

%description
tsocks provides transparent network access through
a SOCKS version 4 or 5 proxy (usually on a firewall).
tsocks intercepts the calls applications make
to establish TCP connections and transparently
proxies them as necessary.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1

%build
autoreconf -fi
%configure
# the saveme binary is built statically but not even packaged -> disable
sed -i '/^SAVE /d' Makefile
make %{?_smp_mflags}

%install
%make_install
install -D -m 0644 tsocks.conf.simple.example %{buildroot}%{_sysconfdir}/tsocks.conf
sed 's:@@LIBDIR@@:%{_libdir}:' %{SOURCE1} > %{buildroot}%{_bindir}/tsocks

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc ChangeLog COPYING tsocks.conf.simple.example tsocks.conf.complex.example
%doc %{_mandir}/man?/*
%config(noreplace) %{_sysconfdir}/tsocks.conf
%{_bindir}/tsocks
%{_libdir}/libtsocks.so
%{_libdir}/libtsocks.so.1*

%changelog