--- squid-2.4.STABLE6-6.7.3.spec	Thu Nov 14 21:00:37 2002
+++ squid-ipv6-20021114cvs-1.spec	Thu Nov 14 22:35:24 2002
@@ -1,29 +1,49 @@
+%define squidipv6cvs 20021114
+%define ipv6cvs	1
 Summary: The Squid proxy caching server.
-Name: squid
+%if %{ipv6cvs}
+Name: squid-ipv6
+Version: %{squidipv6cvs}cvs
+Release: 1.7.3
+Serial: 1
+%else
 Version: 2.4.STABLE6
 Release: 6.7.3
-Serial: 7
+%endif
 License: GPL
 Group: System Environment/Daemons
+%if %{ipv6cvs}
+Source: squid-ipv6-%{squidipv6cvs}cvs.tgz
+%else
 Source: http://www.squid-cache.org/Squid/v2/squid-%{version}-src.tar.gz
+%endif
 Source1: http://www.squid-cache.org/Squid/FAQ/FAQ.sgml
 Source2: squid.init
 Source3: squid.logrotate
 Source4: squid.sysconfig
 Source10: msntauth-v2.0.3-squid.1.tar.gz
+%if %{ipv6cvs}
+Patch0: squid-2.5-make.patch
+Patch1: squid-2.5-config.patch
+Patch3: squid-2.5-location.patch
+%else
 Patch0: squid-2.1-make.patch
 Patch1: squid-2.4-config.patch
-Patch2: squid-perlpath.patch
 Patch3: squid-location.patch
 Patch10: squid-2.4.STABLE6-deny_transfer_encoding.patch
 Patch11: squid-2.4.STABLE6-ftp_directories.patch
 Patch12: squid-2.4.STABLE6-ftp_sanitycheck.patch
 Patch13: squid-2.4.STABLE6-gopher.patch
 Patch14: squid-2.4.STABLE6-proxy_auth.patch
+%endif
+Patch2: squid-perlpath.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 Prereq: /sbin/chkconfig logrotate shadow-utils
 Requires: bash >= 2.0
-BuildPrereq: openjade sgml-tools openldap-devel pam-devel
+BuildPrereq: openjade openldap-devel pam-devel
+%if %{ipv6cvs}
+BuildPrereq: automake15
+%endif
 Obsoletes: squid-novm
 
 %description
@@ -37,8 +57,41 @@
 Squid consists of a main server program squid, a Domain Name System
 lookup program (dnsserver), a program for retrieving FTP data
 (ftpget), and some management and client tools.
+%if %{ipv6cvs}
+with IPv6 support
+%endif
 
 %prep
+%if %{ipv6cvs}
+%setup -q 
+
+# Patch bootstrap.sh
+cat << END_bootstrap | patch bootstrap.sh
+--- bootstrap.sh.orig   Thu Nov 14 20:30:30 2002
++++ bootstrap.sh        Thu Nov 14 20:30:53 2002
+@@ -20,9 +20,9 @@
+ mkdir -p cfgaux
+
+ # Bootstrap the autotool subsystems
+-bootstrap aclocal
++bootstrap aclocal-1.5
+ bootstrap autoheader
+-bootstrap automake --foreign --add-missing
++bootstrap automake-1.5 --foreign --add-missing
+ bootstrap autoconf
+ echo "Autotool bootstrapping complete."
+END_bootstrap
+
+# Run bootstrap.sh
+./bootstrap.sh
+
+%patch0 -p1 -b .make
+%patch1 -p1 -b .config
+%patch2 -p1 -b .perlpath
+%patch3 -p1
+
+
+%else
 %setup -q -a 10
 %patch0 -p1 -b .make
 %patch1 -p1 -b .config
@@ -53,16 +106,25 @@
 rm -rf auth_moudles/MSNT/*
 mv msntauth-v2.0.3-squid.1/* auth_modules/MSNT/
 rm -rf msntauth-v2.0.3-squid.1
+%endif
 
 %build
 %configure \
    --exec_prefix=/usr --bindir=/usr/sbin --libexecdir=/usr/lib/squid \
    --localstatedir=/var --sysconfdir=/etc/squid \
-   --enable-poll --enable-snmp --enable-removal-policies="heap,lru" \
-   --enable-storeio="aufs,coss,diskd,ufs" \
-   --enable-delay-pools --enable-linux-netfilter \
+   --enable-poll --enable-removal-policies="heap,lru" \
    --with-pthreads \
+%if %{ipv6cvs}
+   --enable-storeio="aufs,diskd,ufs" \
+   --enable-ipv6 \
+   --enable-basic-auth-helpers="LDAP,NCSA,PAM,SMB,MSNT"  # --enable-icmp
+%else
+   --enable-delay-pools \	# not compiling with IPv6 support
+   --enable-snmp \		# not compiling with IPv6 support
+   --enable-linux-netfilter \	# not compiling with IPv6 support
+   --enable-storeio="aufs,coss,diskd,ufs" \	# "coss" not compiling with IPv6 support
    --enable-auth-modules="LDAP,NCSA,PAM,SMB,MSNT"  # --enable-icmp
+%endif
    
 # Some versions of autoconf fail to detect sys/resource.h correctly;
 # apparently because it generates a compiler warning.
@@ -76,12 +138,19 @@
 EOF
 fi
 
+%if %{ipv6cvs}
+make
+%else
 make -f makefile
+%endif
 
+%if %{ipv6cvs}
+%else
 mkdir faq
 cp $RPM_SOURCE_DIR/FAQ.sgml faq
 cd faq 
 sgml2html FAQ.sgml
+%endif
 
 #cd ..
 #cd auth_modules
@@ -106,7 +175,10 @@
 	libexecdir=$RPM_BUILD_ROOT/usr/lib/squid
 #install -m 4750 src/pinger $RPM_BUILD_ROOT/usr/lib/squid
 
+%if %{ipv6cvs}
+%else
 mv $RPM_BUILD_ROOT/usr/sbin/*auth $RPM_BUILD_ROOT/usr/lib/squid
+%endif
 
 cd errors
 rm -rf $RPM_BUILD_ROOT/etc/squid/errors
@@ -114,7 +186,9 @@
 for i in *; do
    if [ -d $i ]; then
        mkdir -p $RPM_BUILD_ROOT/usr/lib/squid/errors/$i
-       install -m 644 $i/* $RPM_BUILD_ROOT/usr/lib/squid/errors/$i
+       find $i -type f | while read file; do
+           install -m 644 $file $RPM_BUILD_ROOT/usr/lib/squid/errors/$i
+       done
    fi
 done
 ln -s /usr/lib/squid/errors/English $RPM_BUILD_ROOT/etc/squid/errors
@@ -258,6 +332,9 @@
 fi
 
 %changelog
+* Thu Nov 14 2002 Dr. Peter Bieringer <pb at bieringer dot de> 20021114cvs-1.7.3
+- enable IPv6
+
 * Tue Jun 25 2002 Bill Nottingham <notting@redhat.com>
 - add various upstream bugfix patches
 
