#!/bin/sh
# we build:
# ucspi-tcp-0.88.tar.gz

CWD=`pwd`

test -d ucspi-tcp-0.88 && rm -rf ucspi-tcp-0.88
mkdir -p "$DST/bin" "$DST/man/man1" 
ut ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88
bzcat ../ucspi-tcp-0.88-ipv6.diff14.bz2 | patch -p1
bzcat ../ucspi-tcp-0.88-rbl.diff.bz2 | patch -p1

echo "$CC $CFLAGS"    > conf-cc
echo "$CC $CFLAGS -s" > conf-ld
echo "$DST"           > conf-home

make it

for i in `cat ../ucspi-tcp.list`; do
 rm -f "$DST/bin/$i" "/command/$i"
 cp -f $i "$DST/bin/$i"
 test -f $i.1 && cat $i.1 | gzip -9 > "$DST/man/man1/$i.1.gz"
 ln -s "$DST/bin/$i" "/command/$i"
 strip -R .note -R .comment "$DST/bin/$i" 2>/dev/null
done

sync
