#!/bin/sh
# Set initial variables:
CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-git
VERSION=4.3.20
ARCH=alpha
BUILD=1
TARGET=$ARCH-alphaslack-linux

rm -rf $PKG
mkdir -p $PKG
( cd $TMP
rm -rf git-$VERSION
tar xzf $CWD/git-$VERSION.tar.gz
cd git-$VERSION
chown -R root.root .
./configure \
    --prefix=/usr \
    $TARGET
make
# now we spam ur root for correct install in $PKG
make install
make DESTDIR=$PKG install
chown -R root.bin $PKG/usr/bin
cp -a README AUTHORS COPYING ChangeLog PLATFORMS PROBLEMS LSM $PKG/usr/doc/git-$VERSION
gzip -9 $PKG/usr/man/man1/*
rm -rf $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*
strip --strip-unneeded $PKG/usr/bin/* 2> /dev/null
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
makepkg -l y -c n $TMP/git-$VERSION-$ARCH-$BUILD.tgz
) 2>&1 | tee $TMP/git.build.log
