summaryrefslogtreecommitdiff
path: root/audio/squeezeboxserver/files/pkg-install.in
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2005-04-21 05:17:02 +0000
committerBrooks Davis <brooks@FreeBSD.org>2005-04-21 05:17:02 +0000
commitaf5ef7aea3290dcab9b73e16b3d0a0c3bd6ebda7 (patch)
tree2acbda4aa75908e467e17ff6e06176b39bff9c84 /audio/squeezeboxserver/files/pkg-install.in
parentUpdate to 0.12 (diff)
Upgrade to 6.0.1.
Stop trying to use ports versions of all the CPAN bits and do things the way the vendor expects. It's less elegant, but much easier to maintain. Do build our own versions of binary modules so we have a chance on all platforms, but use a slightly modified version of their script to do so (mostly make it non interactive and fetch the files from DISTDIR/DIST_SUBDIR rather than direct from slimdevices each build). Mark RESTRICTED. The distfiles and the build contain non-restributable bits. Some of the people building packages for linux are working on a way around this (not distributing the firmware and using alternate images), but that's no here yet. Nagged by: many :-) Prodded by: my dying cd player
Notes
Notes: svn path=/head/; revision=133813
Diffstat (limited to 'audio/squeezeboxserver/files/pkg-install.in')
-rw-r--r--audio/squeezeboxserver/files/pkg-install.in73
1 files changed, 73 insertions, 0 deletions
diff --git a/audio/squeezeboxserver/files/pkg-install.in b/audio/squeezeboxserver/files/pkg-install.in
new file mode 100644
index 000000000000..a210354f5677
--- /dev/null
+++ b/audio/squeezeboxserver/files/pkg-install.in
@@ -0,0 +1,73 @@
+#!/bin/sh
+# $FreeBSD: /tmp/pcvs/ports/audio/squeezeboxserver/files/pkg-install.in,v 1.1 2005-04-21 05:17:02 brooks Exp $
+
+name=slimserver
+u=slimserv
+g=slimserv
+ugid=104
+homedir=/nonexistent
+shell=/sbin/nologin
+comment="Slim Devices SlimServer pseudo-user"
+slimdir="%%PREFIX%%/%%SLIMDIR%%"
+statedir=/var/db/slimserver
+cachedir=${statedir}/cache
+playlistdir=${statedir}/playlists
+pidfile=/var/run/${name}.pid
+newsyslogfile=/etc/newsyslog.conf
+logfile=/var/log/slimserver.log
+logcomment="# added by audio/slimserver port"
+logline="${logfile} ${u}:${g} 644 3 100 * Z ${pidfile}"
+
+case $2 in
+PRE-INSTALL)
+ if pw group show "${g}" >/dev/null 2>&1; then
+ echo "Using existing group \"${g}\"."
+ else
+ echo "Creating group \"${g}\", (gid: ${ugid})."
+ pw groupadd ${g} -g ${ugid}
+ if [ $? != 0 ]; then
+ echo "Failed to add group \"${g}\"."
+ exit 1
+ fi
+ fi
+ if pw user show "${u}" >/dev/null 2>&1; then
+ echo "Using existing user \"${u}\"."
+ else
+ echo "Creating user \"${u}\", (uid: ${ugid})."
+ pw useradd ${u} -u ${ugid} -g ${ugid} -h - \
+ -d ${homedir} -s ${shell} -c "${comment}"
+ if [ $? != 0 ]; then
+ echo "Failed to add user \"${u}\"."
+ exit 1
+ fi
+ fi
+ ;;
+POST-INSTALL)
+ if [ ! -d ${statedir} ]; then
+ mkdir -p ${statedir}
+ chown -R ${u}:${g} ${statedir}
+ fi
+ if [ ! -d ${cachedir} ]; then
+ mkdir -p ${cachedir}
+ chown -R ${u}:${g} ${cachedir}
+ fi
+ if [ ! -d ${playlistdir} ]; then
+ mkdir -p ${playlistdir}
+ chown -R ${u}:${g} ${playlistdir}
+ fi
+ if egrep -q "^${logfile}\>" ${newsyslogfile}; then
+ echo "Using existing ${newsyslogfile} entry."
+ else
+ echo "Adding slimserver log entry to ${newsyslogfile}."
+ echo "$logcomment" >> ${newsyslogfile}
+ echo "$logline" >> ${newsyslogfile}
+ fi
+ for file in %%CONFFILES%%; do
+ path="${slimdir}/${file}"
+ if [ ! -e ${path} ]; then
+ cp ${path}.sample ${path}
+ chmod 644 ${path}
+ fi
+ done
+ ;;
+esac