add media-sound/forked-daapd
[portage-squeep] / media-sound / forked-daapd / forked-daapd-26.2.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # TODO:
5 # Add --enable-spotify when it works
6
7 EAPI=5
8
9 inherit autotools eutils user
10
11 DESCRIPTION="A DAAP (iTunes) media server"
12 HOMEPAGE="https://github.com/ejurgensen/forked-daapd"
13 SRC_URI="https://github.com/ejurgensen/forked-daapd/archive/${PV}.tar.gz -> ${P}.tar.gz"
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64"
17 IUSE="alsa flac itunes lastfm mpd musepack"
18
19 # Note: mpd support appears to be standalone, e.g. --enable-mpd doesn't
20 # result in additional linkage.
21 RDEPEND="
22 dev-db/sqlite:3
23 dev-libs/antlr-c:0
24 dev-libs/confuse
25 dev-libs/libevent
26 dev-libs/libgcrypt:0
27 dev-libs/libunistring
28 dev-libs/mini-xml[threads]
29 net-dns/avahi[dbus]
30 virtual/ffmpeg
31
32 alsa? ( media-libs/alsa-lib )
33 flac? ( media-libs/flac )
34 itunes? ( app-pda/libplist )
35 lastfm? ( net-misc/curl )
36 musepack? ( media-libs/taglib )
37 "
38
39 DEPEND="
40 dev-java/antlr:3.5
41 ${RDEPEND}
42 "
43
44 pkg_setup() {
45 enewuser daapd
46 enewgroup daapd
47 }
48
49 src_prepare() {
50 # https://github.com/ejurgensen/forked-daapd/pull/185
51 #epatch "${FILESDIR}/antlr-3.5.patch"
52
53 eautoreconf
54 }
55
56 src_configure() {
57 ac_cv_prog_ANTLR=antlr3.5 \
58 econf \
59 $(use_enable alsa) \
60 $(use_enable flac) \
61 $(use_enable musepack) \
62 $(use_enable itunes) \
63 $(use_enable lastfm) \
64 $(use_enable mpd)
65 }
66
67 src_install() {
68 emake DESTDIR="${D}" install
69
70 newinitd "${FILESDIR}/daapd.initd" daapd
71 newconfd "${FILESDIR}/daapd.confd" daapd
72
73 # dodir by itself fails in the likely case of /srv/music having a
74 # volume mounted already.
75 test -d /srv/music || dodir /srv/music
76
77 fowners -R daapd:daapd /var/lib/cache/forked-daapd
78 }