aboutsummaryrefslogtreecommitdiff
path: root/system/zfs-fuse/zfs-fuse.SlackBuild
blob: 5249af489d312ed569079a13d867d3ce48b93975 (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
#!/bin/sh

# Slackware build script for ZFS-Fuse
# Steven King revision date 2010/01/17
# Updated for 0.7.0 by rworkman on 20110403
# Updated for 20120201_6abfdcf by ponce on 20120923

PRGNAM=zfs-fuse
VERSION=20120201_6abfdcf
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

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

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

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
rm -rf $TMP/$PRGNAM-$VERSION
cd $TMP
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

# Patch for glib>=2.14
# http://zfs-fuse.net/issues/137
patch -p1 < $CWD/glibc-2.14.patch

cd src
  scons
  scons install install_dir=$PKG/usr/sbin
cd ..

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

# Install init script and zfsrc sample
mkdir -p $PKG/etc/rc.d
cat $CWD/rc.zfs-fuse > $PKG/etc/rc.d/rc.zfs-fuse.new
cat contrib/zfsrc > $PKG/etc/zfsrc.sample

mkdir -p $PKG/usr/man/man8
cp doc/*.8 $PKG/usr/man/man8
gzip -9 $PKG/usr/man/man8/*.8

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  BUGS CHANGES HACKING INSTALL LICENSE README* STATUS TESTING TODO \
  $PKG/usr/doc/$PRGNAM-$VERSION
find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.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 -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}