scmpc: Sync with gentoo-x86
[mpd.git] / media-sound / mpd / mpd-9999.ebuild
bloba5bcb5a41bad8f4a1f2067fd804828fc9e049169
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 $
5 EAPI=4
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"
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS=""
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
33 dev-libs/glib:2
34 aac? ( media-libs/faad2 )
35 alsa? ( media-sound/alsa-utils
36 media-libs/alsa-lib )
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 )"
74 DEPEND="${RDEPEND}
75 virtual/pkgconfig"
77 pkg_setup() {
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
83 if use inotify; then
84 CONFIG_CHECK="~INOTIFY_USER"
85 ERROR_INOTIFY_USER="${P} requires inotify in-kernel support."
86 linux-info_pkg_setup
90 src_prepare() {
91 eautoreconf
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
96 sed -i \
97 -e 's:cdio/paranoia.h:cdio/paranoia/paranoia.h:' \
98 src/input/CdioParanoiaInputPlugin.cxx || die
102 src_configure() {
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}"
107 if use network; then
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)"
112 else
113 mpdconf+=" --disable-shout --disable-vorbis-encoder
114 --disable-httpd-output --disable-lame-encoder
115 --disable-twolame-encoder --disable-wave-encoder"
118 append-lfs-flags
119 append-ldflags "-L/usr/$(get_libdir)/sidplay/builders"
121 econf \
122 $(use_enable aac) \
123 $(use_enable alsa) \
124 $(use_enable ao) \
125 $(use_enable audiofile) \
126 $(use_enable bzip2) \
127 $(use_enable cdio cdio-paranoia) \
128 $(use_enable cdio iso9660) \
129 $(use_enable curl) \
130 $(use_enable debug) \
131 $(use_enable ffmpeg) \
132 $(use_enable fifo) \
133 $(use_enable flac) \
134 $(use_enable fluidsynth) \
135 $(use_enable gme) \
136 $(use_enable id3tag id3) \
137 $(use_enable inotify) \
138 $(use_enable ipv6) \
139 $(use_enable jack) \
140 $(use_enable lastfmradio lastfm) \
141 $(use_enable libsamplerate lsr) \
142 $(use_enable mad) \
143 $(use_enable mikmod) \
144 $(use_enable mms) \
145 $(use_enable modplug) \
146 $(use_enable mpg123) \
147 $(use_enable musepack mpc) \
148 $(use_enable openal) \
149 $(use_enable oss) \
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) \
156 $(use_enable soup) \
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)" \
166 ${mpdconf}
169 src_install() {
170 emake DESTDIR="${D}" install
172 insinto /etc
173 newins doc/mpdconf.dist mpd.conf
175 newinitd "${FILESDIR}"/mpd.init mpd
177 if use unicode; then
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
183 dodir /var/lib/mpd
184 keepdir /var/lib/mpd
185 dodir /var/lib/mpd/music
186 keepdir /var/lib/mpd/music
187 dodir /var/lib/mpd/playlists
188 keepdir /var/lib/mpd/playlists
191 pkg_postinst() {
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