slackbuilds_ponce/system/atarisio/atarisio.SlackBuild
2010-05-12 23:33:18 +02:00

87 lines
2.1 KiB
Bash

#!/bin/sh
# Slackware build script for atarisio
# Written by B. Watson (yalhcru@gmail.com)
# Modified by the SlackBuilds.org project.
PRGNAM=atarisio
VERSION=20080714
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
KERNEL=${KERNEL:-$(uname -r)}
KERNELPATH=${KERNELPATH:-/lib/modules/$KERNEL/build}
PKG_VERS=${VERSION}_$(echo $KERNEL | tr - _)
SRCVER=${SRCVER:-080714}
SETUID=${SETUID:-yes}
GROUP=${GROUP:-users}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$SRCVER
tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
cd $PRGNAM-$SRCVER
chown -R root:root .
chmod -R a-s,u+w,go+r-w .
sed -i "s/^\\(C.*FLAGS *= *\\)-g/\1$SLKCFLAGS/" Makefile
make
mkdir -p $PKG/usr/{include,bin} $PKG/lib/modules/$KERNEL/misc
make install INST_DIR=$PKG/usr MDIR=$PKG/lib/modules/$KERNEL/misc
# Hias forgot to add a couple of useful tools to his "make install" rule:
cp tools/{ataricom,atpdump,atr2atp,casinfo} $PKG/usr/bin
strip $PKG/usr/bin/*
chown -R root:root $PKG/usr/bin
if [ "$SETUID" = "yes" ]; then
chown root:$GROUP $PKG/usr/bin/{atariserver,atarixfer}
chmod 4710 $PKG/usr/bin/{atariserver,atarixfer}
else
chmod 0755 $PKG/usr/bin/{atariserver,atarixfer}
fi
# Doing it this way allows this script to work on 12.0 and 12.1 also.
mkdir -p $PKG/etc/udev/rules.d
sed 's/@GROUP@/'$GROUP'/g' < $CWD/999-$PRGNAM.rules.in > $PKG/etc/udev/rules.d/999-$PRGNAM.rules
mkdir -p $PKG/usr/man/man1
( cd $CWD/man
for i in *.1; do
gzip -9c $i > $PKG/usr/man/man1/$i.gz
done
)
mkdir -p $PKG/usr/doc/$PRGNAM-$PKG_VERS
cp $CWD/README.Slackware README LICENSE Changelog $PKG/usr/doc/$PRGNAM-$PKG_VERS
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKG_VERS/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKG_VERS-$ARCH-$BUILD$TAG.tgz