add media-sound/forked-daapd-27.2
[portage-squeep] / media-sound / forked-daapd / forked-daapd-27.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.xz -> ${P}.tar.xz"
14 SRC_URI="https://github.com/ejurgensen/forked-daapd/releases/download/${PV}/${P}.tar.xz"
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64"
18 IUSE="alsa flac itunes lastfm mpd musepack"
19
20 # Note: mpd support appears to be standalone, e.g. --enable-mpd doesn't
21 # result in additional linkage.
22 RDEPEND="
23 dev-db/sqlite:3
24 dev-libs/antlr-c:0
25 dev-libs/confuse
26 dev-libs/libevent
27 dev-libs/libgcrypt:0
28 dev-libs/libunistring
29 dev-libs/libsodium
30 net-libs/libwebsockets:0/15
31 dev-libs/mxml[threads]
32 net-dns/avahi[dbus]
33 virtual/ffmpeg
34 dev-libs/json-c
35
36 alsa? ( media-libs/alsa-lib )
37 flac? ( media-libs/flac )
38 itunes? ( app-pda/libplist )
39 lastfm? ( net-misc/curl )
40 musepack? ( media-libs/taglib )
41 "
42
43 DEPEND="
44 dev-java/antlr:3
45 ${RDEPEND}
46 "
47
48 pkg_setup() {
49 enewuser daapd
50 enewgroup daapd
51 }
52
53 src_prepare() {
54 # https://github.com/ejurgensen/forked-daapd/pull/185
55 #epatch "${FILESDIR}/antlr-3.5.patch"
56
57 eautoreconf
58 }
59
60 src_configure() {
61 ac_cv_prog_ANTLR=antlr3.5 \
62 econf \
63 $(use_enable alsa) \
64 $(use_enable flac) \
65 $(use_enable musepack) \
66 $(use_enable itunes) \
67 $(use_enable lastfm) \
68 $(use_enable mpd)
69 }
70
71 src_install() {
72 emake DESTDIR="${D}" install
73
74 newinitd "${FILESDIR}/daapd.initd" daapd
75 newconfd "${FILESDIR}/daapd.confd" daapd
76
77 # dodir by itself fails in the likely case of /srv/music having a
78 # volume mounted already.
79 test -d /srv/music || dodir /srv/music
80
81 fowners -R daapd:daapd /var/lib/cache/forked-daapd
82 }