From 918db6301711e2ef9bb2d085b682ec552b1abf8b Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Tue, 1 Oct 2013 14:14:31 +0000 Subject: subsonic ebuild --- media-sound/subsonic/Manifest | 5 ++ media-sound/subsonic/files/no-installers.patch | 22 +++++++++ media-sound/subsonic/files/no-license.patch | 44 ++++++++++++++++++ media-sound/subsonic/files/subsonic.confd | 23 ++++++++++ media-sound/subsonic/files/subsonic.initd | 33 ++++++++++++++ media-sound/subsonic/subsonic-4.8.ebuild | 63 ++++++++++++++++++++++++++ 6 files changed, 190 insertions(+) create mode 100644 media-sound/subsonic/Manifest create mode 100644 media-sound/subsonic/files/no-installers.patch create mode 100644 media-sound/subsonic/files/no-license.patch create mode 100644 media-sound/subsonic/files/subsonic.confd create mode 100644 media-sound/subsonic/files/subsonic.initd create mode 100644 media-sound/subsonic/subsonic-4.8.ebuild (limited to 'media-sound') diff --git a/media-sound/subsonic/Manifest b/media-sound/subsonic/Manifest new file mode 100644 index 0000000..b324ee4 --- /dev/null +++ b/media-sound/subsonic/Manifest @@ -0,0 +1,5 @@ +AUX no-installers.patch 751 SHA256 a5adfdcf9ce0985bac9e3a45fc9c991fc98f725fdf2f65fbdf8be0d327d4fe44 SHA512 7e25267c5c0f8db18cbc98cf9440dfac49354136c05d632c9c17dce0c0a13d852cfe45e9649968d03f01153f04ec7e7d5f9ea5c199ba048e4f721b151be81b8d WHIRLPOOL 897e8bfb84c3e46c130d86526f4caf23e4fd6c869d041feb6bbd848ac2954fb509790502d076f04b2b674593f3ba5c90453d837a354fd9b79c4baed5c98ab26d +AUX no-license.patch 1966 SHA256 9484706e6a7c9ab6641b8780c7f6dcd9e0980f630dd41693f82c776ee4b65016 SHA512 993b6646f5eca4ca7b579c7979eadb462bdf7b11e1330b1916ef5a8474335ccead64a14a8bbe43a627755aa9cec028dfb1192039907e71ced9aa80ed46730aaf WHIRLPOOL 618dcdaa3d630c436f2c4f45021506c148e75f3f2bade49d54182d14098bbcd79ad7db81cf403af5b7d9cdbbbe4388805c9ab894fabd2de8c4e8f39bd3ab1675 +AUX subsonic.confd 574 SHA256 4b783e2acd0d672bc9d60a594d4b41876dbb0b1c9b01cf9d50d4504d5d685975 SHA512 d018d359389d0e17a7d3efd71aa0e4b0aa8cdda6b6fd65856bec76f4a534270df5c27e7942e08b76353736d85fa2374c0b5f011b39817d2454b3871ad1ec990d WHIRLPOOL 33a7edb37fa2c22d0d6aa21637cd5ba86686a880c5e5caeb7d491b22a26f72336a8f5b56081a292a5554c0ad3311d8067e437b3bd9ee053d5b64a8a58ceea919 +AUX subsonic.initd 871 SHA256 3db5fe1b5349912bc6b5fb18311ccec894daa0dc409b912d497f9d7c4f68c4d5 SHA512 f8f66c0af9bd2e617be1305b7b967b1ee0f7e00a239200ac9f8898dfb435a9aee451a39861eee0119b0c0732583851da1172b483aadb9d67b9213006c334e95a WHIRLPOOL dfa614df267d5fd01e677d2b29602bb86c7090a9a61d56d1c8e3c602978e245a07b6ad622683eb247e9b044b6e4e3c0cf7a1117046782866237f004ba2603516 +EBUILD subsonic-4.8.ebuild 1584 SHA256 7dce6fb3941771639274ab4741e0d02c3d518df8e68b90983b91cf7783a88d6d SHA512 b3adb29cb9f2d997e7db7d474d386c2e3f40b766dfbb663a89e9d7083b18dad09b2848736cf9da101e412e4be41c1d6a261571a846a4992aca2d58ee9c8e0726 WHIRLPOOL 4ec26a176429bd8569faea193cad7fc0c08d5425f3693953dfbc6df61796757638181a4771ea765840ab3a9bfe38f3efaafad9491d26f3b131710ee4bfef0f26 diff --git a/media-sound/subsonic/files/no-installers.patch b/media-sound/subsonic/files/no-installers.patch new file mode 100644 index 0000000..23deda2 --- /dev/null +++ b/media-sound/subsonic/files/no-installers.patch @@ -0,0 +1,22 @@ +Index: pom.xml +=================================================================== +--- pom.xml (revision 3501) ++++ pom.xml (working copy) +@@ -82,10 +82,6 @@ + full + + subsonic-booter +- subsonic-installer-windows +- subsonic-installer-mac +- subsonic-installer-debian +- subsonic-installer-rpm + subsonic-backend + subsonic-site + subsonic-assembly +@@ -159,4 +155,4 @@ + + + +- +\ No newline at end of file ++ diff --git a/media-sound/subsonic/files/no-license.patch b/media-sound/subsonic/files/no-license.patch new file mode 100644 index 0000000..a198a2a --- /dev/null +++ b/media-sound/subsonic/files/no-license.patch @@ -0,0 +1,44 @@ +Index: subsonic-main/src/main/java/net/sourceforge/subsonic/service/SettingsService.java +=================================================================== +--- subsonic-main/src/main/java/net/sourceforge/subsonic/service/SettingsService.java (revision 3501) ++++ subsonic-main/src/main/java/net/sourceforge/subsonic/service/SettingsService.java (working copy) +@@ -648,7 +648,7 @@ + if (email == null || license == null) { + return false; + } +- return license.equalsIgnoreCase(StringUtil.md5Hex(email.toLowerCase())); ++ return true; + } + + public LicenseInfo getLicenseInfo() { +@@ -1250,29 +1250,7 @@ + } + + licenseValidated = true; +- +- HttpClient client = new DefaultHttpClient(); +- HttpConnectionParams.setConnectionTimeout(client.getParams(), 120000); +- HttpConnectionParams.setSoTimeout(client.getParams(), 120000); +- HttpGet method = new HttpGet("http://subsonic.org/backend/validateLicense.view" + "?email=" + StringUtil.urlEncode(email) + +- "&date=" + date.getTime() + "&version=" + versionService.getLocalVersion()); +- try { +- ResponseHandler responseHandler = new BasicResponseHandler(); +- String content = client.execute(method, responseHandler); +- licenseValidated = content != null && content.contains("true"); +- if (!licenseValidated) { +- LOG.warn("License key is not valid."); +- } +- String[] lines = StringUtils.split(content); +- if (lines.length > 1) { +- licenseExpires = new Date(Long.parseLong(lines[1])); +- } +- +- } catch (Throwable x) { +- LOG.warn("Failed to validate license.", x); +- } finally { +- client.getConnectionManager().shutdown(); +- } ++ return; + } + + public synchronized void scheduleLicenseValidation() { diff --git a/media-sound/subsonic/files/subsonic.confd b/media-sound/subsonic/files/subsonic.confd new file mode 100644 index 0000000..abb5f6d --- /dev/null +++ b/media-sound/subsonic/files/subsonic.confd @@ -0,0 +1,23 @@ +SUBSONIC_HOST=0.0.0.0 +SUBSONIC_PORT=4040 +SUBSONIC_HTTPS_PORT=0 +SUBSONIC_CONTEXT_PATH=/ +SUBSONIC_MAX_MEMORY=100 +SUBSONIC_DEFAULT_MUSIC_FOLDER=/var/music +SUBSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast +SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists + +NICELEVEL=0 + +# Defaults - Don't change these + +SUBSONIC_HOME=/var/subsonic + +# The user under which the server runs +SUBSONIC_USER=subsonic + +# Make sure that the PID file folder is writeable for the subsonic user +PIDFILE=${SUBSONIC_HOME}/subsonic.pid + +# Further subsonic start script options, if ever needed +SUBSONIC_OPTS="" diff --git a/media-sound/subsonic/files/subsonic.initd b/media-sound/subsonic/files/subsonic.initd new file mode 100644 index 0000000..e163411 --- /dev/null +++ b/media-sound/subsonic/files/subsonic.initd @@ -0,0 +1,33 @@ +#!/sbin/runscript +# Distributed under the terms of the GNU General Public License, v2 or later + +depend() { + need net +} + +start() { + start-stop-daemon \ + --start --user "${SUBSONIC_USER}" --name subsonic \ + --env HOME="${SUBSONIC_HOME}" --exec /opt/subsonic/subsonic.sh \ + --nicelevel "${NICELEVEL}" \ + -- --pidfile=${PIDFILE} \ + --home=${SUBSONIC_HOME} \ + --host=${SUBSONIC_HOST} \ + --port=${SUBSONIC_PORT} \ + --https-port=${SUBSONIC_HTTPS_PORT} \ + --context-path=${SUBSONIC_CONTEXT_PATH} \ + --max-memory=${SUBSONIC_MAX_MEMORY} \ + --default-music-folder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \ + --default-podcast-folder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \ + --default-playlist-folder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \ + ${SUBSONIC_OPTS} + eend $? +} + +stop() { + start-stop-daemon --stop --user "${SUBSONIC_USER}" \ + --pidfile ${PIDFILE} \ + --wait 30000 \ + --progress + eend $? +} \ No newline at end of file diff --git a/media-sound/subsonic/subsonic-4.8.ebuild b/media-sound/subsonic/subsonic-4.8.ebuild new file mode 100644 index 0000000..b50ca5e --- /dev/null +++ b/media-sound/subsonic/subsonic-4.8.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="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: