summaryrefslogtreecommitdiff
path: root/system/atarisio/atarisio.SlackBuild
blob: 9d96a861c6441f72c884869bc0f192996b687b30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/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