[arch-commits] Commit in jack/trunk (PKGBUILD jack.conf jack.install rc.jack)

Daniel Griffiths dgriffiths at archlinux.org
Sat Mar 6 16:32:36 EST 2010


    Date: Saturday, March 6, 2010 @ 16:32:35
  Author: dgriffiths
Revision: 71369

FS#15102

Added:
  jack/trunk/jack.conf
  jack/trunk/jack.install
  jack/trunk/rc.jack
Modified:
  jack/trunk/PKGBUILD

--------------+
 PKGBUILD     |   27 +++++++++++----------
 jack.conf    |   13 ++++++++++
 jack.install |   29 ++++++++++++++++++++++
 rc.jack      |   73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 130 insertions(+), 12 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-03-06 21:18:05 UTC (rev 71368)
+++ PKGBUILD	2010-03-06 21:32:35 UTC (rev 71369)
@@ -3,33 +3,36 @@
 # Contributor: Robert Emil Berge <robert at rebi.no>
 
 pkgname=jack
-pkgver=0.116.2
+_pkgname=jack-audio-connection-kit
+pkgver=0.118.0
 pkgrel=1
 pkgdesc="A low-latency audio server"
 arch=('i686' 'x86_64')
 license=('GPL2' 'custom:LGPL2')
-depends=('libsndfile' 'bash')
+depends=('libsamplerate' 'bash')
 makedepends=('doxygen')
-url="http://jackit.sourceforge.net/"
-backup=(etc/conf.d/jack-audio-connection-kit)
+url="http://jackaudio.org/"
+backup=(etc/conf.d/jack)
 options=('!libtool')
 provides=("jack-audio-connection-kit=${pkgver}")
 replaces=('jack-audio-connection-kit')
-source=(http://jackaudio.org/downloads/jack-audio-connection-kit-${pkgver}.tar.gz \
-        ${pkgname}.rc.d ${pkgname}.conf.d)
-md5sums=('9c0ae9880e9b6e081f1a238fe6a28bd5' '15a3ecd76b3186eb0fa9c6d16ffbdfef' \
-         '0517b67ef912e2a84b6a15dea2dc2680')
+install=jack.install
+source=(http://jackaudio.org/downloads/${_pkgname}-${pkgver}.tar.gz
+        rc.${pkgname} ${pkgname}.conf)
 
 build() {
-	cd ${srcdir}/jack-audio-connection-kit-${pkgver}
+	cd ${srcdir}/${_pkgname}-${pkgver}
 	./configure --prefix=/usr --libdir=/usr/lib
 	make || return 1
 }
 
 package() {
-	cd ${srcdir}/jack-audio-connection-kit-${pkgver}
+	cd ${srcdir}/${_pkgname}-${pkgver}
 	make DESTDIR=${pkgdir} install
-	install -Dm755 ../${pkgname}.rc.d ${pkgdir}/etc/rc.d/${pkgname}
-	install -Dm644 ../${pkgname}.conf.d ${pkgdir}/etc/conf.d/${pkgname}
+	install -Dm755 ../rc.${pkgname} ${pkgdir}/etc/rc.d/${pkgname}
+	install -Dm644 ../${pkgname}.conf ${pkgdir}/etc/conf.d/${pkgname}
 	install -Dm644 COPYING.LGPL ${pkgdir}/usr/share/licenses/${pkgname}/COPYING.LGPL
 }
+md5sums=('d58e29a55f285d54e75134cec8e02a10'
+         '7d4422087233b8dfca00474596851fdb'
+         'f238e9fb8f9e53c1e59ec977d9af1ad2')

Added: jack.conf
===================================================================
--- jack.conf	                        (rev 0)
+++ jack.conf	2010-03-06 21:32:35 UTC (rev 71369)
@@ -0,0 +1,13 @@
+# JACK server/daemon configuration
+
+# Uncomment if you are the only one accessing jackd. You must run
+# it once before starting the daemon:
+#JACK_USER=""
+#JACK_HOME="/home/$JACK_USER"
+#JACK_PARAMS=$(sed 's:/usr/bin/jackd ::' $JACK_HOME/.jackdrc)
+
+# Comment out everything below if you uncommented the above:
+JACK_PROMISCUOUS_SERVER=1
+JACK_PROMISCUOUS_USER="audio"
+JACK_USER="$JACK_PROMISCUOUS_USER"
+JACK_PARAMS="-dalsa -dhw:0 -r48000 -p512 -n3"

