#!/bin/sh
# test we are root
if [ "$(id -u)" != "0" ]; then
   echo "run as root now exitting"
   exit 1
fi

# build dep of sane

export CFLAGS="-Os -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
export CXXFLAGS="-Os -pipe -fno-exceptions -fno-rtti -march=armv6zk \
-mtune=arm1176jzf-s -mfpu=vfp"

P=autoconf-archive
V=2019.01.06
SRC=$P-$V
USER=`cat /etc/sysconfig/tcuser`
LIST="compiletc squashfs-tools zsync wget xz git automake bash"   
    for Z in $LIST
    do 
    su -c "tce-load -i $Z" $USER
done

cd /tmp
su -c "/usr/local/bin/wget -nc --no-check-certificate \
http://mirror.lagoon.nc/gnu/$P/$SRC.tar.xz" $USER
xz -d $SRC*xz && tar xvf $SRC*tar
mkdir $P
cd $SRC
./configure --prefix=/usr/local
make -j5 # takes secs
make install-strip DESTDIR=/tmp/$P
cd /tmp

# main
#######
rm -rf $P/usr/local/share/info
cd $P/usr/local/share/doc 
rm -rf COPYING* README
cd /tmp

# TCZ them
###########
LIST="$P "
for Z in $LIST
do
	mksquashfs $Z $Z.tcz
	md5sum $Z.tcz > $Z.tcz.md5.txt
	cd $Z
	find usr -not -type d > /tmp/$Z.tcz.list
        sed 's|usr|/usr|g' -i /tmp/$Z.tcz.list
	cd /tmp
        zsyncmake $Z.tcz
done

ls -hal

echo 'Title:          autoconf-archive.tcz  
Description:    autoconf macros
Version:        2019.01.06
Author:         many see AUTHORS
Original-site:  http://www.gnu.org/software/autoconf-archive/
Copying-policy: GPL v3
Size:           768K		
Extension_by:   aus9
Tags:           m4 aclocal autoconf
Comments:       can be used by autogen.sh and related autoconf scripts
 
Change-log:     2020/11/13 original v 2019.01.06  on 12x 
Current:        2020/11/13  '> $P.tcz.info

