summaryrefslogtreecommitdiff
path: root/media-sound
diff options
context:
space:
mode:
Diffstat (limited to 'media-sound')
-rw-r--r--media-sound/subsonic/subsonic-5.0.ebuild63
1 files changed, 63 insertions, 0 deletions
diff --git a/media-sound/subsonic/subsonic-5.0.ebuild b/media-sound/subsonic/subsonic-5.0.ebuild
new file mode 100644
index 0000000..c90871b
--- /dev/null
+++ b/media-sound/subsonic/subsonic-5.0.ebuild
@@ -0,0 +1,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="http://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
+}