You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by hu...@apache.org on 2012/10/06 00:32:45 UTC
[10/49] git commit: CLOUDSTACK-248: Fix rpm build for cloud-scripts
CLOUDSTACK-248: Fix rpm build for cloud-scripts
Make rpm correctly handle new installs, upgrades and uninstalls.
Signed-off-by: Rohit Yadav <ro...@citrix.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/9d98e10d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/9d98e10d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/9d98e10d
Branch: refs/heads/maven-to-rpm
Commit: 9d98e10dea2d845684640f6a87710567b466b7dd
Parents: 9259316
Author: Rohit Yadav <ro...@citrix.com>
Authored: Thu Oct 4 13:28:05 2012 +0530
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Sat Oct 6 00:30:31 2012 +0200
----------------------------------------------------------------------
cloud.spec | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/9d98e10d/cloud.spec
----------------------------------------------------------------------
diff --git a/cloud.spec b/cloud.spec
index fe2e757..3c6bf0e 100644
--- a/cloud.spec
+++ b/cloud.spec
@@ -95,6 +95,7 @@ Requires: nfs-utils
Requires: wget
# there is a fsimage.so in the source code, which adds xen-libs as a dependence, needs to supress it, as rhel doesn't have this pacakge
AutoReqProv: no
+Provides: cloud-agent-scripts = %{version}-%{release}
Obsoletes: cloud-agent-scripts < %{version}-%{release}
Group: System Environment/Libraries
%description scripts
@@ -392,11 +393,19 @@ if [ -x /etc/sysconfig/modules/kvm.modules ] ; then
fi
%post scripts
-rm -fr %{_libdir}/%{name}/agent
-ln -f -s %{_libdir}/%{name}/common %{_libdir}/%{name}/agent
+if [ -d %{_libdir}/%{name}/agent ]; then
+ rm -fr %{_libdir}/%{name}/agent
+fi
+# Symlink for backwards compatibility
+if [ ! -h %{_libdir}/%{name}/agent ]; then
+ ln -s %{_libdir}/%{name}/common %{_libdir}/%{name}/agent
+fi
%postun scripts
-rm -fr %{_libdir}/%{name}/agent
+# For uninstallation, remove symlink
+if [ "$1" == "0" ]; then
+ rm -f %{_libdir}/%{name}/agent
+fi
%post client
if [ "$1" == "1" ] ; then