rpm build has identity crisis
sciurius opened this issue · 5 comments
In the rpm build, there's a mixup of super/sub sonic program and script names. As a result, installing the rpm leads to a non-functional system.
Patch (git am) attached.
From 5595525758cf87d6997e27104c47a17afd712a2f Mon Sep 17 00:00:00 2001
From: Johan Vromans jvromans@squirrel.nl
Date: Tue, 29 May 2012 11:45:31 +0200
Subject: [PATCH] Fix RPM building.
subsonic-installer-rpm/src/etc/init.d/supersonic | 2 +-
subsonic-installer-rpm/src/supersonic.spec | 27 +++++++++++++--------
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/subsonic-installer-rpm/src/etc/init.d/supersonic b/subsonic-installer-rpm/src/etc/init.d/supersonic
index a0c152e..c996b3d 100644
--- a/subsonic-installer-rpm/src/etc/init.d/supersonic
+++ b/subsonic-installer-rpm/src/etc/init.d/supersonic
@@ -58,7 +58,7 @@ do_start()
[ -e /tmp/supersonic ] && chown -R $SUPERSONIC_USER /tmp/supersonic
echo $"Starting $NAME ..."
- su -c "$DAEMON $DAEMON_ARGS" $SUPERSONIC_USER
- su -c "$DAEMON $DAEMON_ARGS start" $SUPERSONIC_USER
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCKFILE
diff --git a/subsonic-installer-rpm/src/supersonic.spec b/subsonic-installer-rpm/src/supersonic.spec
index 5c06a3f..5b3069f 100644
--- a/subsonic-installer-rpm/src/supersonic.spec
+++ b/subsonic-installer-rpm/src/supersonic.spec
@@ -6,6 +6,7 @@ Summary: A web-based music streamer, jukebox and Podcast receiver
Group: Applications/Multimedia
License: GPLv3
URL: http://subsonic.org
+Obsoletes: subsonic
%description
Supersonic is a web-based music streamer, jukebox and Podcast receiver,
@@ -17,7 +18,9 @@ Apps for Android, iPhone and Windows Phone are also available.
Java 1.6 or higher is required to run Subsonic.
+Supersonic is a free clone of Subsonic.
Subsonic can be found at http://subsonic.org
+Supersonic can be found at https://github.com/Mach5/supersonic
%files
%defattr(644,root,root,755)
@@ -31,6 +34,10 @@ Subsonic can be found at http://subsonic.org
%pre
Stop Subsonic service.
+if [ -e /etc/init.d/subsonic ]; then
- service subsonic stop
+fi
+# Stop Supersonic service.
if [ -e /etc/init.d/supersonic ]; then
service supersonic stop
fi
@@ -38,18 +45,18 @@ fi
exit 0
%post
-ln -sf /usr/share/subsonic/subsonic.sh /usr/bin/subsonic
-chmod 750 /var/subsonic
+ln -sf /usr/share/supersonic/supersonic.sh /usr/bin/supersonic
+chmod 750 /var/supersonic
Clear jetty cache.
-rm -rf /var/subsonic/jetty
+rm -rf /var/supersonic/jetty
For SELinux: Set security context
-chcon -t java_exec_t /etc/init.d/subsonic 2>/dev/null
+chcon -t java_exec_t /etc/init.d/supersonic 2>/dev/null
-# Configure and start Subsonic service.
-chkconfig --add subsonic
-service subsonic start
+# Configure and start Supersonic service.
+chkconfig --add supersonic
+service supersonic start
exit 0
@@ -58,13 +65,13 @@ exit 0
if [ $1 = 0 ] ; then
Stop the service.
- [ -e /etc/init.d/subsonic ] && service subsonic stop
- [ -e /etc/init.d/supersonic ] && service supersonic stop
Remove symlink.
- rm -f /usr/bin/subsonic
- rm -f /usr/bin/supersonic
Remove startup scripts.
- chkconfig --del subsonic
- chkconfig --del supersonic
fi
1.7.4.4
sciurius, I'm having a hard time applying your patch, possibly due to the markdown GitHub is doing.
Would you mind creating a pull request that includes your patch?
Thanks!
I must shamefully admit that I haven't used github this way yet...
I've uploaded the (small) patch to
http://www.squirrel.nl/pub/xfer/uploads/3CPfSsIoTIm7uH2kM439z3gw.patch
Slightly related: here's a supersonic.service control file for systemd.
http://www.squirrel.nl/pub/xfer/uploads/3C5geFG_U2V5qUyjPyVlzYKQ.service
sciurius, thanks for the patches. I'll review them as soon as time permits.
You may want to take a look at Github's documentation regarding Pull Requests. It's not that hard but provides tons of benefits like neatly formatted diffs. Also, it allows project collaborators to merge in code directly via the web frontend, thereby speeding up code integration.
@sciurius: The patch is now in master. I wasn't sure where to place the supersonic.service file though so I simply put it into subsonic-installer-rpm/src. Please let me know if there's a more appropriate location (and possibly name) for it. (I'm afraid I have close to no expertise regarding RPM packaging.)