mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-248: Fix rpm build for cloud-scripts
Make rpm correctly handle new installs, upgrades and uninstalls. Signed-off-by: Rohit Yadav <rohit.yadav@citrix.com>
This commit is contained in:
parent
5cd7fb8408
commit
c6d92f7f90
15
cloud.spec
15
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user