View difference between Paste ID: Dythzi6i and w74RhMxU
SHOW: | | - or go back to the newest paste.
1
golly.SlackBuild:
2
3
#!/bin/sh
4
5
# Slackware build script for golly
6
7
# Copyright 2012, Glenn Becker, Arlington MA USA
8
# All rights reserved.
9
#
10
# Redistribution and use of this script, with or without modification, is
11
# permitted provided that the following conditions are met:
12
#
13
# 1. Redistributions of this script must retain the above copyright
14
#    notice, this list of conditions and the following disclaimer.
15
#
16
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
17
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
19
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
PRGNAM=golly
28
VERSION=${VERSION:-2.4-src}
29
BUILD=${BUILD:-1}
30
TAG=${TAG:-_SBo}
31
32
if [ -z "$ARCH" ]; then
33
  case "$( uname -m )" in
34
    i?86) ARCH=i486 ;;
35
    arm*) ARCH=arm ;;
36
       *) ARCH=$( uname -m ) ;;
37
  esac
38
fi
39
40
CWD=$(pwd)
41
TMP=${TMP:-/tmp/SBo}
42
PKG=$TMP/package-$PRGNAM
43
OUTPUT=${OUTPUT:-/tmp}
44
45
if [ "$ARCH" = "i486" ]; then
46
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
47
  LIBDIRSUFFIX=""
48
elif [ "$ARCH" = "i686" ]; then
49
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
50
  LIBDIRSUFFIX=""
51
elif [ "$ARCH" = "x86_64" ]; then
52
  SLKCFLAGS="-O2 -fPIC"
53
  LIBDIRSUFFIX="64"
54
else
55
  SLKCFLAGS="-O2"
56
  LIBDIRSUFFIX=""
57
fi
58
59
set -e
60
61
rm -rf $PKG
62
mkdir -p $TMP $PKG $OUTPUT
63
cd $TMP
64
rm -rf $PRGNAM-$VERSION
65
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
66
cd $PRGNAM-$VERSION
67
chown -R root:root .
68
find . \
69
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
70
 -exec chmod 755 {} \; -o \
71
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
72
 -exec chmod 644 {} \;
73
74
CFLAGS="$SLKCFLAGS" \
75
CXXFLAGS="$SLKCFLAGS" \
76
./configure \
77
  --prefix=/usr \
78
  --libdir=/usr/lib${LIBDIRSUFFIX} \
79
  --sysconfdir=/etc \
80
  --localstatedir=/var \
81
  --mandir=/usr/man \
82
  --docdir=/usr/doc/$PRGNAM-$VERSION \
83
  --build=$ARCH-slackware-linux
84
85
make
86
make install DESTDIR=$PKG
87
88
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
89
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
90
91
for i in 16 32 48; do
92
	convert appicon${i}.ico -resize ${i}x${i}! $PRGNAM-${i}.png
93
	mkdir -p $PKG/usr/share/icons/hicolor/${i}x${i}/apps/
94
	install -D -m 0644 $PRGNAM-${i}.png \
95
		$PKG/usr/share/icons/hicolor/${i}x${i}/apps/$PRGNAM.png
96
done
97
98
convert appicon.xpm $PRGNAM.png
99
install -D -m 0644 $PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
100
101
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
102
cp -a \
103
  LICENSE README TODO \
104
  $PKG/usr/doc/$PRGNAM-$VERSION
105
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
106
107
mkdir $PKG/usr/share/applications
108
cat $CWD/golly.desktop > $PKG/usr/share/applications/golly.desktop
109
110
mkdir -p $PKG/install
111
cat $CWD/slack-desc > $PKG/install/slack-desc
112
113
cd $PKG
114
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
115
116
117
slack-desc:
118
119
     |-----handy-ruler------------------------------------------------------|
120
golly: golly (Game of Life simulator)
121
golly:
122
golly: golly is an open source, cross-platform application for exploring
123
golly: Conway's Game of Life and other cellular automata. Supports bounded
124
golly: and unbounded universes, with cells of up to 256 states; supports
125
golly: multiple algorithms, including Bill Gosper's super fast hashlife
126
golly: algorithm.
127
golly:
128
golly:
129
golly:
130
golly: http://golly.sourceforge.net