summaryrefslogtreecommitdiff
path: root/community/oss/PKGBUILD
blob: b0438b37b891bf939e751d6ee4dac483587d2a6a (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# $Id: PKGBUILD 63447 2012-02-03 17:52:25Z bluewind $
# Maintainer: Florian Pritz <bluewind@xinu.at>
# Contributor: Paulo Matias <matiasΘarchlinux-br·org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgbase=oss
pkgname=(oss libflashsupport-oss)
pkgver=4.2_2006
pkgrel=1
arch=('i686' 'x86_64' 'mips64el')
url="http://developer.opensound.com/"
license=('GPL2')
makedepends=('gtk2')
source=("http://www.4front-tech.com/developer/sources/stable/gpl/oss-v${pkgver/_*}-build${pkgver/*_}-src-gpl.tar.bz2"
	"rm-init-scripts.patch"
	"rc-script"
	"soundon.patch"
	"remove-hal.patch"
	)
md5sums=('ca25c06bb7d0c6495e1b6f55d1bad96c'
         'b9a380a0ac8896390d71ac13676f27e1'
         'cbcbce5c03b127df5eafa8faa091492c'
         '65f07fe241bfbf912f76d8b6d8f276b5'
         'cd7f1dc6166bba8c94d96f3a28e948a5')
_dir=oss-v${pkgver/_*}-build${pkgver/*_}-src-gpl

build() {
	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}"

	# Create build directory and configure
	rm -rf build
	mkdir build && cd build
	"${srcdir}/${_dir}/configure" --enable-libsalsa=NO --regparm

	msg "Building OSS."
	make build

	msg "Patching init scripts."
	cd "${srcdir}/build/prototype"
	rm usr/lib/oss/etc/S89oss
	patch -p0 -i "${srcdir}/rm-init-scripts.patch"
	patch -p0 -i "${srcdir}/soundon.patch"
	# remove hal dependency
	patch -p0 -i "${srcdir}/remove-hal.patch"
	rm -rf usr/lib/oss/scripts/oss_usb-create-devices usr/lib/oss/scripts/90-oss_usb-create-device.fdi

	sed -i 's#/lib/modules/$KERNEL_VERSION/kernel/#/lib/modules/$KERNEL_VERSION/extramodules/kernel/#g' usr/sbin/soundon
	sed -i 's#/lib/modules/$UNAME/kernel/#/lib/modules/$UNAME/extramodules/kernel/#g' usr/lib/oss/build/install.sh
	sed -i 's#mkdir /lib/modules#mkdir -p /lib/modules#' usr/lib/oss/build/install.sh
}

package_oss() {
	pkgdesc="Open Sound System UNIX audio architecture"
	depends=('gcc' 'make' 'linux-headers' 'libtool' 'sed')
	optdepends=('gtk2: for graphical mixer (ossxmix)'
	            'libflashsupport-oss: Adobe flash plugin support')
	conflicts=('oss-linux' 'oss-linux-free' 'oss-testing')
	backup=('usr/lib/oss/soundon.user')
	install=oss.install

	cd "${srcdir}/${_dir}"

	msg "Copying files."

	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}/rc-script" "${pkgdir}/etc/rc.d/oss"
}

package_libflashsupport-oss() {
	pkgdesc="Adobe flash plugin support lib (OSSv4)"
	conflicts=('libflashsupport' 'libflashsupport-pulse' 'libflashsupport-oss')
	depends=('oss')

	cd "${srcdir}/${_dir}"

	install -dm755 "$pkgdir/usr/lib"
	ln -s oss/lib/libflashsupport.so "$pkgdir/usr/lib/libflashsupport.so"
}