diff --git a/scripts/gentoo/openrc/conf.d/shairport b/scripts/gentoo/openrc/conf.d/shairport new file mode 100644 index 000000000..f8d493644 --- /dev/null +++ b/scripts/gentoo/openrc/conf.d/shairport @@ -0,0 +1,26 @@ +# /etc/conf.d/shairport: config file for /etc/init.d/shairport + +# The pidfile for the shairport daemon (--pidfile=$PIDFILE) +#PIDFILE=/var/run/shairport.pid + +# The name shairport advertizes (-a $NAME) +#NAME=myairplay + +# How full the buffer must be before audio output starts (-b $BUF_FILL) +#BUF_FILL=100 + +# The log file (for stdout, --log $LOGFILE) +LOGFILE=/var/log/shairport.log + +# The error file (for stderr, --error $ERRFILE) +#ERRFILE=/var/log/shairport.err + +# The backend to use (--output=$BACKEND -- $BACKEND_OPTS) +# Shairport's help (shairport -h) shows all of the available +# backends and their options +#BACKEND=alsa +#BACKEND_OPTS="-d default -t software ...some other opts..." + +# Force the use of MDNS to advertize the service +# Shairport's help (shairport -h) shows all of the available mDNS backends +#MDNS=avahi diff --git a/scripts/gentoo/openrc/init.d/shairport b/scripts/gentoo/openrc/init.d/shairport new file mode 100755 index 000000000..bb574bd7f --- /dev/null +++ b/scripts/gentoo/openrc/init.d/shairport @@ -0,0 +1,46 @@ +#!/sbin/runscript + +EXEC=/usr/local/bin/shairport + +. /etc/conf.d/shairport + +depend() { + need net + after bootmisc +} + +start() { + OPTIONS="--daemon" + + if [[ -z "$PIDFILE" ]]; then PIDFILE=/var/run/shairport.pid; fi + OPTIONS="$OPTIONS --pidfile=$PIDFILE" + + if [[ ! -z "$NAME" ]]; then OPTIONS="$OPTIONS --name=$NAME"; fi + + if [[ ! -z "$BUF_FILL" ]]; then OPTIONS="$OPTIONS -b $BUF_FILL"; fi + + if [[ -z $NAME ]] + then + ebegin "Starting shairport" + else + ebegin "Starting shairport as $NAME" + fi + + if [[ ! -z "$LOGFILE" ]]; then OPTIONS="$OPTIONS --log $LOGFILE"; fi + + if [[ ! -z "$ERRFILE" ]]; then OPTIONS="$OPTIONS --error $ERRFILE"; fi + + if [[ ! -z "$MDNS" ]]; then OPTIONS="$OPTIONS --mdns $MDNS"; fi + + if [[ ! -z "$BACKEND" ]]; then OPTIONS="$OPTIONS --output=$BACKEND $BACKEND_OPTS"; fi + if [[ ! -z "$BACKEND_OPTS" ]]; then OPTIONS="$OPTIONS -- $BACKEND_OPTS"; fi + + start-stop-daemon --start --exec $EXEC -- $OPTIONS + eend $? +} + +stop() { + ebegin "Stopping shairport" + start-stop-daemon --stop --exec $EXEC + eend $? +} diff --git a/scripts/gentoo/shairport-9999.ebuild b/scripts/gentoo/shairport-9999.ebuild new file mode 100644 index 000000000..2261d7ec5 --- /dev/null +++ b/scripts/gentoo/shairport-9999.ebuild @@ -0,0 +1,29 @@ +# $Header: $ + +EAPI="5" + +inherit git-2 + +DESCRIPTION="This program emulates an AirPort Express for the purpose of \ + streaming music from iTunes and compatible iPods and iPhones. \ + It implements a server for the Apple RAOP protocol. ShairPort \ + does not support AirPlay v2 (video and photo streaming)." +HOMEPAGE="https://github.com/abrasive/shairport" +EGIT_REPO_URI="https://github.com/abrasive/shairport.git" + +SLOT="0" +KEYWORDS="" +IUSE="ao avahi pulseaudio" + +DEPEND="dev-libs/openssl \ + ao? ( media-libs/libao ) \ + avahi? ( net-dns/avahi ) \ + pulseaudio? ( media-sound/pulseaudio )" +RDEPEND="${DEPEND}" + +src_install() { + emake PREFIX="${D}" install + + doinitd scripts/gentoo/openrc/init.d/shairport + doconfd scripts/gentoo/openrc/conf.d/shairport +}