media-sound/quodlibet: ppc64 stable wrt bug #721406
[gentoo.git] / media-sound / gnump3d / gnump3d-3.0-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PERL_EXPORT_PHASE_FUNCTIONS=no
7 inherit eutils multilib user perl-module
8
9 DESCRIPTION="A streaming server for MP3, OGG vorbis and other streamable files"
10 HOMEPAGE="https://www.gnu.org/software/gnump3d/"
11 SRC_URI="https://savannah.gnu.org/download/${PN}/${P}.tar.bz2"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 ~ppc ppc64 sparc x86"
16 IUSE="sox"
17
18 RDEPEND="sox? ( media-sound/sox )"
19 DEPEND="sys-apps/sed"
20
21 RESTRICT="test"
22
23 pkg_setup() {
24         enewuser gnump3d '' '' '' nogroup
25         LIBDIR=/usr/$(get_libdir)
26 }
27
28 src_compile() { :; }
29
30 src_install() {
31         perl_set_version
32
33         insinto "${VENDOR_LIB}"/gnump3d
34         doins lib/gnump3d/*.pm
35         insinto "${VENDOR_LIB}"/gnump3d/plugins
36         doins lib/gnump3d/plugins/*.pm
37         insinto "${VENDOR_LIB}"/gnump3d/lang
38         doins lib/gnump3d/lang/*.pm
39
40         dobin bin/gnump3d2 bin/gnump3d-top bin/gnump3d-index
41         dosym /usr/bin/gnump3d2 /usr/bin/gnump3d
42         doman man/*.1
43
44         insinto /usr/share/gnump3d
45         doins -r templates/*
46
47         insinto /etc/gnump3d
48         doins etc/gnump3d.conf etc/mime.types etc/file.types
49         sed -e "s,PLUGINDIR,${VENDOR_LIB},g" -i "${ED}/etc/gnump3d/gnump3d.conf" || die
50         sed -e 's,^user *= *\(.*\)$,user = gnump3d,g' -i "${ED}/etc/gnump3d/gnump3d.conf" || die
51
52         dodoc AUTHORS ChangeLog DOWNSAMPLING PLUGINS README SUPPORT TODO
53
54         newinitd "${FILESDIR}"/${PN}.init.d gnump3d
55         newconfd "${FILESDIR}"/${PN}.conf.d gnump3d
56
57         keepdir /var/log/gnump3d
58         keepdir /var/cache/gnump3d/serving
59
60         fowners gnump3d:nogroup /var/log/gnump3d /var/cache/gnump3d
61 }
62
63 pkg_postinst() {
64         elog "Please edit your /etc/gnump3d/gnump3d.conf before running"
65         elog "/etc/init.d/gnump3d start"
66         elog ""
67         elog "At the very least, you will need to change the root directory"
68         elog "where music is found.  By default, gnump3d will also listen"
69         elog "to any address on port 8888"
70         elog ""
71         elog "You can optionally use sox to downmix the quality of streamed"
72         elog "music in realtime for slow connections."
73 }