Added: jack.install
===================================================================
--- jack.install	                        (rev 0)
+++ jack.install	2010-03-06 21:32:35 UTC (rev 71369)
@@ -0,0 +1,29 @@
+post_install() {
+  if grep -w "audio" /etc/passwd &> /dev/null; then
+    sed -i 's/audio//' /etc/conf.d/jack
+    echo "==> It appears the system already has a user named 'audio'."
+    echo "==> Please edit /etc/conf.d/jack and change the value of"
+    echo "==> JACK_PROMISCUOUS_USER."
+  fi
+}
+
+post_upgrade() {
+  if grep -w "audio" /etc/passwd &> /dev/null; then
+    echo "==> It appears the system already has a user named 'audio'"
+    echo "==> Please edit /etc/conf.d/jack and change the value of"
+    echo "==> JACK_PROMISCUOUS_USER."
+    echo
+    echo "==> You can ignore this if you received this message before"
+    echo "==> and have already taken the necessary steps to rectify"
+    echo "==> the problem."
+  fi
+}
+
+pre_remove() {
+  . /etc/conf.d/jack
+  /etc/rc.d/jack stop &> /dev/null
+  [ $JACK_PROMISCUOUS_SERVER -eq 1 ] && userdel $JACK_PROMISCUOUS_USER &> /dev/null
+  return 0
+}
+
+# vim:set ts=2 sw=2 et:

Added: rc.jack
===================================================================
--- rc.jack	                        (rev 0)
+++ rc.jack	2010-03-06 21:32:35 UTC (rev 71369)
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+# source application-specific settings
+. /etc/conf.d/jack
+
+PID=$(pidof -o %PPID \jackd)
+
+case "$1" in
+	start)
+		stat_busy "Starting JACK Daemon"
+
+		[ "$(whoami)" != "root" -o -z "$JACK_USER" ] && stat_die
+		[ $JACK_PROMISCUOUS_SERVER -ne 1 -a ! -s $JACK_HOME/.jackdrc ] && stat_die
+
+		# create dummy user
+		if ! grep -w $JACK_USER /etc/passwd &> /dev/null; then
+			useradd -rlMN \
+			  -K SYS_UID_MAX=499 \
+			  -K SYS_GID_MAX=499 \
+			  -s /bin/bash \
+			  -G audio,video,network \
+			  -c $JACK_USER \
+			  -d / \
+			  $JACK_USER
+		fi
+
+		# bail if user is not part of important groups
+		for i in audio video network; do
+			groups $JACK_USER | grep -w $i &> /dev/null || stat_die
+		done
+
+		# run the command
+		[ -z "$PID" ] && \
+		  su - $JACK_USER -c "\jackd $JACK_PARAMS &> /dev/null &"
+
+		if [ ! -z "$PID" -o $? -gt 0 ]; then
+			stat_fail
+		else
+			if [ $JACK_PROMISCUOUS_SERVER -eq 1 ]; then
+				add_daemon jack-promiscuous
+				stat_done
+			else
+				add_daemon jack
+				stat_done
+			fi
+		fi
+		;;
+	stop)
+		stat_busy "Stopping JACK Daemon"
+		[ ! -z "$PID" ]  && kill $PID &> /dev/null
+		if [ $? -gt 0 ]; then
+			stat_fail
+		else
+			if ck_daemon jack-promiscuous; then
+				rm_daemon jack-promiscuous
+				stat_done
+			else
+				rm_daemon jack
+				stat_done
+			fi
+		fi
+		;;
+	restart)
+		$0 stop
+		sleep 1
+		$0 start
+		;;
+	*)
+		echo "usage: $0 {start|stop|restart}"
+esac



More information about the arch-commits mailing list