summaryrefslogtreecommitdiff
path: root/multimedia/plexmediaserver/plexmediaserver.SlackBuild
diff options
context:
space:
mode:
authorLionel Young <lionelyoung@gmail.com>2014-01-07 16:55:37 +0700
committerErik Hanson <erik@slackbuilds.org>2014-01-07 11:14:02 -0600
commitb5adf3e3679086fb3c88bb4ecec6b6e3da5ce79c (patch)
tree50def1b2231c72cc19030369320e5aaa977576ac /multimedia/plexmediaserver/plexmediaserver.SlackBuild
parentb11bacf5cb4978faf8b6e3f861ce49401a9cabf4 (diff)
downloadslackbuilds-b5adf3e3679086fb3c88bb4ecec6b6e3da5ce79c.tar.gz
multimedia/plexmediaserver: Updated for ver 0.9.8.18.290_11b7fdd.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'multimedia/plexmediaserver/plexmediaserver.SlackBuild')
-rw-r--r--multimedia/plexmediaserver/plexmediaserver.SlackBuild50
1 files changed, 29 insertions, 21 deletions
diff --git a/multimedia/plexmediaserver/plexmediaserver.SlackBuild b/multimedia/plexmediaserver/plexmediaserver.SlackBuild
index a7500077a0..fa58d42cf9 100644
--- a/multimedia/plexmediaserver/plexmediaserver.SlackBuild
+++ b/multimedia/plexmediaserver/plexmediaserver.SlackBuild
@@ -6,17 +6,24 @@
# Based on http://slackbuilds.org/template.SlackBuild
PRGNAM=plexmediaserver
-VERSION=${VERSION:-0.9.8.10.215-020456b}
-PKG_VERSION=0.9.8.10.215.020456b
+VERSION=${VERSION:-0.9.8.18.290_11b7fdd}
+PKG_VERSION=$(echo $VERSION | tr _ -)
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-ARCH=${ARCH:-$(uname -m)}
-if [ "$ARCH" = "i386" ]; then
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ "$ARCH" = "i486" ]; then
DEBARCH="i386"
LIBDIRSUFFIX=""
ARCH="i386"
-elif [ "$ARCH" = "i486" ]; then
+elif [ "$ARCH" = "i686" ]; then
DEBARCH="i386"
LIBDIRSUFFIX=""
ARCH="i386"
@@ -39,19 +46,8 @@ PLEX_GROUP=${PLEX_GROUP:-279}
set -e
-rm -rf $PKG
-mkdir -p $TMP $PKG $OUTPUT
-cd $PKG
-rm -rf $PRGNAM-$PKG_VERSION
-ar xv $CWD/${PRGNAM}_${VERSION}_${DEBARCH}.deb
-tar xvf data.tar.gz
-# Remove debian files
-rm -f debian-binary control.tar.gz data.tar.gz
-rm -rf $PKG/etc/apt/ $PKG/etc/init $PKG/etc/init.d
-chown -R root:root .
-
# Bail if user or group isn't valid on your system
-if ! grep ^plex: /etc/passwd 2>&1 > /dev/null; then
+if ! getent passwd plex 1>/dev/null 2>/dev/null; then
cat << EOF
@@ -63,7 +59,7 @@ cat << EOF
EOF
exit
-elif ! grep ^plex: /etc/group 2>&1 > /dev/null; then
+elif ! getent group plex 1>/dev/null 2>/dev/null; then
cat << EOF
@@ -74,6 +70,18 @@ EOF
exit
fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $PKG
+rm -rf $PRGNAM-$PKG_VERSION
+ar xv $CWD/${PRGNAM}_${PKG_VERSION}_${DEBARCH}.deb
+tar xvf data.tar.gz
+# Remove debian files
+rm -f debian-binary control.tar.gz data.tar.gz
+rm -rf $PKG/etc/apt/ $PKG/etc/init $PKG/etc/init.d
+chown -R root:root .
+
mkdir -p $PKG/opt/$PRGNAM/bin/
mv $PKG/usr/lib/plexmediaserver $PKG/opt/$PRGNAM/lib
@@ -95,8 +103,8 @@ ln -s /opt/$PRGNAM/plexmediamanager.desktop \
rm -rf $PKG/usr/share/doc $PKG/usr/sbin $PKG/usr/lib
-mkdir -p $PKG/usr/doc/$PRGNAM-$PKG_VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKG_VERSION/$PRGNAM.SlackBuild
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/var/lib/$PRGNAM
chown -R $PLEX_USER:$PLEX_GROUP $PKG/var/lib/$PRGNAM
@@ -111,4 +119,4 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh
# makepkg
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKG_VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}