File dba-dante-132.spec of Package dba-dante-132
%define real_name       dante
%define version         1.3.2
%define vers            132
%define prefix          /DBA/%{real_name}/%{version}
%define _libdir %{prefix}/lib
%define _sysconfdir %{prefix}/etc
%define _bindir %{prefix}/bin
%define _sbindir %{prefix}/sbin
%define _includedir %{prefix}/include
%define _mandir %{prefix}/man
%define maketest        0
Name:	 dba-%{real_name}-%{vers}
Summary: Free Socks v4/v5 client Implementation
Version: %{version}
Release: 1
License: BSD-type
Group:   Applications/Internet
URL:     http://www.inet.no/dante/
Source:  ftp://ftp.inet.no/pub/socks/dante-%{version}.tar.gz
Source1: dante-rpmlintrc
Source2: filter-requires.sh
Patch:   dante-1.3.2-64bit_portability.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: flex, bison, pam, pam-devel openssl
Requires: openssl, pam
#!BuildIgnore:  dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c
%if 0%{?suse_version} >= 1100
BuildRequires:          -post-build-checks
%endif
%define _use_internal_dependency_generator 0
%define __find_requires %{SOURCE2}
%description
Dante is a free implementation of the proxy protocols socks version 4,
socks version 5 (rfc1928) and msproxy. It can be used as a firewall
between networks. It is being developed by Inferno Nettverk A/S, a
Norwegian consulting company. Commercial support is available.
This package contains the dynamic libraries required to "socksify"
existing applications to become socks clients.
%package server
Summary: free Socks v4/v5 server implementation
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
%description server
This package contains the socks proxy daemon and its documentation.
The sockd is the server part of the Dante socks proxy package and
allows socks clients to connect through it to the network.
%package devel
Summary: Header files, libraries and development documentation for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
This package contains the header files, static libraries and development
documentation for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-devel.
%prep
%setup -n %{real_name}-%{version}
%patch
%{__chmod} +x %{SOURCE2}
### Example should use /var/log/sockd by default
%{__perl} -pi -e 's|/var/log/lotsoflogs|%{_localstatedir}/log/sockd|' example/sockd.conf
%{__cat} <<EOF >sockd.logrotate
%{_localstatedir}/log/sockd {
	missingok
	copytruncate
	notifempty
}
EOF
%{__cat} <<'EOF' >dsocksify
#!/bin/sh -
# Socksify any dynamically linked program by issuing:
#
#	dsocksify <program> <arguments>
LIBRARY="${SOCKS_LIBRARY-%{_libdir}/libdsocks.so}"
LD_PRELOAD="${LD_PRELOAD} ${LIBRARY}"
export LD_PRELOAD
exec "$@"
EOF
%build
export CFLAGS="%{optflags}"
./configure --prefix="%{prefix}" --libdir="%{_libdir}" --bindir="%{_bindir}" --sysconfdir="%{_sysconfdir}" --includedir="%{_includedir}" --mandir="%{_mandir}"
%{__make} %{?_smp_mflags}
%install
make install PREFIX=%{_prefix} DESTDIR="%{buildroot}" DATAROOTDIR="%{prefix}/usr"
%{__install} -Dp -m0644 example/socks-simple.conf %{buildroot}%{_sysconfdir}/socks.conf
%{__install} -Dp -m0644 example/sockd.conf %{buildroot}%{_sysconfdir}/sockd.conf
%{__install} -Dp -m0644 sockd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/sockd
%{__install} -Dp -m0755 dsocksify %{buildroot}%{_bindir}/dsocksify
%{__ln_s} -f dsocksify %{buildroot}%{_bindir}/socksify
### FIXME: Set library as executable - prevent ldd from complaining
%{__chmod} +x %{buildroot}%{_libdir}/*.so*
%post
/sbin/ldconfig 2>/dev/null
%postun
/sbin/ldconfig 2>/dev/null
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-, root, root, 0755)
#%doc BUGS CREDITS INSTALL LICENSE NEWS README SUPPORT TODO doc/README* doc/faq.*
#%doc example/socks*.conf
%doc %{_mandir}/man5/socks.conf.5*
%doc %{_mandir}/man1/socksify.1
%config %{_sysconfdir}/socks.conf
## Required for dsocksify script
%{_libdir}/libdsocks.so
%{_bindir}/dsocksify
%{_bindir}/socksify
%files server
%defattr(-, root, root, 0755)
#%doc example/sockd*.conf
%doc %{_mandir}/man[58]/sockd.*
%config(noreplace) %{_sysconfdir}/sockd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/sockd
%{_sbindir}/sockd
%files devel
%defattr(-, root, root, 0755)
#%doc doc/rfc* doc/SOCKS4.protocol INSTALL
#%{_libdir}/libdsocks.a
%exclude %{_libdir}/libdsocks.la
%{_libdir}/libsocks.a
%exclude %{_libdir}/libsocks.la
%{_libdir}/libsocks.so*
%{_includedir}/socks.h
%changelog
* Tue Jul  9 2013 Holger Manthey <holger.manthey@bertelsmann.de>
- add filter-requires.sh to remove ld-linux
* Mon Jul  8 2013 Holger Manthey <holger.manthey@bertelsmann.de>
- fix for suse
* Thu Apr 25 2013 Holger Manthey <holger.manthey@bertelsmann.de>
- inital version