summaryrefslogtreecommitdiff
blob: f1927991ba79987884bab20df6e7d360120fd97c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=2
inherit eutils user

DESCRIPTION="SHOUTcast is a streaming audio system"
HOMEPAGE="http://www.shoutcast.com/license"
SRC_URI="sc_serv_${PV}_Linux.tar.gz"

LICENSE="shoutcast"
SLOT="0"
KEYWORDS="-* amd64 x86"
IUSE=""

RDEPEND=""
DEPEND=""

QA_PRESTRIPPED=/opt/bin/sc_serv

RESTRICT="fetch"

S=${WORKDIR}

pkg_nofetch() {
	elog "Download ${A} from ${HOMEPAGE} and copy it to ${DISTDIR}."
}

pkg_setup() {
	enewuser shoutcast -1 -1 -1 nogroup
}

src_prepare() {
	epatch "${FILESDIR}"/${PV}-sc_serv.conf.patch
}

src_install() {
	into /opt
	dobin sc_serv || die "dobin failed"

	newinitd "${FILESDIR}"/shoutcast.2 shoutcast || die "newinitd failed"
	dodir /opt/shoutcast/content

	insinto /etc/shoutcast
	doins sc_serv.conf || die "doins failed"

	dodoc README.TXT

	fowners -R shoutcast:nogroup /{etc,opt}/shoutcast || die "chown failed"
	fperms -R 700 /{etc,opt}/shoutcast || die "chmod failed"
}

pkg_postinst() {
	elog
	elog "To start shoutcast, use the init.d script by running"
	elog "/etc/init.d/shoutcast."
	elog
	elog "On demand content should be stored in /opt/shoutcast/content"
	elog "See http://forums.winamp.com/showthread.php?threadid=75736 for"
	elog "more information on setting up on demand content"
	elog
	elog "FAQ's can be found at:"
	elog "http://forums.winamp.com/showthread.php?threadid=75736 "
	elog "and can help you with server setup."
	elog
	elog "An Gentoo Linux shoutcast guide can be found at "
	elog "https://www.gentoo.org/doc/en/shoutcast-config.xml"
	elog
}