summaryrefslogtreecommitdiff
path: root/community/oss/PKGBUILD
blob: d83649895d63faedc4f68f9ccd0721e20bb38aa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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' 'mips64el')
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
}