Blame open-vm-tools.spec

42f92c7
%global majorversion    9.2
711961d
%global minorversion    3
711961d
%global toolsbuild      1031360
42f92c7
%global toolsversion    %{majorversion}.%{minorversion}
42f92c7
%global toolsdaemon     vmtoolsd
42f92c7
42f92c7
Name:             open-vm-tools
42f92c7
Version:          %{toolsversion}
b8240a8
Release:          2%{?dist}
42f92c7
Summary:          Open VMware Tools for virtual machines hosted on VMware
42f92c7
Group:            Applications/System
42f92c7
License:          GPLv2
42f92c7
URL:              http://%{name}.sourceforge.net/
42f92c7
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
32d982b
ExclusiveArch:    %{ix86} x86_64
32d982b
42f92c7
Source0:          http://sourceforge.net/projects/%{name}/files/%{name}/stable-%{majorversion}.x/%{name}-%{version}-%{toolsbuild}.tar.gz
42f92c7
Source1:          %{name}.service
9bbb621
Source2:          %{name}.init
42f92c7
42f92c7
BuildRequires:          doxygen
42f92c7
# Fuse is optional and enables vmblock-fuse
42f92c7
BuildRequires:          fuse-devel
42f92c7
BuildRequires:          glib2-devel >= 2.6.0
42f92c7
BuildRequires:          gtk2-devel >= 2.4.0
42f92c7
BuildRequires:          gtkmm24-devel
42f92c7
BuildRequires:          libdnet-devel
42f92c7
BuildRequires:          libicu-devel
42f92c7
BuildRequires:          libX11-devel
42f92c7
BuildRequires:          libXext-devel
42f92c7
BuildRequires:          libXi-devel
42f92c7
BuildRequires:          libXinerama-devel
42f92c7
BuildRequires:          libXrandr-devel
42f92c7
BuildRequires:          libXrender-devel
42f92c7
BuildRequires:          libXtst-devel
42f92c7
BuildRequires:          pam-devel
eac0ec7
eac0ec7
%if 0%{?rhel} == 6
eac0ec7
BuildRequires:          procps
eac0ec7
%else
42f92c7
BuildRequires:          procps-devel
38127fc
%endif
9bbb621
9bbb621
%if 0%{?fedora} || 0%{?rhel} >= 7
42f92c7
BuildRequires:          systemd-units
9bbb621
%endif
9bbb621
9bbb621
%if 0%{?fedora} == 16 || 0%{?fedora} == 17
9bbb621
Requires(post):         systemd-units
9bbb621
Requires(preun):        systemd-units
9bbb621
Requires(postun):       systemd-units
9bbb621
%endif
42f92c7
9bbb621
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
42f92c7
Requires(post):         systemd
42f92c7
Requires(preun):        systemd
42f92c7
Requires(postun):       systemd
9bbb621
%endif
9bbb621
9bbb621
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
9bbb621
Requires(post):         /sbin/chkconfig
9bbb621
Requires(preun):        /sbin/chkconfig
9bbb621
Requires(preun):        /sbin/service
9bbb621
Requires(postun):       /sbin/service
9bbb621
%endif
42f92c7
42f92c7
%description
42f92c7
The %{name} project is an open source implementation of VMware Tools. It
42f92c7
is a suite of open source virtualization utilities and drivers to improve the
42f92c7
functionality, user experience and administration of VMware virtual machines.
42f92c7
This package contains only the core user-space programs and libraries of
42f92c7
%{name}.
42f92c7
42f92c7
%package          desktop
42f92c7
Summary:          User experience components for Open VMware Tools
42f92c7
Group:            System Environment/Libraries
42f92c7
Requires:         %{name}%{?_isa} = %{version}-%{release}
42f92c7
42f92c7
%description      desktop
42f92c7
This package contains only the user-space programs and libraries of
42f92c7
%{name} that are essential for improved user experience of VMware virtual
42f92c7
machines.
42f92c7
42f92c7
%package          devel
42f92c7
Summary:          Development libraries for Open VMware Tools
42f92c7
Group:            Development/Libraries
42f92c7
Requires:         %{name}%{?_isa} = %{version}-%{release}
42f92c7
42f92c7
%description      devel
42f92c7
This package contains only the user-space programs and libraries of
42f92c7
%{name} that are essential for developing customized applications for
42f92c7
VMware virtual machines.
42f92c7
42f92c7
%prep
42f92c7
%setup -q -n %{name}-%{version}-%{toolsbuild}
42f92c7
42f92c7
%build
42f92c7
# Use -Wno-unused-local-typedefs to build with GCC 4.8
711961d
export CFLAGS="$RPM_OPT_FLAGS -Wno-unused-local-typedefs"
711961d
export CXXLAGS="$RPM_OPT_FLAGS -Wno-unused-local-typedefs"
42f92c7
%configure \
42f92c7
    --without-kernel-modules \
