Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2014 19:38:06 +0000 (UTC)
From:      Kris Moore <kmoore@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r367384 - in head/emulators/pipelight: . files
Message-ID:  <201409051938.s85Jc6gr093919@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmoore
Date: Fri Sep  5 19:38:06 2014
New Revision: 367384
URL: http://svnweb.freebsd.org/changeset/ports/367384
QAT: https://qat.redports.org/buildarchive/r367384/

Log:
  - Add pipelight-mkufs script for users on ZFS
  - Add pkg-message for initial pipelight setup / usage
  - Bump PORTREV

Added:
  head/emulators/pipelight/files/
  head/emulators/pipelight/files/pipelight-mkufs.in   (contents, props changed)
  head/emulators/pipelight/pkg-message   (contents, props changed)
Modified:
  head/emulators/pipelight/Makefile
  head/emulators/pipelight/pkg-plist

Modified: head/emulators/pipelight/Makefile
==============================================================================
--- head/emulators/pipelight/Makefile	Fri Sep  5 19:32:58 2014	(r367383)
+++ head/emulators/pipelight/Makefile	Fri Sep  5 19:38:06 2014	(r367384)
@@ -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>

Added: head/emulators/pipelight/files/pipelight-mkufs.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/pipelight/files/pipelight-mkufs.in	Fri Sep  5 19:38:06 2014	(r367384)
@@ -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"

Added: head/emulators/pipelight/pkg-message
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/pipelight/pkg-message	Fri Sep  5 19:38:06 2014	(r367384)
@@ -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>

Modified: head/emulators/pipelight/pkg-plist
==============================================================================
--- head/emulators/pipelight/pkg-plist	Fri Sep  5 19:32:58 2014	(r367383)
+++ head/emulators/pipelight/pkg-plist	Fri Sep  5 19:38:06 2014	(r367384)
@@ -1,4 +1,5 @@
 bin/pipelight-plugin
+bin/pipelight-mkufs
 lib/pipelight/libpipelight.so
 man/man1/pipelight-plugin.1.gz
 %%DATADIR%%/configs/pipelight-adobereader



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409051938.s85Jc6gr093919>