1 # Copyright 1999-2013 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.17.3.ebuild,v 1.2 2013/01/16 08:20:12 ssuominen Exp $
6 inherit eutils flag-o-matic linux-info multilib systemd user autotools git-2
8 DESCRIPTION
="The Music Player Daemon (mpd)"
9 HOMEPAGE
="http://www.musicpd.org"
10 EGIT_REPO_URI
="git://git.musicpd.org/master/mpd.git"
15 IUSE
="aac +alsa ao audiofile bzip2 cdio +curl debug +fifo +ffmpeg flac
16 fluidsynth gme +id3tag inotify ipv6 jack lame lastfmradio mms libsamplerate +mad
17 mikmod modplug mpg123 musepack +network ogg openal oss pipe pulseaudio recorder
18 sid sndfile soundcloud soup sqlite systemd tcpd twolame unicode vorbis wavpack
19 wildmidi zeroconf zip"
21 OUTPUT_PLUGINS
="alsa ao fifo jack network openal oss pipe pulseaudio recorder"
22 INPUT_PLUGINS
="aac audiofile ffmpeg flac fluidsynth mad mikmod modplug mpg123
23 musepack ogg flac sid vorbis wavpack wildmidi"
24 ENCODER_PLUGINS
="audiofile flac lame twolame vorbis"
26 REQUIRED_USE
="|| ( ${OUTPUT_PLUGINS} )
27 || ( ${INPUT_PLUGINS} )
28 network? ( || ( ${ENCODER_PLUGINS} ) )
29 recorder? ( || ( ${ENCODER_PLUGINS} ) )
30 lastfmradio? ( curl )"
32 RDEPEND
="!<sys-cluster/mpich2-1.4_rc2
34 aac? ( media-libs/faad2 )
35 alsa? ( media-sound/alsa-utils
37 ao? ( media-libs/libao[alsa?,pulseaudio?] )
38 audiofile? ( media-libs/audiofile )
39 bzip2? ( app-arch/bzip2 )
40 cdio? ( || ( dev-libs/libcdio-paranoia <dev-libs/libcdio-0.90[-minimal] ) )
41 curl? ( net-misc/curl )
42 ffmpeg? ( virtual/ffmpeg )
43 flac? ( media-libs/flac[ogg?] )
44 fluidsynth? ( media-sound/fluidsynth )
45 gme? ( >=media-libs/game-music-emu-0.6.0_pre20120802 )
46 id3tag? ( media-libs/libid3tag )
47 jack? ( media-sound/jack-audio-connection-kit )
48 lame? ( network? ( media-sound/lame ) )
49 libsamplerate? ( media-libs/libsamplerate )
50 mad? ( media-libs/libmad )
51 mikmod? ( media-libs/libmikmod:0 )
52 mms? ( media-libs/libmms )
53 modplug? ( media-libs/libmodplug )
54 mpg123? ( >=media-sound/mpg123-1.12.2 )
55 musepack? ( media-sound/musepack-tools )
56 network? ( >=media-libs/libshout-2
57 !lame? ( !vorbis? ( media-libs/libvorbis ) ) )
58 ogg? ( media-libs/libogg )
59 openal? ( media-libs/openal )
60 pulseaudio? ( media-sound/pulseaudio )
61 sid? ( media-libs/libsidplay:2 )
62 sndfile? ( media-libs/libsndfile )
63 soundcloud? ( >=dev-libs/yajl-2 )
64 soup? ( net-libs/libsoup:2.4 )
65 sqlite? ( dev-db/sqlite:3 )
66 systemd? ( sys-apps/systemd )
67 tcpd? ( sys-apps/tcp-wrappers )
68 twolame? ( media-sound/twolame )
69 vorbis? ( media-libs/libvorbis )
70 wavpack? ( media-sound/wavpack )
71 wildmidi? ( media-sound/wildmidi )
72 zeroconf? ( net-dns/avahi[dbus] )
73 zip? ( dev-libs/zziplib )"
78 use network || ewarn
"Icecast and Shoutcast streaming needs networking."
79 use fluidsynth
&& ewarn
"Using fluidsynth is discouraged by upstream."
81 enewuser mpd
"" "" "/var/lib/mpd" audio
84 CONFIG_CHECK
="~INOTIFY_USER"
85 ERROR_INOTIFY_USER
="${P} requires inotify in-kernel support."
92 cp -f doc
/mpdconf.example
doc
/mpdconf.dist || die
"cp failed"
93 epatch
"${FILESDIR}"/${PN}conf.
patch
95 if has_version dev-libs
/libcdio-paranoia
; then
97 -e 's:cdio/paranoia.h:cdio/paranoia/paranoia.h:' \
98 src
/input
/CdioParanoiaInputPlugin.cxx || die
103 local mpdconf
="--disable-despotify --disable-documentation --disable-ffado
104 --disable-mvp --disable-roar --enable-largefile
105 --enable-tcp --enable-un --docdir=${EPREFIX}/usr/share/doc/${PF}"
108 mpdconf
+=" --enable-shout $(use_enable vorbis vorbis-encoder)
109 --enable-httpd-output $(use_enable lame lame-encoder)
110 $(use_enable twolame twolame-encoder)
111 $(use_enable audiofile wave-encoder)"
113 mpdconf
+=" --disable-shout --disable-vorbis-encoder
114 --disable-httpd-output --disable-lame-encoder
115 --disable-twolame-encoder --disable-wave-encoder"
119 append-ldflags
"-L/usr/$(get_libdir)/sidplay/builders"
125 $
(use_enable audiofile
) \
126 $
(use_enable
bzip2) \
127 $
(use_enable cdio cdio-paranoia
) \
128 $
(use_enable cdio iso9660
) \
130 $
(use_enable debug
) \
131 $
(use_enable ffmpeg
) \
134 $
(use_enable fluidsynth
) \
136 $
(use_enable id3tag id3
) \
137 $
(use_enable inotify
) \
140 $
(use_enable lastfmradio lastfm
) \
141 $
(use_enable libsamplerate lsr
) \
143 $
(use_enable mikmod
) \
145 $
(use_enable modplug
) \
146 $
(use_enable mpg123
) \
147 $
(use_enable musepack mpc
) \
148 $
(use_enable openal
) \
150 $
(use_enable pipe pipe-output
) \
151 $
(use_enable pulseaudio pulse
) \
152 $
(use_enable recorder recorder-output
) \
153 $
(use_enable sid sidplay
) \
154 $
(use_enable sndfile sndfile
) \
155 $
(use_enable soundcloud
) \
157 $
(use_enable sqlite
) \
158 $
(use_enable systemd systemd-daemon
) \
159 $
(use_enable tcpd libwrap
) \
160 $
(use_enable vorbis
) \
161 $
(use_enable wavpack
) \
162 $
(use_enable wildmidi
) \
163 $
(use_enable
zip zzip
) \
164 $
(use_with zeroconf zeroconf avahi
) \
165 "$(systemd_with_unitdir)" \
170 emake DESTDIR
="${D}" install
173 newins
doc
/mpdconf.dist mpd.conf
175 newinitd
"${FILESDIR}"/mpd.init mpd
178 sed -i -e 's:^#filesystem_charset.*$:filesystem_charset "UTF-8":' \
179 "${ED}"/etc
/mpd.conf || die
"sed failed"
182 use prefix || diropts
-m0755 -o mpd
-g audio
185 dodir
/var
/lib
/mpd
/music
186 keepdir
/var
/lib
/mpd
/music
187 dodir
/var
/lib
/mpd
/playlists
188 keepdir
/var
/lib
/mpd
/playlists
192 elog
"If you will be starting mpd via /etc/init.d/mpd, please make"
193 elog
"sure that MPD's pid_file is unset."
195 # also change the homedir if the user has existed before
196 usermod
-d "/var/lib/mpd" mpd