summaryrefslogtreecommitdiff
path: root/development/hexinator/hexinator.SlackBuild
blob: 7966c38c297ac397362bf5c7b5d58566ceee7134 (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
#!/bin/sh

# Slackware build script for hexinator

# Written by B. Watson (yalhcru@gmail.com)

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

PRGNAM=hexinator
VERSION=${VERSION:-1.9_1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

RPMVER="$( echo $VERSION | sed 's/_/-/g' )"

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

case "$ARCH" in
  i?86)   RPMARCH=i386    ;;
  x86_64) RPMARCH="$ARCH" ;;
  *) echo "!!! Unsupported ARCH '$ARCH'. Only i586|i686|x86_64 allowed." 1>&2
     exit 1 ;;
esac

set -e

# No 'source' dir, extract directly to $PKG
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
mkdir -p $PKG
cd $PKG
rpm2cpio $CWD/$PRGNAM-$RPMVER.$RPMARCH.rpm | cpio -idmv
chown -R root:root .
find -L .  -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
        \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+

# No docs in the RPM, include our own README.
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $CWD/README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# The hexinator binary was built with rpath support, so it can find its
# own libraries. The libs need some attention before hexinator can find
# them (presumably rpm would automagically do this when the package gets
# installed). It's a qt5 app that ships with its own private set of qt5
# libs. We *don't* want it using any other qt5 libs that may happen to
# exist (like the ones in /usr/lib64 from the qt5 SlackBuild). The
# ldconfig step here prevents that.
chmod 755 $PKG/opt/$PRGNAM/lib/*
ldconfig -n -N $PKG/opt/$PRGNAM/lib

# Convenience symlink, for us command line freaks.
mkdir -p $PKG/usr/bin
ln -s /opt/$PRGNAM/bin/$PRGNAM $PKG/usr/bin/$PRGNAM

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}