aboutsummaryrefslogtreecommitdiff
path: root/network/spideroak/spideroak.SlackBuild
blob: 68a4b03773622c0051e77eeeba28654cc71baf48 (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
#!/bin/sh

# Slackware build script of SpiderOak
# Written by Diogo Leal (diogo@diogoleal.com)

PRGNAM=spideroak
VERSION=${VERSION:-9909}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

case "$( uname -m )" in
  i?86) ARCH=i386 ;;
  arm*) ARCH=arm ;;
     *) ARCH=$( uname -m ) ;;
esac

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

if [ "$ARCH" = "x86_64" ]; then
  SRCARCH=amd64
  LIBDIRSUFFIX="64"
elif [ "$ARCH" = "i386" ]; then
  SRCARCH=i386
  LIBDIRSUFFIX=""
else
  printf "\n\n$ARCH is not supported...\n"
  exit 1
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT

cd $PKG
ar -x $CWD/spideroak_${VERSION}_${SRCARCH}.deb || ar -x $CWD/directdownload*$ARCH
tar xvf data.tar.gz
rm data.tar.gz control.tar.gz debian-binary
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

# Fix up libdir
if [ $ARCH = "x86_64" ]; then
  mv usr/lib usr/lib$LIBDIRSUFFIX
  sed -i "s|/lib/|/lib$LIBDIRSUFFIX/|g" usr/bin/SpiderOak
fi

# Kill some stuff we don't need/want
rm -rf $PKG/etc/apt

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv $PKG/usr/share/doc/$PRGNAM/* $PKG/usr/doc/$PRGNAM-$VERSION/
rm -r $PKG/usr/share/doc
cat $CWD/spideroak.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/spideroak.slackbuild

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

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