[open-vm-tools/el5] First build.
Simone Caronni
slaanesh at fedoraproject.org
Wed Apr 24 13:44:07 UTC 2013
commit 9bbb621d7dc6c96aba00d704d3ac1d56784db891
Author: Simone Caronni <negativo17 at gmail.com>
Date: Wed Apr 24 15:42:17 2013 +0200
First build.
open-vm-tools.init | 94 ++++++++++++++++++++++++++++++++
open-vm-tools.spec | 150 ++++++++++++++++++++++++++++++----------------------
2 files changed, 181 insertions(+), 63 deletions(-)
---
diff --git a/open-vm-tools.init b/open-vm-tools.init
new file mode 100644
index 0000000..dd1f398
--- /dev/null
+++ b/open-vm-tools.init
@@ -0,0 +1,94 @@
+#!/bin/sh
+#
+# vmtoolsd - Open VMware Tools Daemon
+#
+# chkconfig: - 80 20
+# description: Open VMware Tools daemon for virtual machines hosted on VMware.
+
+### BEGIN INIT INFO
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Open VMware Tools daemon for virtual machines hosted on VMware.
+# Description: Open VMware Tools daemon is part of open-vm-tools project,
+# an open source implementation of VMware Tools. It loads
+# various open-vm-tools plugins and makes their services
+# available to the guest OS for improved usability and to
+# the VM management applications for easier administration.
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+exec="/usr/bin/vmtoolsd"
+prog=${exec##*/}
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+ [ -x $exec ] || exit 5
+ echo -n $"Starting $prog: "
+ daemon $exec --background=/var/run/$prog.pid
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc $prog
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f $lockfile
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+rh_status() {
+ # run checks to determine if the service is running or use generic status
+ status $prog
+}
+
+rh_status_q() {
+ rh_status >/dev/null 2>&1
+}
+
+case "$1" in
+ start)
+ rh_status_q && exit 0
+ $1
+ ;;
+ stop)
+ rh_status_q || exit 0
+ $1
+ ;;
+ restart)
+ $1
+ ;;
+ force-reload)
+ restart
+ ;;
+ status)
+ rh_status
+ ;;
+ try-restart|condrestart)
+ rh_status_q || exit 0
+ restart
+ ;;
+ reload)
+ action $"Service ${0##*/} does not support the reload action: " /bin/false
+ exit 3
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
+ exit 2
+esac
+exit $?
diff --git a/open-vm-tools.spec b/open-vm-tools.spec
index 6ff2568..807e6d5 100644
--- a/open-vm-tools.spec
+++ b/open-vm-tools.spec
@@ -6,7 +6,7 @@
Name: open-vm-tools
Version: %{toolsversion}
-Release: 11%{?dist}
+Release: 1%{?dist}
Summary: Open VMware Tools for virtual machines hosted on VMware
Group: Applications/System
License: GPLv2
@@ -14,6 +14,7 @@ URL: http://%{name}.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: http://sourceforge.net/projects/%{name}/files/%{name}/stable-%{majorversion}.x/%{name}-%{version}-%{toolsbuild}.tar.gz
Source1: %{name}.service
+Source2: %{name}.init
BuildRequires: doxygen
# Fuse is optional and enables vmblock-fuse
@@ -32,11 +33,29 @@ BuildRequires: libXrender-devel
BuildRequires: libXtst-devel
BuildRequires: pam-devel
BuildRequires: procps-devel
+
+%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: systemd-units
+%endif
+
+%if 0%{?fedora} == 16 || 0%{?fedora} == 17
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%endif
+%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
+%endif
+
+%if 0%{?rhel} == 5 || 0%{?rhel} == 6
+Requires(post): /sbin/chkconfig
+Requires(preun): /sbin/chkconfig
+Requires(preun): /sbin/service
+Requires(postun): /sbin/service
+%endif
%description
The %{name} project is an open source implementation of VMware Tools. It
@@ -99,27 +118,84 @@ find %{buildroot}%{_libdir} -name '*.la' -delete
rm -fr %{buildroot}%{_defaultdocdir}
rm -f docs/api/build/html/FreeSans.ttf
+%if 0%{?fedora} || 0%{?rhel} >= 7
+
# Systemd unit files
install -p -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{toolsdaemon}.service
+%else
+
+# Initscripts
+install -p -m 755 -D %{SOURCE2} %{buildroot}%{_initrddir}/%{toolsdaemon}
+
+%endif
+
# 'make check' in open-vm-tools rebuilds docs and ends up regenerating
# the font file. We can add %%check secion once 'make check' is fixed
# upstream
+%if 0%{?fedora} == 17
+
%post
-/usr/sbin/ldconfig
+/sbin/ldconfig
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%preun
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable %{toolsdaemon}.service > /dev/null 2>&1 || :
+ /bin/systemctl stop %{toolsdaemon}.service > /dev/null 2>&1 || :
+fi
+
+%postun
+/sbin/ldconfig
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart %{toolsdaemon}.service >/dev/null 2>&1 || :
+fi
+
+%endif
+
+%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
+
+%post
+/sbin/ldconfig
%systemd_post %{toolsdaemon}.service
%preun
%systemd_preun %{toolsdaemon}.service
%postun
-/usr/sbin/ldconfig
+/sbin/ldconfig
%systemd_postun_with_restart %{toolsdaemon}.service
-%post devel -p /usr/sbin/ldconfig
+%endif
+
+%if 0%{?rhel} == 6 || 0%{?rhel} == 5
+
+%post
+/sbin/chkconfig --add %{toolsdaemon}
+
+%preun
+if [ $1 -eq 0 ]; then
+ /sbin/service %{toolsdaemon} stop >/dev/null 2>&1 || :
+ /sbin/chkconfig --del %{toolsdaemon}
+fi
+
+%postun
+if [ $1 -ge 1 ]; then
+ /sbin/service %{toolsdaemon} condrestart >/dev/null 2>&1 || :
+fi
+
+%endif
+
+%post devel -p /sbin/ldconfig
-%postun devel -p /usr/sbin/ldconfig
+%postun devel -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
@@ -144,7 +220,11 @@ install -p -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{toolsdaemon}.service
%{_sbindir}/mount.vmhgfs
%{_datadir}/%{name}/
%exclude /sbin/
+%if 0%{?fedora} || 0%{?rhel} >= 7
%{_unitdir}/%{toolsdaemon}.service
+%else
+%{_initrddir}/%{toolsdaemon}
+%endif
%files desktop
%defattr(-,root,root,-)
@@ -163,61 +243,5 @@ install -p -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{toolsdaemon}.service
%{_libdir}/libvmtools.so
%changelog
-* Mon Apr 22 2013 Ravindra Kumar <ravindrakumar at vmware.com> - 9.2.2-11
-- Removed the conditional steps for old versions of Fedora and RHEL.
-
-* Thu Apr 18 2013 Ravindra Kumar <ravindrakumar at vmware.com> - 9.2.2-10
-- Addressed formal review comments from Simone Caronni.
-- Removed %%check section because 'make check' brings font file back.
-
-* Wed Apr 17 2013 Simone Caronni <negativo17 at gmail.com> - 9.2.2-9
-- Removed rm command in %%check section.
-- Remove blank character at the beginning of each changelog line.
-
-* Mon Apr 15 2013 Ravindra Kumar <ravindrakumar at vmware.com> - 9.2.2-8
-- Removed FreeSans.ttf font file from packaging.
-- Added 'rm' command to remove font file in %%check section because
- 'make check' adds it back.
-- Added doxygen dependency back.
-
-* Thu Apr 11 2013 Ravindra Kumar <ravindrakumar at vmware.com> - 9.2.2-7
-- Applied patch from Simone for removal of --docdir option from configure.
-- Removed unnecessary --enable-docs option from configure.
-- Removed doxygen dependency.
-
-* Thu Apr 11 2013 Ravindra Kumar <ravindrakumar at vmware.com> - 9.2.2-6
-- Replaced vmtoolsd with a variable.
-- Changed summary for subpackages to be more specific.
-- Removed drivers.txt file as we don't really need it.
-- Fixed vmGuestLib ownership for devel package.
-- Removed systemd-sysv from Requires for Fedora 18+ and RHEL 7+.
-- Made all "if" conditions consistent.
-
-* Wed Apr 10 2013 Simone Caronni <negativo17 at gmail.com> - 9.2.2-5
-- Added RHEL 5/6 init script.
-- Renamed SysV init script / systemd service file to vmtoolsd.
-- Fixed ownership of files from review.
-- Moved api documentation in devel subpackage.
-- Removed static libraries.
-
-* Tue Apr 09 2013 Ravindra Kumar <ravindrakumar at vmware.com> - 9.2.2-4
-- Applied part of review fixes patch from Simone Caronni for systemd setup.
-- Replaced tabs with spaces all over.
-
-* Tue Apr 09 2013 Ravindra Kumar <ravindrakumar at vmware.com> - 9.2.2-3
-- Applied review fixes patch from Simone Caronni.
-- Added missing *.a and *.so files for devel package.
-- Removed unnecessary *.la plugin files from base package.
-
-* Mon Apr 08 2013 Ravindra Kumar <ravindrakumar at vmware.com> - 9.2.2-2
-- Modified SPEC to follow the conventions and guidelines.
-- Addressed review comments from Mohamed El Morabity.
-- Added systemd script.
-- Verified and built the RPMS for Fedora 18.
-- Fixed rpmlint warnings.
-- Split the UX components in a separate package for desktops.
-- Split the help files in a separate package for help.
-- Split the guestlib headers in a separate devel package.
-
-* Mon Jan 28 2013 Sankar Tanguturi <stanguturi at vmware.com> - 9.2.2-1
-- Initial SPEC file to build open-vm-tools for Fedora 17.
+* Wed Apr 24 2013 Simone Caronni <negativo17 at gmail.com> - 9.2.2-1
+- First build.
More information about the scm-commits
mailing list