| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/media-sound/mpd/mpd-0.16.8.ebuild,v 1.11 2012/08/27 17:30:30 armin76 Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
inherit eutils flag-o-matic linux-info multilib systemd user
|
| 7 |
|
| 8 |
DESCRIPTION="The Music Player Daemon (mpd)"
|
| 9 |
HOMEPAGE="http://www.musicpd.org"
|
| 10 |
SRC_URI="mirror://sourceforge/musicpd/${P}.tar.bz2"
|
| 11 |
|
| 12 |
LICENSE="GPL-2"
|
| 13 |
SLOT="0"
|
| 14 |
KEYWORDS="amd64 arm hppa ppc ppc64 sh sparc x86 ~x86-fbsd ~x64-macos"
|
| 15 |
IUSE="aac +alsa ao audiofile bzip2 cdio cue +curl debug +fifo +ffmpeg flac
|
| 16 |
fluidsynth profile +id3tag inotify ipv6 jack lame lastfmradio mms libsamplerate
|
| 17 |
+mad mikmod modplug mpg123 musepack +network ogg openal oss pipe pulseaudio sid
|
| 18 |
sndfile sqlite tcpd twolame unicode vorbis wavpack wildmidi zeroconf zip"
|
| 19 |
|
| 20 |
REQUIRED_USE="|| ( alsa ao fifo jack network openal oss pipe pulseaudio )
|
| 21 |
|| ( aac audiofile ffmpeg flac fluidsynth mad mikmod modplug mpg123 musepack
|
| 22 |
ogg flac sid vorbis wavpack wildmidi )
|
| 23 |
network? ( || ( audiofile flac lame twolame vorbis ) )
|
| 24 |
lastfmradio? ( curl )"
|
| 25 |
|
| 26 |
RDEPEND="!<sys-cluster/mpich2-1.4_rc2
|
| 27 |
dev-libs/glib:2
|
| 28 |
aac? ( media-libs/faad2 )
|
| 29 |
alsa? ( media-sound/alsa-utils
|
| 30 |
media-libs/alsa-lib )
|
| 31 |
ao? ( media-libs/libao[alsa?,pulseaudio?] )
|
| 32 |
audiofile? ( media-libs/audiofile )
|
| 33 |
bzip2? ( app-arch/bzip2 )
|
| 34 |
cdio? ( dev-libs/libcdio[-minimal] )
|
| 35 |
cue? ( media-libs/libcue )
|
| 36 |
curl? ( net-misc/curl )
|
| 37 |
ffmpeg? ( virtual/ffmpeg )
|
| 38 |
flac? ( media-libs/flac[ogg?] )
|
| 39 |
fluidsynth? ( media-sound/fluidsynth )
|
| 40 |
network? ( >=media-libs/libshout-2
|
| 41 |
!lame? ( !vorbis? ( media-libs/libvorbis ) ) )
|
| 42 |
id3tag? ( media-libs/libid3tag )
|
| 43 |
jack? ( media-sound/jack-audio-connection-kit )
|
| 44 |
lame? ( network? ( media-sound/lame ) )
|
| 45 |
mms? ( media-libs/libmms )
|
| 46 |
libsamplerate? ( media-libs/libsamplerate )
|
| 47 |
mad? ( media-libs/libmad )
|
| 48 |
mikmod? ( media-libs/libmikmod:0 )
|
| 49 |
modplug? ( media-libs/libmodplug )
|
| 50 |
mpg123? ( >=media-sound/mpg123-1.12.2 )
|
| 51 |
musepack? ( media-sound/musepack-tools )
|
| 52 |
ogg? ( media-libs/libogg )
|
| 53 |
openal? ( media-libs/openal )
|
| 54 |
pulseaudio? ( media-sound/pulseaudio )
|
| 55 |
sid? ( media-libs/libsidplay:2 )
|
| 56 |
sndfile? ( media-libs/libsndfile )
|
| 57 |
sqlite? ( dev-db/sqlite:3 )
|
| 58 |
tcpd? ( sys-apps/tcp-wrappers )
|
| 59 |
twolame? ( media-sound/twolame )
|
| 60 |
vorbis? ( media-libs/libvorbis )
|
| 61 |
wavpack? ( media-sound/wavpack )
|
| 62 |
wildmidi? ( media-sound/wildmidi )
|
| 63 |
zeroconf? ( net-dns/avahi[dbus] )
|
| 64 |
zip? ( dev-libs/zziplib )"
|
| 65 |
DEPEND="${RDEPEND}
|
| 66 |
virtual/pkgconfig"
|
| 67 |
|
| 68 |
pkg_setup() {
|
| 69 |
use network || ewarn "Icecast and Shoutcast streaming needs networking."
|
| 70 |
use fluidsynth && ewarn "Using fluidsynth is discouraged by upstream."
|
| 71 |
|
| 72 |
enewuser mpd "" "" "/var/lib/mpd" audio
|
| 73 |
|
| 74 |
if use inotify; then
|
| 75 |
CONFIG_CHECK="~INOTIFY_USER"
|
| 76 |
ERROR_INOTIFY_USER="${P} requires inotify in-kernel support."
|
| 77 |
linux-info_pkg_setup
|
| 78 |
fi
|
| 79 |
}
|
| 80 |
|
| 81 |
src_prepare() {
|
| 82 |
cp -f doc/mpdconf.example doc/mpdconf.dist || die "cp failed"
|
| 83 |
epatch "${FILESDIR}"/${PN}-0.16.conf.patch
|
| 84 |
}
|
| 85 |
|
| 86 |
src_configure() {
|
| 87 |
local mpdconf="--enable-tcp --enable-un --disable-documentation
|
| 88 |
--disable-ffado --disable-gme --enable-largefile
|
| 89 |
--disable-mvp --docdir=${EPREFIX}/usr/share/doc/${PF}"
|
| 90 |
|
| 91 |
if use network; then
|
| 92 |
mpdconf+=" --enable-shout $(use_enable vorbis vorbis-encoder)
|
| 93 |
--enable-httpd-output $(use_enable lame lame-encoder)
|
| 94 |
$(use_enable twolame twolame-encoder)
|
| 95 |
$(use_enable audiofile wave-encoder)"
|
| 96 |
else
|
| 97 |
mpdconf+=" --disable-shout --disable-vorbis-encoder
|
| 98 |
--disable-httpd-output --disable-lame-encoder
|
| 99 |
--disable-twolame-encoder --disable-wave-encoder"
|
| 100 |
fi
|
| 101 |
|
| 102 |
if use flac && use ogg; then
|
| 103 |
mpdconf+=" --enable-oggflac"
|
| 104 |
else
|
| 105 |
mpdconf+=" --disable-oggflac"
|
| 106 |
fi
|
| 107 |
|
| 108 |
append-lfs-flags
|
| 109 |
append-ldflags "-L/usr/$(get_libdir)/sidplay/builders"
|
| 110 |
|
| 111 |
econf \
|
| 112 |
$(use_enable aac) \
|
| 113 |
$(use_enable alsa) \
|
| 114 |
$(use_enable ao) \
|
| 115 |
$(use_enable audiofile) \
|
| 116 |
$(use_enable bzip2) \
|
| 117 |
$(use_enable cdio iso9660) \
|
| 118 |
$(use_enable cue) \
|
| 119 |
$(use_enable curl) \
|
| 120 |
$(use_enable debug) \
|
| 121 |
$(use_enable ffmpeg) \
|
| 122 |
$(use_enable fifo) \
|
| 123 |
$(use_enable flac) \
|
| 124 |
$(use_enable fluidsynth) \
|
| 125 |
$(use_enable id3tag id3) \
|
| 126 |
$(use_enable inotify) \
|
| 127 |
$(use_enable ipv6) \
|
| 128 |
$(use_enable jack) \
|
| 129 |
$(use_enable lastfmradio lastfm) \
|
| 130 |
$(use_enable mms) \
|
| 131 |
$(use_enable libsamplerate lsr) \
|
| 132 |
$(use_enable mad) \
|
| 133 |
$(use_enable mikmod) \
|
| 134 |
$(use_enable modplug) \
|
| 135 |
$(use_enable mpg123) \
|
| 136 |
$(use_enable musepack mpc) \
|
| 137 |
$(use_enable openal) \
|
| 138 |
$(use_enable oss) \
|
| 139 |
$(use_enable pipe pipe-output) \
|
| 140 |
$(use_enable profile gprof) \
|
| 141 |
$(use_enable pulseaudio pulse) \
|
| 142 |
$(use_enable sid sidplay) \
|
| 143 |
$(use_enable sndfile sndfile) \
|
| 144 |
$(use_enable sqlite) \
|
| 145 |
$(use_enable tcpd libwrap) \
|
| 146 |
$(use_enable vorbis) \
|
| 147 |
$(use_enable wavpack) \
|
| 148 |
$(use_enable wildmidi) \
|
| 149 |
$(use_enable zip zzip) \
|
| 150 |
$(use_with zeroconf zeroconf avahi) \
|
| 151 |
"$(systemd_with_unitdir)" \
|
| 152 |
${mpdconf}
|
| 153 |
}
|
| 154 |
|
| 155 |
src_install() {
|
| 156 |
emake DESTDIR="${D}" install
|
| 157 |
|
| 158 |
insinto /etc
|
| 159 |
newins doc/mpdconf.dist mpd.conf
|
| 160 |
|
| 161 |
newinitd "${FILESDIR}"/mpd.init mpd
|
| 162 |
|
| 163 |
if use unicode; then
|
| 164 |
sed -i -e 's:^#filesystem_charset.*$:filesystem_charset "UTF-8":' \
|
| 165 |
"${ED}"/etc/mpd.conf || die "sed failed"
|
| 166 |
fi
|
| 167 |
|
| 168 |
use prefix || diropts -m0755 -o mpd -g audio
|
| 169 |
dodir /var/lib/mpd
|
| 170 |
keepdir /var/lib/mpd
|
| 171 |
dodir /var/lib/mpd/music
|
| 172 |
keepdir /var/lib/mpd/music
|
| 173 |
dodir /var/lib/mpd/playlists
|
| 174 |
keepdir /var/lib/mpd/playlists
|
| 175 |
}
|
| 176 |
|
| 177 |
pkg_postinst() {
|
| 178 |
elog "If you will be starting mpd via /etc/init.d/mpd, please make"
|
| 179 |
elog "sure that MPD's pid_file is unset."
|
| 180 |
|
| 181 |
# also change the homedir if the user has existed before
|
| 182 |
usermod -d "/var/lib/mpd" mpd
|
| 183 |
}
|