1*c2c66affSColin Finck#!/bin/sh
2*c2c66affSColin Finck
3*c2c66affSColin Finckif [ -f rcmd.c ] ; then
4*c2c66affSColin Finck	cd ..
5*c2c66affSColin Finckfi
6*c2c66affSColin Finckwd=`pwd`
7*c2c66affSColin Finckfor f in libncftp sio Strn doc ; do
8*c2c66affSColin Finck	if [ ! -f "$f" ] && [ ! -d "$f" ] ; then
9*c2c66affSColin Finck		echo "Missing directory $f ?" 1>&2
10*c2c66affSColin Finck		exit 1
11*c2c66affSColin Finck	fi
12*c2c66affSColin Finckdone
13*c2c66affSColin Finck
14*c2c66affSColin Finck( cd libncftp ; make clean )
15*c2c66affSColin Finck
16*c2c66affSColin FinckTMPDIR=/tmp
17*c2c66affSColin Finckif [ "$#" -lt 2 ] ; then
18*c2c66affSColin Finck	TARDIR="libncftp"
19*c2c66affSColin Finck	STGZFILE="$TARDIR.tar.gz"
20*c2c66affSColin Finckelse
21*c2c66affSColin Finck	TARDIR="$1"
22*c2c66affSColin Finck	STGZFILE="$2"
23*c2c66affSColin Finckfi
24*c2c66affSColin Finck
25*c2c66affSColin Finckrm -rf $TMPDIR/TAR
26*c2c66affSColin Finckmkdir -p -m755 $TMPDIR/TAR/$TARDIR 2>/dev/null
27*c2c66affSColin Finck
28*c2c66affSColin Finckchmod 755 configure sh/* install-sh 2>/dev/null
29*c2c66affSColin Finck
30*c2c66affSColin Finckfind . -depth -follow -type f | sed '
31*c2c66affSColin Finck/sio\/configure$/d
32*c2c66affSColin Finck/Strn\/configure$/d
33*c2c66affSColin Finck/\.o$/d
34*c2c66affSColin Finck/\.so$/d
35*c2c66affSColin Finck/\.a$/d
36*c2c66affSColin Finck/\.lib$/d
37*c2c66affSColin Finck/\.ncb$/d
38*c2c66affSColin Finck/\.pdb$/d
39*c2c66affSColin Finck/\.idb$/d
40*c2c66affSColin Finck/\.pch$/d
41*c2c66affSColin Finck/\.ilk$/d
42*c2c66affSColin Finck/\.res$/d
43*c2c66affSColin Finck/\.aps$/d
44*c2c66affSColin Finck/\.opt$/d
45*c2c66affSColin Finck/\.plg$/d
46*c2c66affSColin Finck/\.obj$/d
47*c2c66affSColin Finck/\.exe$/d
48*c2c66affSColin Finck/\.zip$/d
49*c2c66affSColin Finck/\.gz$/d
50*c2c66affSColin Finck/\.tgz$/d
51*c2c66affSColin Finck/\.tar$/d
52*c2c66affSColin Finck/\.swp$/d
53*c2c66affSColin Finck/\.orig$/d
54*c2c66affSColin Finck/\.rej$/d
55*c2c66affSColin Finck/\/Makefile\.bin$/p
56*c2c66affSColin Finck/\.bin$/d
57*c2c66affSColin Finck/\/bin/d
58*c2c66affSColin Finck/\/core$/d
59*c2c66affSColin Finck/\/^[Rr]elease$/d
60*c2c66affSColin Finck/\/^[Dd]ebug$/d
61*c2c66affSColin Finck/\/sio\/.*\//d
62*c2c66affSColin Finck/shit/d
63*c2c66affSColin Finck/\/upload/d
64*c2c66affSColin Finck/\/config\.h\.in$/p
65*c2c66affSColin Finck/\/config\./d
66*c2c66affSColin Finck/\/Makefile$/d
67*c2c66affSColin Finck/\/OLD/d
68*c2c66affSColin Finck/\/old/d' | cut -c3- | tee "$wd/doc/manifest.txt" | cpio -Lpdm $TMPDIR/TAR/$TARDIR
69*c2c66affSColin Finck
70*c2c66affSColin Finck( cd "$TMPDIR/TAR/$TARDIR" ; ln -s doc/README.txt README )
71*c2c66affSColin Finck
72*c2c66affSColin Finckx=`tar --help 2>&1 | sed -n 's/.*owner=NAME.*/owner=NAME/g;/owner=NAME/p'`
73*c2c66affSColin Finckcase "$x" in
74*c2c66affSColin Finck	*owner=NAME*)
75*c2c66affSColin Finck		TARFLAGS="-c --owner=bin --group=bin --verbose -f"
76*c2c66affSColin Finck		TAR=tar
77*c2c66affSColin Finck		;;
78*c2c66affSColin Finck	*)
79*c2c66affSColin Finck		TARFLAGS="cvf"
80*c2c66affSColin Finck		TAR=tar
81*c2c66affSColin Finck		x2=`gtar --help 2>&1 | sed -n 's/.*owner=NAME.*/owner=NAME/g;/owner=NAME/p'`
82*c2c66affSColin Finck		case "$x2" in
83*c2c66affSColin Finck			*owner=NAME*)
84*c2c66affSColin Finck				TARFLAGS="-c --owner=bin --group=bin --verbose -f"
85*c2c66affSColin Finck				TAR=gtar
86*c2c66affSColin Finck				;;
87*c2c66affSColin Finck		esac
88*c2c66affSColin Finck		;;
89*c2c66affSColin Finckesac
90*c2c66affSColin Finck
91*c2c66affSColin Finck( cd $TMPDIR/TAR ; $TAR $TARFLAGS - $TARDIR | gzip -c > $STGZFILE )
92*c2c66affSColin Finckcp $TMPDIR/TAR/$STGZFILE .
93*c2c66affSColin Finckchmod 644 $STGZFILE
94*c2c66affSColin Finckrm -rf $TMPDIR/TAR
95*c2c66affSColin Finckls -l $STGZFILE 2>/dev/null
96*c2c66affSColin Finckmv $TGZFILE newbin/ 2>/dev/null
97*c2c66affSColin Finckexit 0
98