aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/pipelight
diff options
context:
space:
mode:
authorkmoore <kmoore@FreeBSD.org>2014-09-06 03:38:06 +0800
committerkmoore <kmoore@FreeBSD.org>2014-09-06 03:38:06 +0800
commit9536e59956bffe6ae9fffb6a06e5717fdeda5600 (patch)
tree9badd6b022c4c85db6fed5f658be533aa21a27ec /emulators/pipelight
parent5494e0e110a17054ed1501fab66acadd63da5bc8 (diff)
downloadfreebsd-ports-graphics-9536e59956bffe6ae9fffb6a06e5717fdeda5600.tar.gz
freebsd-ports-graphics-9536e59956bffe6ae9fffb6a06e5717fdeda5600.tar.zst
freebsd-ports-graphics-9536e59956bffe6ae9fffb6a06e5717fdeda5600.zip
- Add pipelight-mkufs script for users on ZFS
- Add pkg-message for initial pipelight setup / usage - Bump PORTREV
Diffstat (limited to 'emulators/pipelight')
-rw-r--r--emulators/pipelight/Makefile7
-rw-r--r--emulators/pipelight/files/pipelight-mkufs.in94
-rw-r--r--emulators/pipelight/pkg-message18
-rw-r--r--emulators/pipelight/pkg-plist1
4 files changed, 119 insertions, 1 deletions
diff --git a/emulators/pipelight/Makefile b/emulators/pipelight/Makefile
index 4d409f6a1cb..29be1a77532 100644
--- a/emulators/pipelight/Makefile
+++ b/emulators/pipelight/Makefile
@@ -3,7 +3,7 @@
PORTNAME= pipelight
DISTVERSION= 0.2.7.3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= emulators
MASTER_SITES= https://bitbucket.org/mmueller2012/pipelight/get/ \
http://repos.fds-team.de/pluginloader/v${DISTVERSION}/:plg
@@ -44,6 +44,8 @@ bash_OLD_CMD= /usr/bin/env bash
SHEBANG_FILES= configure \
share/install-dependency
+SUB_FILES= pipelight-mkufs
+
.include <bsd.port.pre.mk>
.if ${ARCH} == "i386"
@@ -58,4 +60,7 @@ pre-configure:
${LN} -s ${DISTDIR}/${DIST_SUBDIR}/pluginloader.tar.gz ${WRKSRC}/pluginloader-v${DISTVERSION}.tar.gz
${LN} -s ${DISTDIR}/${DIST_SUBDIR}/pluginloader.tar.gz.sig ${WRKSRC}/pluginloader-v${DISTVERSION}.tar.gz.sig
+post-install:
+ @${INSTALL_SCRIPT} ${WRKDIR}/pipelight-mkufs ${STAGEDIR}${PREFIX}/bin/
+
.include <bsd.port.post.mk>
diff --git a/emulators/pipelight/files/pipelight-mkufs.in b/emulators/pipelight/files/pipelight-mkufs.in
new file mode 100644
index 00000000000..449f6aa5b22
--- /dev/null
+++ b/emulators/pipelight/files/pipelight-mkufs.in
@@ -0,0 +1,94 @@
+#!/bin/sh
+# Helper script for ZFS users that want to view DRM protected content
+# with pipelight
+# Author: Kris Moore <kris@pcbsd.org>
+# License: BSD
+
+destroy_old()
+{
+ umount ${userhome}/.wine-pipelight
+ zfs destroy ${zpool}/$username-pipelight
+ cat /etc/fstab | grep -v "$zpool/$username-pipelight " > /etc/fstab.new
+ mv /etc/fstab.new /etc/fstab
+}
+
+if [ -z "$1" ] ; then
+ echo "Create UFS formatted ZVOL:
+${0} <username>
+
+Remove UFS formatted ZVOL:
+${0} --remove <username>"
+ exit 1
+fi
+
+doDestroy=0
+if [ "$1" = '--remove' ] ; then
+ doDestroy=1
+ username="$2"
+else
+ username="$1"
+fi
+
+# Get users HOME
+userhome=`cat /etc/passwd | grep "^$username:" | cut -d ':' -f 6`
+if [ -z "$userhome" ] ; then
+ echo "No such user: $userhome"
+ exit 1
+fi
+if [ ! -d "$userhome" ] ; then
+ echo "No such home directory: $userhome"
+ exit 1
+fi
+
+zpool=`mount | grep 'on / ' | awk '{print $1}' | cut -d '/' -f 1`
+if [ -z "$zpool" ] ; then
+ echo "Unable to detect zpool!"
+ exit 1
+fi
+
+# If the user wants to remove the zvol
+if [ $doDestroy -eq 1 ] ; then
+ destroy_old
+ exit 0
+fi
+
+# Running this on a user which already has the file-system, lets remove it first
+zfs list ${zpool}/$username-pipelight >/dev/null 2>/dev/null
+if [ $? -eq 0 ] ; then
+ echo "Removing old UFS ZVOL"
+ destroy_old
+fi
+
+# Create the ZVOL
+zfs create -V 200M $zpool/$username-pipelight
+if [ $? -ne 0 ] ; then
+ echo "Failed creating ZVOL"
+ exit 1
+fi
+
+# Format it with UFS
+newfs -U /dev/zvol/$zpool/$username-pipelight
+if [ $? -ne 0 ] ; then
+ echo "Failed formatting ZVOL"
+ exit 1
+fi
+
+# Create the directory
+if [ ! -d "${userhome}/.wine-pipelight" ] ; then
+ mkdir ${userhome}/.wine-pipelight
+fi
+
+# Mount the directory
+mount /dev/zvol/$zpool/$username-pipelight ${userhome}/.wine-pipelight
+if [ $? -ne 0 ] ; then
+ echo "Failed mounting ZVOL"
+ exit 1
+fi
+
+# Chown the directory
+chown $username:$username ${userhome}/.wine-pipelight
+
+# Save to fstab
+echo "/dev/zvol/$zpool/$username-pipelight ${userhome}/.wine-pipelight ufs rw 0 0" >> /etc/fstab
+
+echo "ZVOL created and mounted to: ${userhome}/.wine-pipelight"
diff --git a/emulators/pipelight/pkg-message b/emulators/pipelight/pkg-message
new file mode 100644
index 00000000000..a375d3f2487
--- /dev/null
+++ b/emulators/pipelight/pkg-message
@@ -0,0 +1,18 @@
+This port installs the Pipelight plugin wrapper for running Silverlight,
+Flash and others. Before enabling Pipelight for your users, run the
+following as root:
+
+# pipelight-plugins --create-mozilla-plugins
+
+NOTE:
+
+For users running with ZFS on root, watching DRM protected content
+requires extensive xattr support. If you run into issues with DRM failing,
+you can use the "pipelight-mkufs" command to create a UFS formatted ZVOL
+mounted on your users ~/.wine-pipelight directory.
+
+To create the UFS filesystem
+# pipelight-mkufs <username>
+
+To remove the UFS filesystem
+# pipelight-mkufs --delete <username>
diff --git a/emulators/pipelight/pkg-plist b/emulators/pipelight/pkg-plist
index 27b0a771b89..e970ee94a6f 100644
--- a/emulators/pipelight/pkg-plist
+++ b/emulators/pipelight/pkg-plist
@@ -1,4 +1,5 @@
bin/pipelight-plugin
+bin/pipelight-mkufs
lib/pipelight/libpipelight.so
man/man1/pipelight-plugin.1.gz
%%DATADIR%%/configs/pipelight-adobereader