summaryrefslogtreecommitdiff
path: root/media-sound/subsonic/subsonic-4.8.ebuild
blob: b50ca5ea3e234b7441e8cc27ad001f854ee47d96 (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
EAPI=5
 
inherit eutils user subversion
 
DESCRIPTION="A free, open source, web-based media server in Java."
HOMEPAGE="http://www.subsonic.org"
ESVN_REPO_URI="svn://svn.code.sf.net/p/subsonic/code/tags/release-${PV}"
ESVN_PROJECT="${PN}"
 
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="no-license"
 
DEPEND=""
RDEPEND="virtual/jre
media-sound/lame
virtual/ffmpeg"
 
INSTALL_BASE="/opt/${PN}"
 
S="${WORKDIR}"
SUBSONIC_HOME="/var/${PN}"
SUBSONIC_USER="subsonic"
 
pkg_preinst() {
ebegin "Creating ${UG} user"
enewuser "${SUBSONIC_USER}" -1 -1 "${SUBSONIC_HOME}" audio
fowners ${SUBSONIC_USER}:audio ${SUBSONIC_HOME}
}
 
src_prepare() {
use no-license && epatch "${FILESDIR}"/no-license.patch
epatch "${FILESDIR}"/no-installers.patch
}
 
src_compile() {
mkdir "${T}"/maven || die "Can't make tempdir"
cat /usr/share/$(readlink /usr/bin/mvn | sed 's:mvn:maven-bin:')/conf/settings.xml | \
sed -e 's:/path/to/local/repo:'"${T}"/maven':g' \
-e 's:<!-- localRepository::' >"${T}"/settings.xml
addpredict / # bad bad bad
mvn -s "${T}"/settings.xml -P full package || die "Maven failed"
}
 
src_install() {
dodoc subsonic-main/README.TXT
dohtml subsonic-main/"Getting Started.html"
 
insinto ${INSTALL_BASE}
doins subsonic-booter/target/subsonic-booter-jar-with-dependencies.jar
doins subsonic-main/target/subsonic.war
 
exeinto ${INSTALL_BASE}
doexe subsonic-booter/src/main/script/subsonic.sh
 
dodir ${SUBSONIC_HOME}
 
newinitd "${FILESDIR}/subsonic.initd" subsonic
newconfd "${FILESDIR}/subsonic.confd" subsonic
 
dosym ${INSTALL_BASE}/subsonic.sh /opt/bin/subsonic
}