initial import
This commit is contained in:
65
ossp/PKGBUILD
Normal file
65
ossp/PKGBUILD
Normal file
@@ -0,0 +1,65 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=ossp
|
||||
pkgver=1.3.2
|
||||
_debver=1.3.2
|
||||
_debrel=7
|
||||
pkgrel=15.hyperbola3
|
||||
pkgdesc="Emulate OSS device using CUSE, without libpulse support and with OpenRC support"
|
||||
arch=('i686' 'x86_64')
|
||||
url="https://sourceforge.net/projects/osspd/"
|
||||
license=('GPL-2')
|
||||
depends=('fuse>=2.8.0')
|
||||
makedepends=('alsa-lib' 'quilt')
|
||||
optdepends=("alsa-lib: ALSA backend")
|
||||
backup=('etc/conf.d/osspd')
|
||||
source=("https://downloads.sourceforge.net/project/osspd/$pkgname-$pkgver.tar.gz"
|
||||
"https://deb.debian.org/debian/pool/main/o/osspd/osspd_$_debver-$_debrel.debian.tar.xz"
|
||||
'remove-pulseaudio-support.patch'
|
||||
'osspd.confd'
|
||||
'osspd.initd'
|
||||
'osspd.modulesd')
|
||||
sha512sums=('672643187ec58bbfdd0f3207fd68037405bf86647c040a09d5db485754d82203a60e703b01bbbd6fd9698a689a63384876caf5a171229585f35ca73c44d708d2'
|
||||
'43f4c9b4ae824495c9fb74941d31b58c84184e2dcf76c556cba5034eebb19c0367c4a160f3a0ae4254ec38d973ff619df05ce8d56b492c474bd5a2d81df86237'
|
||||
'c1d1b4357943f8eb25b389f628981a25928c3bb92ed8cf69ee2df1ac28b81ee7b7392650b3bd2a45e67c87e8e2245fdc2076c61f163fed8e94aad61406dbccb7'
|
||||
'b6bab8acd08583ddff1123077d013c8e12278485bb5aeceb64e14fae124ce940e83025e1d59e1c46ddf37a1add210220213b0b2cc0b4a393a84963f3d0c31efa'
|
||||
'eee9ecff5b5f50c173a4aec4c0a9e908dadd10272dc8a64af8410f13b8190fc176dab93a35ba75694433393ca62cf7eff220d53cdc09654e97b74d9d3dc0bc34'
|
||||
'cb1a9669b7906f3b408648e41b08251ecceb9743437726fb060ca1f9d2469be16b14243c08456352bb39e5bbab9f696fb375526fb5e442e040be9bcc0b117172')
|
||||
|
||||
prepare() {
|
||||
cd $pkgname-$pkgver
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
# Doesn't apply and seems unimportant
|
||||
rm -v debian/patches/0003-PA-recommends-users-not-to-be-in-the-audio-group-so-.patch || true
|
||||
|
||||
quilt push -av
|
||||
else
|
||||
sed -i 's|GROUP="audio"|SUBSYSTEM=="cuse", MODE="0666"|' 98-osscuse.rules
|
||||
fi
|
||||
patch -p1 -i ../remove-pulseaudio-support.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
cd $pkgname-$pkgver
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd $pkgname-$pkgver
|
||||
make DESTDIR="$pkgdir" prefix=/usr UDEVDIR=/lib/udev/rules.d install
|
||||
|
||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
|
||||
install -Dm644 "$srcdir/osspd.confd" "$pkgdir/etc/conf.d/osspd"
|
||||
install -Dm755 "$srcdir/osspd.initd" "$pkgdir/etc/init.d/osspd"
|
||||
install -Dm644 "$srcdir/osspd.modulesd" "$pkgdir/etc/modules.d/osspd"
|
||||
|
||||
install -Dm644 README "$pkgdir/usr/share/doc/$pkgname/README"
|
||||
}
|
||||
6
ossp/osspd.confd
Normal file
6
ossp/osspd.confd
Normal file
@@ -0,0 +1,6 @@
|
||||
# Here you can choose the backend which osspd should use during operation.
|
||||
# You can choose from the following backends:
|
||||
# ossp-alsap - ALSA backend
|
||||
# ossp-padsp - Pulseaudio backend
|
||||
|
||||
OSSPD_BACKEND="%OSSPD_BACKEND%"
|
||||
40
ossp/osspd.initd
Normal file
40
ossp/osspd.initd
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Copyright 2019 Hyperbola Project
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
OSSPD="/usr/sbin/osspd"
|
||||
|
||||
check_prerequisites() {
|
||||
if [ ! -c /dev/cuse ] ; then
|
||||
eerror "Cannot find /dev/cuse character device!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -x "/usr/sbin/${OSSPD_BACKEND}" ] ; then
|
||||
CHOSEN_BACKEND="/usr/sbin/${OSSPD_BACKEND}"
|
||||
else
|
||||
eerror "Cannot find backend!"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
depend() {
|
||||
need fuse
|
||||
after alsasound pulseaudio
|
||||
}
|
||||
|
||||
start() {
|
||||
check_prerequisites || return 1
|
||||
ebegin "Starting osspd with ${OSSPD_BACKEND} backend"
|
||||
start-stop-daemon --start --quiet --exec ${OSSPD} \
|
||||
-- --dsp-slave=${CHOSEN_BACKEND}
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Shutting down osspd"
|
||||
start-stop-daemon --stop --quiet --exec ${OSSPD}
|
||||
eend $?
|
||||
}
|
||||
2
ossp/osspd.modulesd
Normal file
2
ossp/osspd.modulesd
Normal file
@@ -0,0 +1,2 @@
|
||||
cuse
|
||||
snd-seq-oss
|
||||
96
ossp/remove-pulseaudio-support.patch
Normal file
96
ossp/remove-pulseaudio-support.patch
Normal file
@@ -0,0 +1,96 @@
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index b578114..47597d1 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -1,6 +1,5 @@
|
||||
*.[oa]
|
||||
*~
|
||||
ossp-alsap
|
||||
-ossp-padsp
|
||||
osspd
|
||||
osstest
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 11f2836..43d559c 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -18,14 +18,6 @@ ifeq "$(origin OSSPD_LDFLAGS)" "undefined"
|
||||
OSSPD_LDFLAGS := $(shell pkg-config --libs fuse)
|
||||
endif
|
||||
|
||||
-ifeq "$(origin OSSP_PADSP_CFLAGS)" "undefined"
|
||||
-OSSP_PADSP_CFLAGS := $(shell pkg-config --cflags libpulse)
|
||||
-endif
|
||||
-
|
||||
-ifeq "$(origin OSSP_PADSP_LDFLAGS)" "undefined"
|
||||
-OSSP_PADSP_LDFLAGS := $(shell pkg-config --libs libpulse)
|
||||
-endif
|
||||
-
|
||||
ifeq "$(origin OSSP_ALSAP_CFLAGS)" "undefined"
|
||||
OSSP_ALSAP_CFLAGS := $(shell pkg-config --libs alsa)
|
||||
endif
|
||||
@@ -36,12 +28,12 @@ endif
|
||||
|
||||
headers := ossp.h ossp-util.h ossp-slave.h
|
||||
|
||||
-all: osspd ossp-padsp ossp-alsap
|
||||
+all: osspd ossp-alsap
|
||||
|
||||
install:
|
||||
mkdir -p $(DESTDIR)$(prefix)/sbin $(DESTDIR)$(SLAVESDIR)
|
||||
install -m755 osspd $(DESTDIR)$(prefix)/sbin
|
||||
- install -m755 ossp-padsp ossp-alsap $(DESTDIR)$(SLAVESDIR)
|
||||
+ install -m755 ossp-alsap $(DESTDIR)$(SLAVESDIR)
|
||||
mkdir -p $(DESTDIR)$(UDEVDIR)
|
||||
install -m644 98-osscuse.rules $(DESTDIR)$(UDEVDIR)
|
||||
|
||||
@@ -54,9 +46,6 @@ libossp.a: ossp.c ossp.h ossp-util.c ossp-util.h ossp-slave.c ossp-slave.h
|
||||
osspd: osspd.c libossp.a $(headers)
|
||||
$(CC) $(CFLAGS) $(OSSPD_CFLAGS) -DSLAVE_DEFAULT_PATH=\"$(SLAVESDIR)\" -o $@ $< $(OSSPD_LDFLAGS) $(LDFLAGS)
|
||||
|
||||
-ossp-padsp: ossp-padsp.c libossp.a $(headers)
|
||||
- $(CC) $(CFLAGS) $(OSSP_PADSP_CFLAGS) -o $@ $< $(OSSP_PADSP_LDFLAGS) $(LDFLAGS)
|
||||
-
|
||||
ossp-alsap: ossp-alsap.c libossp.a $(headers)
|
||||
$(CC) $(CFLAGS) $(OSSP_ALSAP_CFLAGS) -o $@ $< $(OSSP_ALSAP_LDFLAGS) $(LDFLAGS)
|
||||
|
||||
@@ -67,4 +56,4 @@ test: osstest
|
||||
@./osstest
|
||||
|
||||
clean:
|
||||
- rm -f *.o *.a osspd ossp-padsp ossp-alsap osstest
|
||||
+ rm -f *.o *.a osspd ossp-alsap osstest
|
||||
diff --git a/ossp-slave.c b/ossp-slave.c
|
||||
index a290636..eb1791f 100644
|
||||
--- a/ossp-slave.c
|
||||
+++ b/ossp-slave.c
|
||||
@@ -98,7 +98,7 @@ void ossp_slave_init(int argc, char **argv)
|
||||
snprintf(ossp_user_name, sizeof(ossp_user_name), "%s",
|
||||
pw->pw_name);
|
||||
|
||||
- snprintf(ossp_log_name, sizeof(ossp_log_name), "ossp-padsp[%s:%d]",
|
||||
+ snprintf(ossp_log_name, sizeof(ossp_log_name), "ossp-alsap[%s:%d]",
|
||||
ossp_user_name, getpid());
|
||||
|
||||
if (mmap_fd >= 0) {
|
||||
diff --git a/osspd.c b/osspd.c
|
||||
index 6b63c07..20c60ad 100644
|
||||
--- a/osspd.c
|
||||
+++ b/osspd.c
|
||||
@@ -2005,7 +2005,7 @@ static const char *usage =
|
||||
" --max=MAX maximum number of open streams (default 256)\n"
|
||||
" --umax=MAX maximum number of open streams per UID (default --max)\n"
|
||||
" --exit-on-idle exit if idle\n"
|
||||
-" --dsp-slave=PATH DSP slave (default: " SLAVE_DEFAULT_PATH "/ossp-padsp)\n"
|
||||
+" --dsp-slave=PATH DSP slave (default: " SLAVE_DEFAULT_PATH "/ossp-alsap)\n"
|
||||
" --log=LEVEL log level (0..6)\n"
|
||||
" --timestamp timestamp log messages\n"
|
||||
" -v increase verbosity, can be specified multiple times\n"
|
||||
@@ -2179,7 +2179,7 @@ int main(int argc, char **argv)
|
||||
dsp_slave_path[PATH_MAX - 1] = '\0';
|
||||
} else {
|
||||
ret = snprintf(dsp_slave_path, PATH_MAX, "%s/%s",
|
||||
- SLAVE_DEFAULT_PATH, "ossp-padsp");
|
||||
+ SLAVE_DEFAULT_PATH, "ossp-alsap");
|
||||
if (ret >= PATH_MAX)
|
||||
fatal("dsp slave pathname too long");
|
||||
}
|
||||
Reference in New Issue
Block a user