aboutsummaryrefslogtreecommitdiff
path: root/multimedia/freevo/files
diff options
context:
space:
mode:
authorBeech Rintoul <beech@FreeBSD.org>2009-02-02 03:24:19 +0000
committerBeech Rintoul <beech@FreeBSD.org>2009-02-02 03:24:19 +0000
commit2e043352fc704b3e29d701cf1657cbe2ef671693 (patch)
tree049ab6548a3aaf5a62f0f98512774a96d2eef2ea /multimedia/freevo/files
parent1fffaf78873877e353b29bbec4e01b6ec1d2a504 (diff)
downloadports-2e043352fc704b3e29d701cf1657cbe2ef671693.tar.gz
ports-2e043352fc704b3e29d701cf1657cbe2ef671693.zip
Notes
Diffstat (limited to 'multimedia/freevo/files')
-rw-r--r--multimedia/freevo/files/freevo-rcsubr.in61
-rw-r--r--multimedia/freevo/files/freevo.in55
-rw-r--r--multimedia/freevo/files/freevo.sh.sample26
-rw-r--r--multimedia/freevo/files/patch-freevo20
-rw-r--r--multimedia/freevo/files/patch-local_conf.py.example61
-rw-r--r--multimedia/freevo/files/patch-src-plugins-autoshutdown.py11
-rw-r--r--multimedia/freevo/files/patch-src-plugins-rom_drives.py11
-rw-r--r--multimedia/freevo/files/patch-src-www-configlib.py11
-rw-r--r--multimedia/freevo/files/pkg-deinstall.in25
-rw-r--r--multimedia/freevo/files/pkg-install.in51
-rw-r--r--multimedia/freevo/files/pkg-message.in38
11 files changed, 262 insertions, 108 deletions
diff --git a/multimedia/freevo/files/freevo-rcsubr.in b/multimedia/freevo/files/freevo-rcsubr.in
new file mode 100644
index 000000000000..8e82488e3e94
--- /dev/null
+++ b/multimedia/freevo/files/freevo-rcsubr.in
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# PROVIDE: freevo
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Uses the following /etc/rc.conf variables:
+# freevo_enable="YES" master on/off
+# freevo_recordserver_enable="YES" start freevo record server
+# freevo_webserver_enable="YES" start freevo web server
+# freevo_gui_enable="YES" start freevo GUI
+#
+
+. /etc/rc.subr
+
+name=freevo
+rcvar=`set_rcvar`
+
+load_rc_config $name
+: ${freevo_enable="NO"}
+: ${freevo_recordserver_enable="NO"}
+: ${freevo_webserver_enable="NO"}
+: ${freevo_gui_enable="NO"}
+
+freevo_user=${freevo_user:-"freevo"}
+freevo_group=${freevo_group:-"freevo"}
+freevo_uid=`pw usershow ${freevo_user} | awk -F: '{print $3}'`
+
+command=%%PREFIX%%/bin/freevo
+command_interpreter=%%PREFIX%%/bin/python2.5
+_interpbn=python
+
+case "$1" in
+fast*) freevo_cmd=`expr "$1" : 'fast\(.*\)'` ;;
+*) freevo_cmd="$1" ;;
+esac
+
+name=freevo_recordserver
+rcvar=${name}_enable
+eval ${name}_user=${freevo_user}
+eval ${name}_group=${freevo_group}
+pidfile=/var/run/freevo/recordserver-${freevo_uid}.pid
+command_args="recordserver ${freevo_cmd}"
+run_rc_command "$1"
+
+name=freevo_webserver
+rcvar=${name}_enable
+eval ${name}_user=${freevo_user}
+eval ${name}_group=${freevo_group}
+pidfile=/var/run/freevo/webserver-${freevo_uid}.pid
+command_args="webserver ${freevo_cmd}"
+run_rc_command "$1"
+
+name=freevo_gui
+rcvar=${name}_enable
+eval ${name}_user=${freevo_user}
+eval ${name}_group=${freevo_group}
+pidfile=/var/run/freevo/freevo-${freevo_uid}.pid
+command_args="${freevo_cmd}"
+run_rc_command "$1"
+
diff --git a/multimedia/freevo/files/freevo.in b/multimedia/freevo/files/freevo.in
new file mode 100644
index 000000000000..67c752654dbc
--- /dev/null
+++ b/multimedia/freevo/files/freevo.in
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# PROVIDE: freevo
+# REQUIRE: DAEMON lircd
+# KEYWORD: shutdown
+#
+# Uses the following /etc/rc.conf variables:
+# freevo_enable="YES" master on/off
+# freevo_recordserver_enable="YES" start freevo record server
+# freevo_webserver_enable="YES" start freevo web server
+# freevo_gui_enable="YES" start freevo GUI
+#
+
+. /etc/rc.subr
+
+name=freevo
+rcvar=`set_rcvar`
+
+load_rc_config $name
+: ${freevo_enable="NO"}
+: ${freevo_recordserver_enable="NO"}
+: ${freevo_webserver_enable="NO"}
+: ${freevo_gui_enable="NO"}
+
+freevo_user=${freevo_user:-"freevo"}
+freevo_group=${freevo_group:-"freevo"}
+freevo_uid=`pw usershow ${freevo_user} | awk -F: '{print $3}'`
+freevo_dir=`pw usershow ${freevo_user} | awk -F: '{print $9}'`
+
+command=%%PREFIX%%/bin/freevo
+command_interpreter="%%PREFIX%%/bin/python2.5"
+
+cd ${freevo_dir}
+
+case "$1" in
+start)
+ [ ${freevo_recordserver_enable} = "YES" ] && su ${freevo_user} -c "${command} recordserver start"
+ [ ${freevo_webserver_enable} = "YES" ] && su ${freevo_user} -c "${command} webserver start"
+ [ ${freevo_gui_enable} = "YES" ] && su ${freevo_user} -c "${command} start"
+ ;;
+stop)
+ [ ${freevo_recordserver_enable} = "YES" ] && su ${freevo_user} -c "${command} recordserver stop"
+ [ ${freevo_webserver_enable} = "YES" ] && su ${freevo_user} -c "${command} webserver stop"
+ [ ${freevo_gui_enable} = "YES" ] && su ${freevo_user} -c "${command} stop"
+ ;;
+restart)
+ [ ${freevo_recordserver_enable} = "YES" ] && su ${freevo_user} -c "${command} recordserver stop"
+ [ ${freevo_webserver_enable} = "YES" ] && su ${freevo_user} -c "${command} webserver stop"
+ [ ${freevo_gui_enable} = "YES" ] && su ${freevo_user} -c "${command} stop"
+ [ ${freevo_recordserver_enable} = "YES" ] && su ${freevo_user} -c "${command} recordserver start"
+ [ ${freevo_webserver_enable} = "YES" ] && su ${freevo_user} -c "${command} webserver start"
+ [ ${freevo_gui_enable} = "YES" ] && su ${freevo_user} -c "${command} start"
+ ;;
+esac
+
diff --git a/multimedia/freevo/files/freevo.sh.sample b/multimedia/freevo/files/freevo.sh.sample
deleted file mode 100644
index f7059746a465..000000000000
--- a/multimedia/freevo/files/freevo.sh.sample
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-PREFIX=%%PREFIX%%
-RUN="/usr/bin/su freevo -c"
-PATH=${PATH}:%%PREFIX%%/bin
-
-case "$1" in
-start)
- ${RUN} "${PREFIX}/bin/freevo recordserver start" \
- && echo -n " freevo-recordserver"
- ${RUN} "${PREFIX}/bin/freevo webserver start" \
- && echo -n " freevo-webserver"
- ${RUN} "${PREFIX}/bin/freevo -fs start" > /dev/null 2>&1 &
- echo -n " freevo"
- ;;
-stop)
- ${RUN} "${PREFIX}/bin/freevo stop"
- ${RUN} "${PREFIX}/bin/freevo webserver stop"
- ${RUN} "${PREFIX}/bin/freevo recordserver stop"
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/multimedia/freevo/files/patch-freevo b/multimedia/freevo/files/patch-freevo
new file mode 100644
index 000000000000..c32689fdb96a
--- /dev/null
+++ b/multimedia/freevo/files/patch-freevo
@@ -0,0 +1,20 @@
+--- freevo.orig 2009-01-11 15:50:59.000000000 -0500
++++ freevo 2009-01-13 21:39:10.000000000 -0500
+@@ -156,7 +156,7 @@
+ get pid of running 'name'
+ """
+ _debug_('getpid(name=%r, arg=%r)' % (name, arg))
+- for fname in ('/var/run/' + name + '-%s.pid' % os.getuid(),
++ for fname in ('/var/run/freevo/' + name + '-%s.pid' % os.getuid(),
+ '/tmp/' + name + '-%s.pid' % os.getuid()):
+ if os.path.isfile(fname):
+ f = open(fname)
+@@ -259,7 +259,7 @@
+ if pid:
+ if store:
+ try:
+- f = open('/var/run/' + name + '-%s.pid' % os.getuid(), 'w')
++ f = open('/var/run/freevo/' + name + '-%s.pid' % os.getuid(), 'w')
+ except (OSError, IOError):
+ f = open('/tmp/' + name + '-%s.pid' % os.getuid(), 'w')
+
diff --git a/multimedia/freevo/files/patch-local_conf.py.example b/multimedia/freevo/files/patch-local_conf.py.example
deleted file mode 100644
index 3866cec397ab..000000000000
--- a/multimedia/freevo/files/patch-local_conf.py.example
+++ /dev/null
@@ -1,61 +0,0 @@
---- local_conf.py.example Mon Jan 24 00:04:02 2005
-+++ local_conf.py.example Tue Sep 20 20:24:12 2005
-@@ -92,6 +92,15 @@
- # ENABLE_SHUTDOWN_SYS = 0
-
- #
-+# FreeBSD shutdown-specific options.
-+#
-+# SHUTDOWN_SYS_CMD = '/sbin/shutdown -p now'
-+# RESTART_SYS_CMD = '/sbin/shutdown -r now'
-+#
-+# You might consider installing sudo and having:
-+# SHUTDOWN_SYS_CMD = '/usr/local/bin/sudo /sbin/...'
-+
-+#
- # You can add more keybindings by adding them to the correct hash.
- # e.g. If you want to send 'contrast -100' to mplayer by pressing the '1' key,
- # just add the following line:
-@@ -126,6 +135,7 @@
- # Freevo can write to.
- #
- # OVERLAY_DIR = os.path.join(FREEVO_CACHEDIR, 'vfs')
-+OVERLAY_DIR = os.path.join(FREEVO_CACHEDIR, 'vfs')
-
- #
- # Umask setting for all files.
-@@ -133,6 +143,7 @@
- # installation with different users, set this to 002
- #
- # UMASK = 022
-+UMASK = 002
-
- #
- # Suffix for playlist files
-@@ -195,6 +206,18 @@
- # Enable this for joystick support:
- # plugin.activate('joy')
-
-+#
-+# Extra FreeBSD default plugins (all detailed on the Freevo Wiki's
-+# PluginInfo page):
-+plugin.activate('idlebar')
-+#plugin.activate('idlebar.mail')
-+plugin.activate('idlebar.tv')
-+#plugin.activate('idlebar.weather', level=30, args=('CODE'))
-+plugin.activate('idlebar.clock')
-+plugin.activate('idlebar.cdstatus')
-+plugin.activate('idlebar.holidays')
-+plugin.activate('idlebar.sensors')
-+
- # ======================================================================
- # Freevo directory settings:
- # ======================================================================
-@@ -231,6 +254,7 @@
- # Smart sorting ignores the word "The" in item names.
- #
- # DIRECTORY_SMART_SORT = 0
-+DIRECTORY_SMART_SORT = 1
-
- #
- # Should Freevo autoplay an item if only one item is in the directory?
diff --git a/multimedia/freevo/files/patch-src-plugins-autoshutdown.py b/multimedia/freevo/files/patch-src-plugins-autoshutdown.py
new file mode 100644
index 000000000000..5a7f6904ecc0
--- /dev/null
+++ b/multimedia/freevo/files/patch-src-plugins-autoshutdown.py
@@ -0,0 +1,11 @@
+--- src/plugins/autoshutdown.py.orig 2008-03-22 07:42:02.000000000 -0400
++++ src/plugins/autoshutdown.py 2009-01-13 21:39:21.000000000 -0500
+@@ -632,7 +632,7 @@
+ @returns: True/False
+ """
+ _debug_('__is_recordserver_remote()', 2)
+- if len(glob.glob('/var/run/recordserver*.pid')) > 0:
++ if len(glob.glob('/var/run/freevo/recordserver*.pid')) > 0:
+ return False
+ elif len(glob.glob('/tmp/recordserver*.pid')) > 0:
+ return False
diff --git a/multimedia/freevo/files/patch-src-plugins-rom_drives.py b/multimedia/freevo/files/patch-src-plugins-rom_drives.py
deleted file mode 100644
index 2ac0b75496e8..000000000000
--- a/multimedia/freevo/files/patch-src-plugins-rom_drives.py
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/plugins/rom_drives.py.orig Sun Oct 16 18:18:49 2005
-+++ src/plugins/rom_drives.py Sun Feb 26 17:59:30 2006
-@@ -70,7 +70,7 @@
- # FreeBSD ioctls - there is no CDROM.py...
- CDIOCEJECT = 0x20006318
- CDIOCCLOSE = 0x2000631c
-- CDIOREADTOCENTRYS = 0xc0086305
-+ CDIOREADTOCENTRYS = -1073192187
- CD_LBA_FORMAT = 1
- CD_MSF_FORMAT = 2
- CDS_NO_DISC = 1
diff --git a/multimedia/freevo/files/patch-src-www-configlib.py b/multimedia/freevo/files/patch-src-www-configlib.py
new file mode 100644
index 000000000000..f1a6ed1658ab
--- /dev/null
+++ b/multimedia/freevo/files/patch-src-www-configlib.py
@@ -0,0 +1,11 @@
+--- src/www/configlib.py.orig 2008-02-21 15:49:20.000000000 -0500
++++ src/www/configlib.py 2009-01-13 21:39:28.000000000 -0500
+@@ -53,7 +53,7 @@
+ """
+ get pid of running 'name'
+ """
+- for fname in ('/var/run/' + name + '-%s.pid' % os.getuid(),
++ for fname in ('/var/run/freevo/' + name + '-%s.pid' % os.getuid(),
+ '/tmp/' + name + '-%s.pid' % os.getuid()):
+ if os.path.isfile(fname):
+ f = open(fname)
diff --git a/multimedia/freevo/files/pkg-deinstall.in b/multimedia/freevo/files/pkg-deinstall.in
new file mode 100644
index 000000000000..d805488a3d06
--- /dev/null
+++ b/multimedia/freevo/files/pkg-deinstall.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+# warn about manually removing user/group/homedir and log/rundirs
+
+user=%%FREEVO_USER%%
+group=%%FREEVO_GROUP%%
+home=%%FREEVO_HOME%%
+
+if [ "$2" = "POST-DEINSTALL" ]; then
+ if pw usershow "$user" >/dev/null 2>&1; then
+ echo "Warning: if this is a final deinstall, remove user \"$user\" manually"
+ fi
+ if pw groupshow "$group" >/dev/null 2>&1; then
+ echo "Warning: if this is a final deinstall, remove group \"$group\" manually"
+ fi
+ if [ -d "$home" ]; then
+ echo "Warning: if this is a final deinstall, remove directory \"$home\" manually"
+ fi
+ if [ -d "/var/log/freevo" ]; then
+ echo "Warning: if this is a final deinstall, remove directory \"/var/log/freevo\" manually"
+ fi
+ if [ -d "/var/run/freevo" ]; then
+ echo "Warning: if this is a final deinstall, remove directory \"/var/run/freevo\" manually"
+ fi
+fi
+
diff --git a/multimedia/freevo/files/pkg-install.in b/multimedia/freevo/files/pkg-install.in
new file mode 100644
index 000000000000..6449b1e4ab10
--- /dev/null
+++ b/multimedia/freevo/files/pkg-install.in
@@ -0,0 +1,51 @@
+#!/bin/sh
+# create freevo user/group/homedir and log/rundirs
+
+user=%%FREEVO_USER%%
+group=%%FREEVO_GROUP%%
+uid=%%FREEVO_UID%%
+gid=%%FREEVO_GID%%
+home=%%FREEVO_HOME%%
+
+export PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+if [ "$1" = "PRE-INSTALL" ]; then
+ if pw groupshow "$group" 2>/dev/null; then
+ echo "You already have a group \"$group\", so I will use it."
+ else
+ echo "Creating group \"$group\"..."
+ pw groupadd $group -g $gid || exit 1
+ fi
+
+ if pw usershow "$user" 2>/dev/null; then
+ echo "You already have a user \"$user\", so I will use it."
+ else
+ echo "Creating user \"$user\"..."
+ pw useradd $user -u $uid -g $group -d $home -s /bin/sh \
+ -c "Freevo Owner" || exit 1
+ fi
+
+ if [ -d "$home" ]; then
+ echo "You already have a freevo home directory \"$home\", so I will use it."
+ else
+ echo "Creating freevo home directory \"$home\"..."
+ mkdir -p $home
+ chown $user:$group $home
+ fi
+
+ if [ -d "/var/log/freevo" ]; then
+ echo "You already have a freevo log directory \"/var/log/freevo\", so I will use it."
+ else
+ echo "Creating freevo log directory \"/var/log/freevo\"..."
+ mkdir -p /var/log/freevo
+ chown $user:$group /var/log/freevo
+ fi
+
+ if [ -d "/var/run/freevo" ]; then
+ echo "You already have a freevo log directory \"/var/run/freevo\", so I will use it."
+ else
+ echo "Creating freevo run directory \"/var/run/freevo\"..."
+ mkdir -p /var/run/freevo
+ chown $user:$group /var/run/freevo
+ fi
+fi
diff --git a/multimedia/freevo/files/pkg-message.in b/multimedia/freevo/files/pkg-message.in
index 3ecc09ee5fdf..64e394928e91 100644
--- a/multimedia/freevo/files/pkg-message.in
+++ b/multimedia/freevo/files/pkg-message.in
@@ -3,21 +3,39 @@
Freevo is now installed. It might be a good idea to read the docs
in %%PREFIX%%/share/doc/freevo-%%PORTVERSION%%
- By default Freevo is configured with a single VFS in /var/db/cache.
- You can use this by adding users to the freevo group.
-
- To get up and running quickly try: freevo setup && freevo --help
+***********************************************************************
- Freevo can be configured to start on boot by using the sample
- startup script in %%PREFIX%%/etc/rc.d/freevo.sh.sample
+ You will need to ensure that the directory %%FREEVO_HOME%%/tv is on
+ a filesystem with lots of space. The default location may not be
+ adequate. One possibility is to create a freevo TV directory on a
+ suitable filesystem, then create a symlink to it from %%FREEVO_HOME%%/tv.
***********************************************************************
- IMPORTANT: Freevo requires procfs to be mounted on /proc. You can
- do this by adding the following entry to your /etc/fstab:
+ Freevo requires procfs to be mounted on /proc. You can do this by
+ adding the following entry to your /etc/fstab:
+
+ proc /proc procfs rw 0 0
- proc /proc procfs rw 1 1
+ Without this freevo will not shut down correctly.
+
+***********************************************************************
- WITHOUT THIS FREEVO WILL NOT SHUT DOWN CORRECTLY!
+ To get freevo up and running copy and edit:
+ %%PREFIX%%/etc/freevo/local_conf.py.example
+ then:
+ su freevo
+ freevo setup
+ freevo start recordserver
+ freevo start
+ and also:
+ freevo --help
+
+ Freevo can be configured to start on boot by setting the following
+ variables in /etc/rc.conf:
+ freevo_enable="YES" enables Freevo subsystem
+ freevo_recordserver_enable="YES" starts record server
+ freevo_webserver_enable="YES" starts record server
+ freevo_gui_enable="YES" starts Freevo GUI
***********************************************************************