42f92c7
    --disable-static
42f92c7
sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
42f92c7
make %{?_smp_mflags}
42f92c7
42f92c7
%install
42f92c7
export DONT_STRIP=1
42f92c7
make install DESTDIR=%{buildroot}
42f92c7
42f92c7
# Remove exec bit from config files
42f92c7
chmod a-x %{buildroot}%{_sysconfdir}/pam.d/*
42f92c7
42f92c7
# Remove the DOS line endings
42f92c7
sed -i "s|\r||g" README
42f92c7
42f92c7
# Remove unnecessary files from packaging
42f92c7
find %{buildroot}%{_libdir} -name '*.la' -delete
42f92c7
rm -fr %{buildroot}%{_defaultdocdir}
42f92c7
rm -f docs/api/build/html/FreeSans.ttf
42f92c7
9bbb621
%if 0%{?fedora} || 0%{?rhel} >= 7
9bbb621
42f92c7
# Systemd unit files
42f92c7
install -p -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{toolsdaemon}.service
42f92c7
9bbb621
%else
9bbb621
9bbb621
# Initscripts
9bbb621
install -p -m 755 -D %{SOURCE2} %{buildroot}%{_initrddir}/%{toolsdaemon}
9bbb621
9bbb621
%endif
9bbb621
42f92c7
# 'make check' in open-vm-tools rebuilds docs and ends up regenerating
42f92c7
# the font file. We can add %%check secion once 'make check' is fixed
42f92c7
# upstream
42f92c7
9bbb621
%if 0%{?fedora} == 17
9bbb621
42f92c7
%post
9bbb621
/sbin/ldconfig
9bbb621
if [ $1 -eq 1 ] ; then
9bbb621
    # Initial installation
b8240a8
    /bin/systemctl enable %{toolsdaemon}.service >/dev/null 2>&1 || :
9bbb621
fi
9bbb621
9bbb621
%preun
9bbb621
if [ $1 -eq 0 ] ; then
9bbb621
    # Package removal, not upgrade
9bbb621
    /bin/systemctl --no-reload disable %{toolsdaemon}.service > /dev/null 2>&1 || :
9bbb621
    /bin/systemctl stop %{toolsdaemon}.service > /dev/null 2>&1 || :
9bbb621
fi
9bbb621
9bbb621
%postun
9bbb621
/sbin/ldconfig
9bbb621
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
9bbb621
if [ $1 -ge 1 ] ; then
9bbb621
    # Package upgrade, not uninstall
9bbb621
    /bin/systemctl try-restart %{toolsdaemon}.service >/dev/null 2>&1 || :
9bbb621
fi
9bbb621
9bbb621
%endif
9bbb621
9bbb621
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
9bbb621
9bbb621
%post
9bbb621
/sbin/ldconfig
42f92c7
%systemd_post %{toolsdaemon}.service
42f92c7
42f92c7
%preun
42f92c7
%systemd_preun %{toolsdaemon}.service
42f92c7
42f92c7
%postun
9bbb621
/sbin/ldconfig
42f92c7
%systemd_postun_with_restart %{toolsdaemon}.service
42f92c7
9bbb621
%endif
9bbb621
9bbb621
%if 0%{?rhel} == 6 || 0%{?rhel} == 5
9bbb621
9bbb621
%post
9bbb621
/sbin/chkconfig --add %{toolsdaemon}
9bbb621
9bbb621
%preun
9bbb621
if [ $1 -eq 0 ]; then
9bbb621
    /sbin/service %{toolsdaemon} stop >/dev/null 2>&1 || :
9bbb621
    /sbin/chkconfig --del %{toolsdaemon}
9bbb621
fi
9bbb621
9bbb621
%postun
9bbb621
if [ $1 -ge 1 ]; then
9bbb621
    /sbin/service %{toolsdaemon} condrestart >/dev/null 2>&1 || :
9bbb621
fi
9bbb621
9bbb621
%endif
9bbb621
9bbb621
%post devel -p /sbin/ldconfig
42f92c7
9bbb621
%postun devel -p /sbin/ldconfig
42f92c7
42f92c7
%files
42f92c7
%defattr(-,root,root,-)
42f92c7
%doc AUTHORS ChangeLog COPYING NEWS README
42f92c7
%config(noreplace) %{_sysconfdir}/pam.d/*
42f92c7
%{_sysconfdir}/vmware-tools/
42f92c7
%{_bindir}/vmtoolsd
42f92c7
%{_bindir}/vmware-checkvm
42f92c7
%{_bindir}/vmware-hgfsclient
42f92c7
%{_bindir}/vmware-rpctool
42f92c7
%{_bindir}/vmware-toolbox-cmd
42f92c7
%{_bindir}/vmware-xferlogs
42f92c7
%{_libdir}/libguestlib.so.*
42f92c7
%{_libdir}/libhgfs.so.*
42f92c7
%{_libdir}/libvmtools.so.*
42f92c7
%dir %{_libdir}/%{name}/
42f92c7
%dir %{_libdir}/%{name}/plugins
42f92c7
%dir %{_libdir}/%{name}/plugins/common
42f92c7
%{_libdir}/%{name}/plugins/common/*.so
42f92c7
%dir %{_libdir}/%{name}/plugins/vmsvc
42f92c7
%{_libdir}/%{name}/plugins/vmsvc/*.so
42f92c7
%{_sbindir}/mount.vmhgfs
42f92c7
%{_datadir}/%{name}/
42f92c7
%exclude /sbin/
9bbb621
%if 0%{?fedora} || 0%{?rhel} >= 7
42f92c7
%{_unitdir}/%{toolsdaemon}.service
9bbb621
%else
9bbb621
%{_initrddir}/%{toolsdaemon}
9bbb621
%endif
42f92c7
42f92c7
%files desktop
42f92c7
%defattr(-,root,root,-)
42f92c7
%{_sysconfdir}/xdg/autostart/*.desktop
42f92c7
%{_bindir}/vmware-user-suid-wrapper
42f92c7
%{_bindir}/vmware-vmblock-fuse
42f92c7
%{_libdir}/%{name}/plugins/vmusr/
42f92c7
42f92c7
%files devel
42f92c7
%defattr(-,root,root,-)
42f92c7
%doc docs/api/build/*
42f92c7
%{_includedir}/vmGuestLib/
42f92c7
%{_libdir}/pkgconfig/*.pc
42f92c7
%{_libdir}/libguestlib.so
42f92c7
%{_libdir}/libhgfs.so
42f92c7
%{_libdir}/libvmtools.so
42f92c7
42f92c7
%changelog
b8240a8
* Fri Apr 26 2013 Simone Caronni <negativo17@gmail.com> - 9.2.3-2
b8240a8
- Enable service by default on systemd systems.
b8240a8
711961d
* Fri Apr 26 2013 Simone Caronni <negativo17@gmail.com> - 9.2.3-1
711961d
- Package new upstream version open-vm-tools-9.2.3-1031360.
711961d
- Removed configure options CUSTOM_PROCPS_NAME (for libproc) and
711961d
  -Wno-deprecated-declarations as these have been addressed in
711961d
  open-vm-tools-9.2.3-1031360.
eac0ec7
- Added workaround for RHEL bug #950748.
711961d
9bbb621
* Wed Apr 24 2013 Simone Caronni <negativo17@gmail.com> - 9.2.2-1
9bbb621
- First build.