summaryrefslogtreecommitdiff
path: root/community/oss
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/oss
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/oss')
-rw-r--r--community/oss/PKGBUILD84
-rw-r--r--community/oss/oss.install59
-rw-r--r--community/oss/oss.rc32
-rw-r--r--community/oss/oss.rm-init-scripts.patch52
-rw-r--r--community/oss/oss.soundon.patch28
5 files changed, 255 insertions, 0 deletions
diff --git a/community/oss/PKGBUILD b/community/oss/PKGBUILD
new file mode 100644
index 000000000..c251c41b6
--- /dev/null
+++ b/community/oss/PKGBUILD
@@ -0,0 +1,84 @@
+# $Id: PKGBUILD 36678 2011-01-05 23:16:19Z bluewind $
+# Contributor: Paulo Matias <matiasΘarchlinux-br·org>
+# Maintainer: Daniel J Griffiths <ghost1227@archlinux.us>
+
+pkgname=oss
+pkgver=4.2_2004
+pkgrel=1
+pkgdesc="Open Sound System UNIX audio architecture"
+arch=('i686' 'x86_64')
+url="http://developer.opensound.com/"
+license=('GPL2')
+depends=('gcc' 'make' 'kernel26-headers' 'module-init-tools' 'libtool' 'sed')
+makedepends=('pkgconfig' 'gawk' 'gtk2' 'findutils')
+optdepends=('gtk2: for graphical mixer (ossxmix)'
+ 'hal: for automatic USB audio configuration')
+conflicts=('oss-linux' 'oss-linux-free' 'oss-testing' 'libflashsupport' 'libflashsupport-pulse' 'libflashsupport-oss')
+replaces=('libflashsupport-oss')
+install=oss.install
+backup=('usr/lib/oss/soundon.user')
+source=("http://www.4front-tech.com/developer/sources/stable/gpl/oss-v${pkgver/_*}-build${pkgver/*_}-src-gpl.tar.bz2"
+ 'oss.rm-init-scripts.patch' 'oss.rc' 'oss.soundon.patch')
+md5sums=('256aba264d523fb8ee444aaacfb8d3da'
+ 'b9a380a0ac8896390d71ac13676f27e1'
+ '8ca7cdf94c56ab02890eb4aba6a4995f'
+ '65f07fe241bfbf912f76d8b6d8f276b5')
+
+build() {
+ _dir=oss-v${pkgver/_*}-build${pkgver/*_}-src-gpl
+ cd ${srcdir}/${_dir}
+
+ # Avoid these flags conflicting with OSS build system.
+ unset CFLAGS
+ unset LDFLAGS
+ unset OSFLAGS
+ unset LIBRARIES
+ export NO_WARNING_CHECKS=yes
+
+ # Compile libflashsupport.so only in packaging time, so we avoid
+ # conflicts with other packages and ease package management.
+ msg "Building libflashsupport.so."
+ cd oss/lib
+ gcc -shared -fPIC -O2 -Wall -Werror flashsupport.c -o libflashsupport.so
+
+ msg "Preparing the build environment."
+ cd ${srcdir}
+
+ if [ ! -d build ]; then
+ # Create build directory and configure
+ mkdir build && cd build
+ ${srcdir}/${_dir}/configure --enable-libsalsa=NO
+ else
+ # Change to existing build directory
+ cd build
+ fi
+
+ msg "Building OSS."
+ make build
+
+ msg "Patching init scripts."
+ cd ${srcdir}/build/prototype
+ rm usr/lib/oss/etc/S89oss
+ patch -b -p0 < ${srcdir}/oss.rm-init-scripts.patch
+ patch -b -p0 < ${srcdir}/oss.soundon.patch
+
+}
+
+package() {
+ _dir=oss-v${pkgver/_*}-build${pkgver/*_}-src-gpl
+ cd ${srcdir}/${_dir}
+
+ msg "Copying files."
+
+ # Install libflashsupport.so
+ install -Dm755 oss/lib/libflashsupport.so \
+ ${pkgdir}/usr/lib/libflashsupport.so
+ rm -f oss/lib/{flashsupport.c,libflashsupport.so}
+
+ cd ${srcdir}/build/prototype
+ cp -a * ${pkgdir}
+ chmod -R a+r ${pkgdir} # All files can have read permission (FS#13815)
+ find ${pkgdir} -type d -exec chmod a+x '{}' \; # Make namcap happy
+ install -Dm755 ${srcdir}/oss.rc ${pkgdir}/etc/rc.d/oss
+}
+
diff --git a/community/oss/oss.install b/community/oss/oss.install
new file mode 100644
index 000000000..f665416db
--- /dev/null
+++ b/community/oss/oss.install
@@ -0,0 +1,59 @@
+_MSG_LIBOSSDIR=" Please note that OSS stores some of its configuration files
+ at /usr/lib/oss. If you are upgrading from an older OSS
+ release and it doesn't work properly, try removing that
+ directory and reinstall this package."
+
+post_install() {
+ echo "Running OSS install script..."
+ /bin/sh /usr/lib/oss/build/install.sh &> /dev/null
+ echo
+ echo "-------------------------------------------------------------"
+ echo " Open Sound System was installed. Now you should add 'oss'"
+ echo " to your DAEMONS variable at /etc/rc.conf, and start the"
+ echo " daemon by running /etc/rc.d/oss start."
+ echo
+ echo " Note that OSS can't currently work together with kernel"
+ echo " ALSA modules, so they were moved out by the OSS install"
+ echo " scripts. If you want the ALSA kernel modules back, you can"
+ echo " just remove this package using pacman."
+ echo
+ echo "${_MSG_LIBOSSDIR}"
+ echo "-------------------------------------------------------------"
+ /bin/true
+}
+
+post_upgrade() {
+ echo "Running OSS update script..."
+ /bin/sh /usr/lib/oss/build/install.sh &> /dev/null
+ echo
+ echo "-------------------------------------------------------------"
+ echo " Open Sound System was updated. Now you should restart the"
+ echo " daemon by running /etc/rc.d/oss restart."
+ echo
+ echo "${_MSG_LIBOSSDIR}"
+ echo "-------------------------------------------------------------"
+ /bin/true
+}
+
+pre_remove() {
+ # Restore any replaced ALSA drivers.
+ /bin/sh /usr/lib/oss/scripts/restore_drv.sh
+ # Remove symlinks left by the 'install.sh' script.
+ rm -f /usr/lib/hal/scripts/oss_usb-create-devices
+ rm -f /usr/share/hal/fdi/policy/20thirdparty/90-oss_usb-create-device.fdi
+ /bin/true
+}
+
+post_remove() {
+ echo
+ echo "-------------------------------------------------------------"
+ echo " Open Sound System was now removed, and the ALSA kernel"
+ echo " modules were restored."
+ echo
+ echo " Please note that OSS stores some of its configuration files"
+ echo " at /usr/lib/oss. If you don't plan to use OSS anymore, you"
+ echo " can remove this directory."
+ echo "-------------------------------------------------------------"
+ /bin/true
+}
+
diff --git a/community/oss/oss.rc b/community/oss/oss.rc
new file mode 100644
index 000000000..3f63378c6
--- /dev/null
+++ b/community/oss/oss.rc
@@ -0,0 +1,32 @@
+#!/bin/bash
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy 'Starting Open Sound System'
+ if /usr/sbin/soundon
+ then
+ add_daemon oss
+ stat_done
+ else
+ stat_fail
+ fi
+ ;;
+ stop)
+ stat_busy 'Stopping Open Sound System'
+ if /usr/sbin/soundoff
+ then
+ rm_daemon oss
+ stat_done
+ else
+ stat_fail
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+esac
diff --git a/community/oss/oss.rm-init-scripts.patch b/community/oss/oss.rm-init-scripts.patch
new file mode 100644
index 000000000..981ff605f
--- /dev/null
+++ b/community/oss/oss.rm-init-scripts.patch
@@ -0,0 +1,52 @@
+--- usr/lib/oss/build/install.sh.orig 2008-09-25 11:41:47.180167692 -0300
++++ usr/lib/oss/build/install.sh 2008-09-25 11:41:47.180167692 -0300
+@@ -290,38 +290,6 @@
+ echo
+ fi
+
+-if ! test -d /etc/init.d
+-then
+- mkdir /etc/init.d
+-fi
+-
+-rm -f /etc/init.d/oss /etc/rc.d/rc3.d/S89oss /etc/rc3.d/S89oss
+-cp -f $OSSLIBDIR/etc/S89oss /etc/init.d/oss
+-
+-chmod 744 /etc/init.d/oss
+-
+-if test -x /sbin/chkconfig
+-then
+- /sbin/chkconfig oss on > /dev/null 2>&1
+-else
+- if test -x /usr/sbin/update-rc.d
+- then
+- /usr/sbin/update-rc.d oss defaults > /dev/null 2>&1
+- else
+- if test -d etc/rc.d/rc3.d
+- then
+- rm -f /etc/rc.d/rc3.d/S89oss
+- ln -s /etc/init.d/oss /etc/rc.d/rc3.d/S89oss
+- else
+- if test -d /etc/rc3.d
+- then
+- rm -f /etc/rc3.d/S89oss
+- ln -s /etc/init.d/oss /etc/rc3.d/S89oss
+- fi
+- fi
+- fi
+-fi
+-
+ # Install ALSA interface module (Cuckoo)
+ #(cd $OSSLIBDIR/cuckoo && make clean) > /dev/null 2>&1
+ #if (cd $OSSLIBDIR/cuckoo && make install) > /var/log/cuckoo.log 2>&1
+--- usr/lib/oss/scripts/restore_drv.sh.orig 2008-09-25 11:41:47.210168487 -0300
++++ usr/lib/oss/scripts/restore_drv.sh 2008-09-25 11:41:47.210168487 -0300
+@@ -18,8 +18,6 @@
+ fi
+ fi
+
+-rm -f /etc/init.d/oss
+-
+ if ! test -d /lib/modules/`uname -r`/kernel/sound
+ then
+ if test -f /lib/modules/`uname -r`/sound-preoss.tar.bz2
diff --git a/community/oss/oss.soundon.patch b/community/oss/oss.soundon.patch
new file mode 100644
index 000000000..4702b8680
--- /dev/null
+++ b/community/oss/oss.soundon.patch
@@ -0,0 +1,28 @@
+--- usr/sbin/soundon.old 2009-09-04 06:35:26.000000000 +0100
++++ usr/sbin/soundon 2009-11-15 13:59:53.000000000 +0000
+@@ -255,7 +255,10 @@
+ then
+ if test "`uname -m` " = "x86_64 "
+ then
+- ln -sf $OSSLIBDIR/lib/libsalsa.so.2.0.0 /usr/lib64/libasound.so.2
++ # Fix for compatibility with Arch's directory structure
++ # Not that we use it, there is no $OSSLIBDIR/.libsalsa_installed
++ ln -sf $OSSLIBDIR/lib/libsalsa.so.2.0.0 /usr/lib/libasound.so.2
++ #ln -sf $OSSLIBDIR/lib/libsalsa.so.2.0.0 /usr/lib64/libasound.so.2
+ #ln -sf $OSSLIBDIR/lib/libOSSlib.so /usr/lib64
+ else
+ if test -s /lib/libasound.so.2
+@@ -278,8 +281,11 @@
+ then
+ if test "`uname -m` " = "x86_64 "
+ then
+- ln -sf $OSSLIBDIR/lib/libOSSlib.so /usr/lib64
+- ln -sf $OSSLIBDIR/lib/libossmix.so /usr/lib64
++ # Fix for compatibility with Arch's directory structure
++ ln -sf $OSSLIBDIR/lib/libOSSlib.so /usr/lib
++ ln -sf $OSSLIBDIR/lib/libossmix.so /usr/lib
++ #ln -sf $OSSLIBDIR/lib/libOSSlib.so /usr/lib64
++ #ln -sf $OSSLIBDIR/lib/libossmix.so /usr/lib64
+ else
+ if test -s /lib/libasound.so.2
+ then