%{!?release_func:%global release_func() %1%{?dist}}

Name:		transconnect
# indeed, the version is 1.3-Beta. But it is untouched since 2001 so
# I do not expect a final 1.3. Therefore, the 'Beta' is omitted
# completely instead of bothering around with a '0.Beta' release
# till end of days.
Version:	1.3
Release:	%release_func 0.3.Beta
Epoch:		1
Summary:	A function imposter to allow transparent connection over HTTPS proxies

Group:		Applications/Internet
License:	GPL
URL:		http://transconnect.sourceforge.net/
Source0:	http://dl.sourceforge.net/sourceforge/transconnect/%name-%version-Beta.tar.gz
Source1:	tconn
Source2:	README.fedora
Patch0:		transconnect-1.3-fixup.patch
BuildRoot:	%_tmppath/%name-%version-%release-root

%description
Transconnect is an implementation to allow network connections over a
HTTP proxy. This should work under almost all linux distributions
using glibc, and all proxies allowing https CONNECT (eg squid).


%prep
%setup -q -n %name-%version-Beta
%patch0 -p1 -b .fixup

sed -i -e 's!\$HOME/\.tconn/!!g' tconn.cat

install -p -m0644 %SOURCE2 .


%build
for i in localres tcpdns localtcp; do
	make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fPIC" CC='%__cc' "$i"
	mv tconn.so tconn-$i.so
	make clean
done
		
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fPIC" CC='%__cc'


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT{%_libdir,%_bindir}
install -p -m0755 %SOURCE1  $RPM_BUILD_ROOT%_bindir/
install -p -m0755 tconn*.so $RPM_BUILD_ROOT%_libdir/


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING INSTALL README TROUBLESHOOT tconn.cat tconn.conf
%doc README.fedora
%_bindir/*
%_libdir/tconn*.so



%changelog
* Tue Jul 25 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:1.3-0.3.Beta
- removed the %%(id -u) from the buildroot; it adds unneeded clutter,
  is not required and you gain nothing with it
- fixed paths in 'tconn.cat'
- enhanced 'README.fedora'

* Mon Jul 24 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:1.3-0.2.Beta
- enhanced -fixup patch to put a optimization barrier after cleaning
  password data

* Mon Jul 24 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:1.3-0.1.Beta
- follow Fedora naming guidelines strictly; increased epoch

* Sat Apr 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1.3-5
- initial build
