void-packages/srcpkgs/mpd/template

66 lines
2.6 KiB
Text

# Template file for 'mpd'
pkgname=mpd
version=0.19
revision=5
build_style=gnu-configure
configure_args="--enable-opus --enable-mikmod
--enable-soundcloud --enable-pipe-output --disable-twolame-encoder
--disable-sidplay --enable-bzip2 --enable-zzip $(vopt_enable jack)
$(vopt_enable lame lame-encoder) $(vopt_enable mpcdec mpc)
$(vopt_enable pulseaudio pulse) $(vopt_enable wavpack)"
hostmakedepends="pkg-config"
makedepends="
ffmpeg-devel>=2.1 libmodplug-devel libmad-devel libcurl-devel faad2-devel
sqlite-devel libmms-devel avahi-glib-libs-devel libid3tag-devel boost-devel
yajl-devel>=2.0.4 libogg-devel libflac-devel libsoup-devel bzip2-devel icu-devel>=54
libmikmod-devel libsndfile-devel alsa-lib-devel mpg123-devel libsamplerate-devel
libcdio-devel zziplib-devel libmpdclient-devel opus-devel $(vopt_if jack jack-devel)
$(vopt_if lame lame-devel) $(vopt_if mpcdec libmpcdec-devel)
$(vopt_if pulseaudio pulseaudio-devel) $(vopt_if wavpack wavpack-devel)"
conf_files="/etc/mpd.conf"
system_accounts="mpd"
mpd_homedir="/var/lib/mpd"
make_dirs="/var/lib/mpd/playlists 0755 mpd mpd"
replaces="runit-void<20141013_2"
short_desc="Flexible, powerful, server-side application for playing music"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-2"
homepage="http://www.musicpd.org/"
distfiles="http://www.musicpd.org/download/mpd/${version}/mpd-${version}.tar.xz"
checksum=613239979330d30f08e793ec202c7d6d45c5e78bc744e0216d30316e758d771c
# Package build options
build_options="jack lame mpcdec pulseaudio systemd wavpack"
build_options_default="pulseaudio"
if [ "$build_option_systemd" ]; then
configure_args+=" --enable-systemd-daemon --with-systemdsystemunitdir=/usr/lib/systemd/system"
makedepends+=" systemd-devel"
systemd_services="mpd.service on"
else
configure_args+=" --disable-systemd-daemon"
fi
pre_configure() {
sed -i '/^doc_DATA =/s,doc/mpdconf.example,,' Makefile.in
}
post_install() {
vconf doc/mpdconf.example mpd.conf
vsconf doc/mpdconf.example
sed \
-e '/^#playlist_directory/c playlist_directory "/var/lib/mpd/playlists"' \
-e '/^#db_file/c db_file "/var/lib/mpd/mpd.db"' \
-e '/^#pid_file/c pid_file "/run/mpd/mpd.pid"' \
-e '/^#state_file/c state_file "/var/lib/mpd/mpdstate"' \
-e '/^#user/c user "mpd"' \
-i ${DESTDIR}/etc/mpd.conf
vsv mpd
if [ "$build_option_systemd" ]; then
vinstall ${FILESDIR}/tmpfiles.d 644 usr/lib/tmpfiles.d mpd.conf
install -Dm644 ${DESTDIR}/usr/lib/systemd/{system,user}/mpd.service
sed '/\[Service\]/a User=mpd' -i ${DESTDIR}/usr/lib/systemd/system/mpd.service
sed '/WantedBy=/c WantedBy=default.target' -i ${DESTDIR}/usr/lib/systemd/{system,user}/mpd.service
fi
}