initial import
This commit is contained in:
90
sndio/PKGBUILD
Normal file
90
sndio/PKGBUILD
Normal file
@@ -0,0 +1,90 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgbase=sndio
|
||||
pkgname=(sndio libsndio)
|
||||
pkgver=1.8.1
|
||||
pkgrel=2
|
||||
pkgdesc="A small audio and MIDI service, part of the OpenBSD project"
|
||||
arch=(i686 x86_64)
|
||||
url='https://sndio.org/'
|
||||
license=(ISC)
|
||||
makedepends=(alsa-lib libbsd)
|
||||
source=("https://sndio.org/sndio-$pkgver.tar.gz"{,.asc}
|
||||
'sndio.sh.profile'
|
||||
'sndio.conf.profile'
|
||||
'sndiod.confd'
|
||||
'sndiod.initd'
|
||||
'sndiod.conf'
|
||||
'sndiod.run'
|
||||
'sndiod_log.run')
|
||||
sha512sums=('4affeac5758768f9ebf7d823b8d2287695ff02bb4a990474412ab96cb8eef3784c19436a130efb4f7a204193ad479c0086f9bff7b3ac69e6077692dffaa62658'
|
||||
'SKIP'
|
||||
'c12d2fa3b396aaab1742bc3444349f401359016f5eda89014549bba90ee3abcd76d0c8cd0a2e31009af14cd6502df65892ea79836e35695ddc65a4caec1ab0e6'
|
||||
'cb41ca7689a7948508361c2856a94c18ec999804fab2dd00c954f3c7b445853dc15eda4147e8d5c566aba3878fdf84a0cc75190692e8efd40fc196cf8d544149'
|
||||
'055501c99055fb46d7f66ad8bf704c60ebe0fcb0befa5410429dcf277b6048ad505530924e53079b77a564ed6578bb676bb570c30b2b067a4bd4e3c47a51e79e'
|
||||
'd65d9ac2084f83cbbd5e4c5e20b79b61247dc5f0f63950b3d2876f689b876c3b81a66863434e73ccb19f4e2d3593774dee3aa8387284c592513478c4dc9e4c94'
|
||||
'5ca5d4bf444458e99f4a42dbda5ddff8b7b8a5b2a5aa8a4b0c4556010d7311bd60e30c06b780ce7ee6b060ca750a884666a2c096e4c878b63f0df643825641e4'
|
||||
'bae139ffa72776c36932c03f024a61fee038768381ae3ad50d900ccfe56f0dac7bdd49ee90b6d67896547bec79502bcb59423a530de781615a826db69563e434'
|
||||
'7c459f54b17e2b007164d6a0775d3cfdcc1109a9fbc96f6a73d2eeb37cc87a193b168353ed535c84fa510b7a2175cbda69488497f4afc09eb50823b31baba160')
|
||||
validpgpkeys=('6B1A7447AAF091CCDD36BAA6015E339411694A6E') # Alexandre Ratchov
|
||||
|
||||
build() {
|
||||
cd sndio-$pkgver
|
||||
|
||||
./configure --prefix=/usr --enable-alsa --enable-rmidi --enable-umidi --with-libbsd
|
||||
make
|
||||
}
|
||||
|
||||
package_sndio() {
|
||||
depends=(libsndio=$pkgver)
|
||||
optdepends=('aucatctl: sndio volume control')
|
||||
replaces=(pulseaudio)
|
||||
conflicts=(pulseaudio)
|
||||
provides=(pulseaudio)
|
||||
backup=(etc/sndio.conf etc/conf.d/sndiod etc/sv/sndiod/conf)
|
||||
install=sndio.install
|
||||
|
||||
cd sndio-$pkgver
|
||||
|
||||
make DESTDIR="$pkgdir/" install
|
||||
|
||||
# move sndiod to /usr/sbin for FHS compliance
|
||||
install -d -m 755 "$pkgdir/usr/sbin"
|
||||
mv "$pkgdir/usr/bin/sndiod" "$pkgdir/usr/sbin"
|
||||
|
||||
install -D -m 755 "$srcdir/sndio.sh.profile" "$pkgdir/etc/profile.d/sndio.sh"
|
||||
install -D -m 644 "$srcdir/sndio.conf.profile" "$pkgdir/etc/sndio.conf"
|
||||
|
||||
install -D -m 755 "$srcdir/sndiod.initd" "$pkgdir/etc/init.d/sndiod"
|
||||
install -D -m 644 "$srcdir/sndiod.confd" "$pkgdir/etc/conf.d/sndiod"
|
||||
|
||||
install -D -m 755 "$srcdir/sndiod_log.run" "$pkgdir/etc/sv/sndiod/log/run"
|
||||
install -D -m 755 "$srcdir/sndiod.run" "$pkgdir/etc/sv/sndiod/run"
|
||||
install -D -m 644 "$srcdir/sndiod.conf" "$pkgdir/etc/sv/sndiod/conf"
|
||||
|
||||
install -d "$pkgdir/usr/share/licenses/$pkgname"
|
||||
# this is the most up-to-date license outside of bsd-compat,
|
||||
# which isn't being used in this build
|
||||
sed -n '/Copyright/,/PERFORMANCE/p' aucat/aucat.c > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
|
||||
cd libsndio
|
||||
make DESTDIR="$pkgdir" uninstall
|
||||
rm -r $pkgdir/usr/{include,lib,share/man/man{3,7}}
|
||||
}
|
||||
|
||||
package_libsndio() {
|
||||
pkgdesc+=' (client library)'
|
||||
depends=(alsa-lib libbsd)
|
||||
replaces=(libpulse)
|
||||
conflicts=(libpulse)
|
||||
provides=(libpulse)
|
||||
|
||||
cd sndio-$pkgver/libsndio
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
|
||||
install -d "$pkgdir/usr/share/licenses/$pkgname"
|
||||
# this is the most up-to-date license outside of bsd-compat,
|
||||
# which isn't being used in this build
|
||||
sed -n '/Copyright/,/PERFORMANCE/p' ../aucat/aucat.c > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
}
|
||||
1
sndio/sndio.conf.profile
Normal file
1
sndio/sndio.conf.profile
Normal file
@@ -0,0 +1 @@
|
||||
AUDIODEVICE=snd/0
|
||||
63
sndio/sndio.install
Normal file
63
sndio/sndio.install
Normal file
@@ -0,0 +1,63 @@
|
||||
post_install() {
|
||||
if ! getent passwd sndiod &>/dev/null; then
|
||||
useradd -r -g audio -G adm -d /run/sndiod -s /bin/nologin sndiod >/dev/null
|
||||
fi
|
||||
if ! groups sndiod | grep audio &>/dev/null; then
|
||||
gpasswd -a sndiod audio >/dev/null
|
||||
fi
|
||||
if ! groups sndiod | grep adm &>/dev/null; then
|
||||
gpasswd -a sndiod adm >/dev/null
|
||||
fi
|
||||
sndiod_shell=$(getent passwd sndiod | cut -d: -f7)
|
||||
if [ "$sndiod_shell" != '/bin/nologin' ]; then
|
||||
chsh -s /bin/nologin sndiod &>/dev/null
|
||||
fi
|
||||
if [[ ! -h /etc/runlevels/default/sndiod ]]; then
|
||||
if [[ ! -d /etc/runlevels/default ]]; then
|
||||
mkdir -p /etc/runlevels/default
|
||||
fi
|
||||
ln -s /etc/init.d/sndiod /etc/runlevels/default/sndiod
|
||||
fi
|
||||
if [[ ! -h /etc/runlevels/nonetwork/sndiod ]]; then
|
||||
if [[ ! -d /etc/runlevels/nonetwork ]]; then
|
||||
mkdir -p /etc/runlevels/nonetwork
|
||||
fi
|
||||
ln -s /etc/init.d/sndiod /etc/runlevels/nonetwork/sndiod
|
||||
fi
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
if ! getent passwd sndiod &>/dev/null; then
|
||||
useradd -r -g audio -G adm -d /run/sndiod -s /bin/nologin sndiod >/dev/null
|
||||
fi
|
||||
if ! groups sndiod | grep audio &>/dev/null; then
|
||||
gpasswd -a sndiod audio >/dev/null
|
||||
fi
|
||||
if ! groups sndiod | grep adm &>/dev/null; then
|
||||
gpasswd -a sndiod adm >/dev/null
|
||||
fi
|
||||
sndiod_shell=$(getent passwd sndiod | cut -d: -f7)
|
||||
if [ "$sndiod_shell" != '/bin/nologin' ]; then
|
||||
chsh -s /bin/nologin sndiod &>/dev/null
|
||||
fi
|
||||
if (( $(vercmp $2 1.6.0-1.hyperbola4.backports1) < 0 )); then
|
||||
if [[ ! -h /etc/runlevels/default/sndiod ]]; then
|
||||
if [[ ! -d /etc/runlevels/default ]]; then
|
||||
mkdir -p /etc/runlevels/default
|
||||
fi
|
||||
ln -s /etc/init.d/sndiod /etc/runlevels/default/sndiod
|
||||
fi
|
||||
if [[ ! -h /etc/runlevels/nonetwork/sndiod ]]; then
|
||||
if [[ ! -d /etc/runlevels/nonetwork ]]; then
|
||||
mkdir -p /etc/runlevels/nonetwork
|
||||
fi
|
||||
ln -s /etc/init.d/sndiod /etc/runlevels/nonetwork/sndiod
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
if getent passwd sndiod &>/dev/null; then
|
||||
userdel sndiod >/dev/null
|
||||
fi
|
||||
}
|
||||
12
sndio/sndio.sh.profile
Normal file
12
sndio/sndio.sh.profile
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/sndio.conf" ]; then
|
||||
. "$XDG_CONFIG_HOME/sndio.conf"
|
||||
elif [ -n "$HOME" ] && [ -r "$HOME/.config/sndio.conf" ]; then
|
||||
. "$HOME/.config/sndio.conf"
|
||||
elif [ -r /etc/sndio.conf ]; then
|
||||
. /etc/sndio.conf
|
||||
fi
|
||||
|
||||
[ -n "$AUDIODEVICE" ] && export AUDIODEVICE
|
||||
[ -n "$MIDIDEVICE" ] && export MIDIDEVICE
|
||||
2
sndio/sndiod.conf
Normal file
2
sndio/sndiod.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
OPTS="-L localhost -j off \
|
||||
-a off -e s16 -r 48000 -f rsnd/0 -m play,rec -v 118 -s default"
|
||||
7
sndio/sndiod.confd
Normal file
7
sndio/sndiod.confd
Normal file
@@ -0,0 +1,7 @@
|
||||
# /etc/conf.d/sndiod: config file for /etc/init.d/sndiod
|
||||
|
||||
# Options to pass to the sndiod service.
|
||||
# See the sndiod(8) man page for more info.
|
||||
|
||||
SNDIOD_ARGS="-L localhost -j off \
|
||||
-a off -e s16 -r 48000 -f rsnd/0 -m play,rec -v 118 -s default"
|
||||
20
sndio/sndiod.initd
Normal file
20
sndio/sndiod.initd
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 2019 Hyperbola Project
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
description="sndio service"
|
||||
|
||||
command="/usr/sbin/sndiod"
|
||||
command_args="-dd $SNDIOD_ARGS"
|
||||
command_background="yes"
|
||||
pidfile="/run/sndiod/sndiod.pid"
|
||||
retry="TERM/10/KILL/5"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after bootmisc modules isapnp coldplug hotplug alsasound
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory --mode 0700 /run/sndiod
|
||||
}
|
||||
3
sndio/sndiod.run
Normal file
3
sndio/sndiod.run
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
[ -r conf ] && . ./conf
|
||||
exec sndiod ${OPTS} -d 2>&1
|
||||
2
sndio/sndiod_log.run
Normal file
2
sndio/sndiod_log.run
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec logger -t sndiod
|
||||
Reference in New Issue
Block a user