Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=136a3c5a4f8931f9ad881f0245dc8683d7ce7cc6

commit 136a3c5a4f8931f9ad881f0245dc8683d7ce7cc6
Author: James Buren <r...@frugalware.org>
Date:   Tue Dec 14 12:18:59 2010 -0600

oss-v4.2_build2003-1-i686
* new package

diff --git a/source/multimedia-extra/oss/FrugalBuild 
b/source/multimedia-extra/oss/FrugalBuild
new file mode 100644
index 0000000..59c9e1a
--- /dev/null
+++ b/source/multimedia-extra/oss/FrugalBuild
@@ -0,0 +1,115 @@
+# Compiling Time: 1.25 SBU
+# Maintainer: James Buren <r...@frugalware.org>
+
+# Notice: Because of the hacks required to get this to work, this package
+# should be updated with care.
+
+pkgname=oss
+pkgver=v4.2_build2003
+_ver="${pkgver/_/-}"
+pkgrel=1
+pkgdesc="Open Sound System Version 4 for Linux (Alternative to ALSA)."
+url="http://developer.opensound.com";
+_dlurl='http://www.4front-tech.com/developer/sources/stable/gpl'
+_ext='-src-gpl.tar.bz2'
+groups=('multimedia-extra')
+archs=('i686' 'x86_64' 'ppc')
+up2date="Flastarchive $_dlurl $_ext"
+backup=('usr/lib/oss/soundon.user')
+install="$pkgname.install"
+source=($_dlurl/$pkgname-$_ver$_ext
+       $pkgname-kernel-2.6.36.patch
+       $pkgname-disable-redundant-actions.patch
+       rc.$pkgname)
+options=('scriptlet')
+# Only alsa-lib is non-conflicting, for packages that rely on it.
+conflicts=('alsa-utils' 'alsa-tools' 'alsa-oss' 'alsa-firmware')
+Finclude kernel-module
+subpkgs=("$pkgname-gtk-mixer")
+subdescs=('GUI mixer for oss that uses GTK+')
+subrodepends=("$pkgname")
+subdepends=('gtk+2')
+subarchs=('i686 x86_64 ppc')
+subgroups=('xmultimedia-extra')
+sha1sums=('3e94c5c36b6955ad1224a65376b4a373f3a807ab' \
+          '48aaf87228449590f0a82cdf17264e6b0a963546' \
+          '1a30ba006f37066f369fc8b5f18af465cb6f0793' \
+          '7f1c8c3758179bb1890dd17f232ebf824505cfea')
+
+build() {
+       Fcd "$pkgname-$_ver-src-gpl"
+
+       Fpatchall
+
+       Fmkdir "$_F_kernelmod_dir/kernel/oss"
+
+       # Tell the build to turn off compiler warnings, otherwise they will be 
fatal.
+       export NO_WARNING_CHECKS='1'
+
+       # Remove build directory if it exists
+       [ -d "tmp" ] && rm -rf tmp
+
+       # Build demands an empty directory to start in
+       mkdir tmp && cd tmp
+
+       # Setup build directory
+       ../configure --enable-libsalsa=NO || Fdie
+
+       # Compile first stage
+       make build || Fdie
+
+       # Compile main kernel module
+       cd prototype/usr/lib/oss/build || Fdie
+       ln -sf Makefile.osscore Makefile || Fdie
+       sed -i '1 d' Makefile || Fdie
+       for i in ../include/internals/*.h ../include/sys/*.h; do
+               ln -sf $i `basename $i` || Fdie
+       done
+       echo "static const char __oss_compile_vermagic[]" > 
ubuntu_version_hack.inc
+       echo "__attribute__((used))" >> ubuntu_version_hack.inc
+       echo "__attribute__((section(\".modinfo\")))" >> ubuntu_version_hack.inc
+       echo "= \"$(../../../sbin/ossvermagic -z -s)\";" >> 
ubuntu_version_hack.inc
+       make -C "$_F_kernelmod_dir/build" M="$(pwd)" modules || Fdie
+       ld -r osscore.ko ../objects.regparm/osscore.o -o 
"$Fdestdir/$_F_kernelmod_dir/kernel/oss/osscore.ko" || Fdie
+
+       # Compile sound kernel modules
+       echo "static const struct modversion_info ____versions[]" > 
osscore_symbols.inc
+       echo " __attribute__((used))" >> osscore_symbols.inc
+       echo "__attribute__((section(\"__versions\"))) = {" >> 
osscore_symbols.inc
+       sed -e "s:^:{:" -e "s:\t:, \":" -e "s:\t\(.\)*:\"},:" < Module.symvers 
>> osscore_symbols.inc
+       echo "};" >> osscore_symbols.inc
+       for i in ../modules.regparm/*.o; do
+               I=`basename $i .o`
+               sed "s|MODNAME|$I|" < Makefile.tmpl > Makefile
+               sed -i '1 d' Makefile || Fdie
+               make -C "$_F_kernelmod_dir/build" M="$(pwd)" modules || Fdie
+               ld -r $I.ko $i -o 
"$Fdestdir/$_F_kernelmod_dir/kernel/oss/$I.ko" || Fdie
+       done
+
+       # Compile flashsupport
+       cc -shared -fPIC $CFLAGS $LDFLAGS ../lib/flashsupport.c -o 
../lib/libflashsupport.so || Fdie
+
+       # Install everything else now
+       cd ../../../.. || Fdie
+       rm -rf usr/lib/oss/lib/flashsupport.c usr/lib/oss/etc/S89oss || Fdie
+       rm -rf usr/lib/oss/{build,cuckoo,include,etc_templates} 
usr/lib/oss/modules.* usr/lib/oss/objects.* || Fdie
+       cp -rf * "$Fdestdir" || Fdie
+       for i in $Fdestdir/usr/lib/oss/lib/*; do
+               Fln ${i/$Fdestdir/} /usr/lib/`basename $i`
+       done
+       Fln /usr/lib/oss/scripts/oss_usb-create-devices 
/usr/lib/hal/scripts/oss_usb-create-devices
+       Fln /usr/lib/oss/scripts/90-oss_usb-create-device.fdi 
/usr/share/hal/fdi/policy/20thirdparty/90-oss_usb-create-device.fdi
+       Fmv /usr/lib/oss/conf.tmpl /usr/lib/oss/conf
+       echo "autosave_mixer yes" > $Fdestdir/usr/lib/oss/etc/userdefs
+       Fdirschmod  /                         0755
+       Ffileschmod /                         0644
+       Ffileschmod /usr/bin                  0755
+       Ffileschmod /usr/sbin                 0755
+       Ffileschmod /usr/lib/oss/lib          0755
+       Ffileschmod /usr/lib/oss/scripts      0755
+       Ffileschmod /usr/lib/oss/soundon.user 0755
+       Frcd2
+       Fsplit $pkgname-gtk-mixer /usr/bin/ossxmix
+}
+
+# optimization OK
diff --git a/source/multimedia-extra/oss/oss-disable-redundant-actions.patch 
b/source/multimedia-extra/oss/oss-disable-redundant-actions.patch
new file mode 100644
index 0000000..04157aa
--- /dev/null
+++ b/source/multimedia-extra/oss/oss-disable-redundant-actions.patch
@@ -0,0 +1,246 @@
+diff -aur a/setup/Linux/oss/scripts/restore_drv.sh 
b/setup/Linux/oss/scripts/restore_drv.sh
+--- a/setup/Linux/oss/scripts/restore_drv.sh   2010-05-11 06:26:05.000000000 
-0500
++++ b/setup/Linux/oss/scripts/restore_drv.sh   2010-12-14 11:26:24.119000141 
-0600
+@@ -10,7 +10,7 @@
+
+ rm -rf /lib/modules/`uname -r`/kernel/oss
+
+-if test -x /sbin/chkconfig
++if test -x /sbin/chkconfig
+ then /sbin/chkconfig oss off > /dev/null 2>&1
+ else
+   if test -x /sbin/update-rc.d
+@@ -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 -aur a/setup/Linux/sbin/soundon b/setup/Linux/sbin/soundon
+--- a/setup/Linux/sbin/soundon 2010-05-11 06:26:05.000000000 -0500
++++ b/setup/Linux/sbin/soundon 2010-12-14 11:26:24.120000141 -0600
+@@ -50,104 +50,6 @@
+       exit 10
+ fi
+
+-UBUNTU_OVERRIDE=
+-POS_UBUNTU_OVERRIDE=
+-if  test -f /lib/modules/$KERNEL_VERSION/kernel/oss/osscore.ko
+-then
+-# Verify that vermagic of OSS matches the kernel vermagic
+-
+-      OSS_VERMAGIC=`/usr/sbin/ossvermagic -z -q 
/lib/modules/$KERNEL_VERSION/kernel/oss/osscore.ko`
+-
+-      if ! test "$OSS_VERMAGIC " = "$KERNEL_VERMAGIC "
+-      then
+-              OSS_ORIG_VERMAGIC="$OSS_VERMAGIC"
+-              OSS_VERMAGIC=`/usr/sbin/ossvermagic -z -u -q 
/lib/modules/$KERNEL_VERSION/kernel/oss/osscore.ko`
+-              POS_UBUNTU_OVERRIDE=1
+-      fi
+-
+-      if ! test "$OSS_VERMAGIC " = "$KERNEL_VERMAGIC "
+-      then
+-              echo "Old    vermagic: " $OSS_VERMAGIC >> $LOG
+-              rm -rf /lib/modules/$KERNEL_VERSION/kernel/oss
+-              echo Previous OSS modules were for a different kernel version - 
removed
+-              echo Previous OSS modules were for a different kernel version - 
removed >> $LOG
+-      elif test "$POS_UBUNTU_OVERRIDE " = "1 "
+-      then
+-              echo "Vermagic backup check activated for Ubuntu. Backup 
vermagic: $OSS_VERMAGIC. OSS stored vermagic $OSS_ORIG_VERMAGIC" >> $LOG
+-              UBUNTU_OVERRIDE="-u"
+-      fi
+-fi
+-
+-if ! test -f /lib/modules/$KERNEL_VERSION/kernel/oss/osscore.ko
+-then
+-      NOTIFY=1
+-      echo Relinking OSS kernel modules for \"$KERNEL_VERMAGIC\"
+-      echo This may take few moments - please stand by...
+-      echo Relinking OSS kernel modules for $KERNEL_VERMAGIC >> $LOG
+-
+-      rm -f /var/log/relink.log
+-      if ! (cd $OSSLIBDIR/build && sh install.sh > /var/log/relink.log 2>&1)
+-      then
+-              cat /var/log/relink.log >> $LOG 2>&1
+-              cat /var/log/relink.log
+-              echo
+-              echo Relinking the OSS kernel modules failed
+-              rm -f /var/log/relink.log
+-              exit 20
+-      fi
+-
+-      cat /var/log/relink.log >> $LOG 2>&1
+-      echo Relinking OSS kernel modules finished
+-      rm -f /var/log/relink.log
+-fi
+-
+-if ! test -f /lib/modules/$KERNEL_VERSION/kernel/oss/osscore.ko
+-then
+-      echo
+-      echo No /lib/modules/$KERNEL_VERSION/kernel/oss/osscore.ko module >> 
$LOG
+-      echo No /lib/modules/$KERNEL_VERSION/kernel/oss/osscore.ko module in 
the system
+-      exit 30
+-fi
+-
+-OSS_VERMAGIC=`/usr/sbin/ossvermagic -z $UBUNTU_OVERRIDE -q 
/lib/modules/$KERNEL_VERSION/kernel/oss/osscore.ko`
+-echo "OSS    vermagic: " $OSS_VERMAGIC >> $LOG
+-
+-if ! test "$OSS_VERMAGIC " = "$KERNEL_VERMAGIC "
+-then
+-      echo OSS driver modules do not match the current kernel >> $LOG
+-      echo
+-      echo Error: OSS driver modules do not match the current kernel
+-      echo
+-      echo "Kernel vermagic: " $KERNEL_VERMAGIC
+-      echo "OSS    vermagic: " $OSS_VERMAGIC
+-      echo
+-      echo The most likely reason is that the kernel development package
+-        echo installed in the system is wrong. Please refer to the 
documentation
+-      echo of your Linux distribution for more info about setting up the
+-      echo kernel/driver development environment properly.
+-      echo
+-      exit 40
+-fi
+-
+-if test -f $OSSLIBDIR/etc/license.asc
+-then
+-   /usr/sbin/ossdetect -l >> $LOG
+-fi
+-
+-if grep -q '^ *14 ' < /proc/devices
+-then
+-      if ! sh $OSSLIBDIR/scripts/remove_drv.sh>> $LOG
+-      then
+-              echo Failed to disable conflicting sound drivers >> $LOG
+-              echo Failed to disable conflicting sound drivers
+-              echo Reboot and try running soundon again
+-              echo
+-              echo Also check that you have not compiled sound support 
statically
+-              echo into the kernel.
+-              exit 50
+-      fi
+-fi
+-
+ echo >> $LOG
+ echo '*** Loading OSS kernel modules ***' >> $LOG
+ echo >> $LOG
+@@ -230,116 +132,12 @@
+ echo >> $LOG
+ /usr/sbin/savemixer -L -v >> $LOG 2>&1
+
+-# Setup ALSA emulation
+-
+-if test -f $OSSLIBDIR/.cuckoo_installed
+-then
+-# Use kernel based ALSA compatibility
+-
+-  if ! test -f /lib/modules/$KERNEL_VERSION/kernel/sound/core/snd.ko
+-  then
+-      sh $OSSLIBDIR/scripts/setup-alsa.sh >> $LOG 2>&1
+-      depmod -a
+-  fi
+-
+-  echo "*** Setting up ALSA compatibility ****" >> $LOG
+-  modprobe cuckoo >> $LOG 2>&1
+-  head -10 /proc/asound/version >> $LOG 2>&1
+-  lsmod|grep snd >> $LOG
+-  echo "**************************************" >> $LOG
+-elif test -f $OSSLIBDIR/.libsalsa_installed
+-then
+-# Use library based ALSA compatibility
+-
+-  if test -f $OSSLIBDIR/lib/libsalsa.so.2.0.0
+-  then
+-     if test "`uname -m` " = "x86_64 "
+-     then
+-       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
+-       then
+-         ln -sf $OSSLIBDIR/lib/libsalsa.so.2.0.0 /lib/libasound.so.2
+-         #ln -sf $OSSLIBDIR/lib/libOSSlib.so /lib
+-       fi
+-
+-       if test -s /usr/lib/libasound.so.2
+-       then
+-         ln -sf $OSSLIBDIR/lib/libsalsa.so.2.0.0 /usr/lib/libasound.so.2
+-         #ln -sf $OSSLIBDIR/lib/libOSSlib.so /usr/lib
+-       fi
+-     fi
+-  fi
+-fi
+-
+-# Setup libOSSlib.so
+-if test -f $OSSLIBDIR/lib/libOSSlib.so
+-then
+-   if test "`uname -m` " = "x86_64 "
+-   then
+-     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
+-       ln -sf $OSSLIBDIR/lib/libOSSlib.so /lib
+-       ln -sf $OSSLIBDIR/lib/libossmix.so /lib
+-     fi
+-
+-     if test -s /usr/lib/libasound.so.2
+-     then
+-       ln -sf $OSSLIBDIR/lib/libOSSlib.so /usr/lib
+-       ln -sf $OSSLIBDIR/lib/libossmix.so /usr/lib
+-     fi
+-   fi
+-fi
+-
+-# Setup Flash 9 audio support plugin for OSS
+-
+-if test -d /usr/lib64 && test -f $OSSLIBDIR/lib/libflashsupport_64.so
+-then
+-  ln -sf $OSSLIBDIR/lib/libflashsupport_64.so /usr/lib64/libflashsupport.so
+-fi
+-
+-if test -d /usr/lib32 && test -f $OSSLIBDIR/lib/libflashsupport_32.so
+-then
+-  ln -sf $OSSLIBDIR/lib/libflashsupport_32.so /usr/lib32/libflashsupport.so
+-fi
+-
+-if ! test -f /usr/lib/libflashsupport.so && test -f 
$OSSLIBDIR/lib/libflashsupport_32.so
+-then
+-  ln -sf $OSSLIBDIR/lib/libflashsupport_32.so /usr/lib/libflashsupport.so
+-fi
+-
+ if test -x $OSSLIBDIR/soundon.user
+ then
+   echo Running $OSSLIBDIR/soundon.user >> $LOG
+   $OSSLIBDIR/soundon.user >> $LOG 2>&1
+ fi
+
+-if test "`ossinfo -g|grep TRIAL` " != " "
+-then
+-      echo
+-      echo "************************************************************"
+-      echo "* NOTE! You are using trial version of Open Sound System   *"
+-      echo "************************************************************"
+-      echo
+-
+-      sleep 1
+-fi
+-
+-if test "`ossinfo -g|grep EXPIRED` " != " "
+-then
+-      echo
+-      echo "****************************************************************"
+-      echo "* NOTE! Your Open Sound System evaluation license has expired  *"
+-      echo "****************************************************************"
+-      echo
+-
+-      sleep 15
+-fi
+-
+ if test "$NOTIFY " = "1 "
+ then
+   echo
diff --git a/source/multimedia-extra/oss/oss-kernel-2.6.36.patch 
b/source/multimedia-extra/oss/oss-kernel-2.6.36.patch
new file mode 100644
index 0000000..433b996
--- /dev/null
+++ b/source/multimedia-extra/oss/oss-kernel-2.6.36.patch
@@ -0,0 +1,23 @@
+diff -aur oss-v4.2-build2003-src-gpl/setup/Linux/oss/build/osscore.c 
oss-v4.2-build2003-src-gpl-2/setup/Linux/oss/build/osscore.c
+--- oss-v4.2-build2003-src-gpl/setup/Linux/oss/build/osscore.c 2010-05-11 
06:26:05.000000000 -0500
++++ oss-v4.2-build2003-src-gpl-2/setup/Linux/oss/build/osscore.c       
2010-12-14 05:38:08.847000125 -0600
+@@ -933,7 +933,9 @@
+   read_t tmp_read = (read_t) op->read;
+   write_t tmp_write = (write_t) op->write;
+   /* readdir_t tmp_readdir = (readdir_t)op->readdir; */
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35)
+   ioctl_t tmp_ioctl = (ioctl_t) op->ioctl;
++#endif
+   mmap_t tmp_mmap = (mmap_t) op->mmap;
+   open_t tmp_open = (open_t) op->open;
+   release_t tmp_release = (release_t) op->release;
+@@ -953,7 +955,9 @@
+   fop->write = tmp_write;
+   fop->readdir = NULL;                /* tmp_readdir; */
+   fop->poll = tmp_poll;
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35)
+   fop->ioctl = tmp_ioctl;
++#endif
+   fop->mmap = tmp_mmap;
+   fop->open = tmp_open;
+   fop->release = tmp_release;
diff --git a/source/multimedia-extra/oss/oss.install 
b/source/multimedia-extra/oss/oss.install
new file mode 100644
index 0000000..b400314
--- /dev/null
+++ b/source/multimedia-extra/oss/oss.install
@@ -0,0 +1,34 @@
+post_install()
+{
+       echo -n "Suppressing ALSA drivers... "
+       /usr/lib/oss/scripts/remove_drv.sh
+       depmod -a
+       /usr/sbin/chkconfig --add rc.oss
+       echo "done."
+       true
+}
+
+post_upgrade()
+{
+       post_install
+       true
+}
+
+pre_remove()
+{
+       echo -n "Restoring ALSA drivers... "
+       /usr/lib/oss/scripts/restore_drv.sh
+       echo "done."
+       /usr/sbin/chkconfig --del rc.oss
+       true
+}
+
+post_remove()
+{
+       depmod -a
+       true
+}
+
+op=$1
+shift
+$op $*
diff --git a/source/multimedia-extra/oss/rc.oss 
b/source/multimedia-extra/oss/rc.oss
new file mode 100644
index 0000000..a85e4c3
--- /dev/null
+++ b/source/multimedia-extra/oss/rc.oss
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# (c) 2010 James Buren <r...@frugalware.org>
+# rc.oss for Frugalware
+# distributed under GPL License
+
+# chkconfig: 2345 99 01
+# description: Starts and stops OSS
+
+source /lib/initscripts/functions
+TEXTDOMAIN=oss
+TEXTDOMAINDIR=/lib/initscripts/messages
+
+actions=(restart status start stop)
+daemon=$"OSS"
+
+rc_start()
+{
+       start_msg
+       /usr/sbin/soundon
+       ok $?
+}
+
+rc_stop()
+{
+       stop_msg
+       /usr/sbin/soundoff
+       ok $?
+}
+
+rc_exec $1
+
+# vim: ft=sh
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to