File VMware-vSphere.spec of Package VMware-vSphere-67-CLI-SDK
#
# spec file for package
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define realver 6.7.0
%define rel_nr 8156551
%define app_dir /opt/vmware
Summary: A Perl SDK for interacting with VMware vSphere infrastructure
Name: VMware-vSphere-67
Version: 6.7.0_b%{rel_nr}
Release: 0
License: GPL-2.0-or-later
Group: Applications/System
Source: VMware-vSphere-Perl-SDK-%{realver}-%{rel_nr}.x86_64.tar.gz
Source99: VMware-vSphere-67-CLI-SDK-rpmlintrc
NoSource: 0
Patch0: makefile.patch
Patch1: uuid-module.patch
Patch2: 0001-Switch-from-IO-Socket-SSL-to-Net-SSL.patch
URL: http://www.vmware.com
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The VMware vSphere CLI tools allows you to run common system administration
commands on ESX/ESXI/vServer systems. The Perl SDK allows you to develop your
own.
%package Perl-SDK
Summary: A Perl SDK for interacting with VMware vSphere infrastructure
Group: Development/Libraries
Autoreq: 0
Requires: perl-URI
Requires: perl-XML-LibXML
Requires: perl-libwww-perl
Requires: perl-Net-SSLeay
Requires: perl-Crypt-SSLeay
Requires: perl-SOAP-Lite
Requires: perl-UUID
BuildRequires: fdupes
BuildRequires: perl
BuildRequires: perl-ExtUtils-MakeMaker
BuildRequires: perl-URI
BuildRequires: perl-XML-LibXML
BuildRequires: perl-libwww-perl
BuildRequires: perl-Net-SSLeay
BuildRequires: perl-Crypt-SSLeay
BuildRequires: perl-SOAP-Lite
BuildRequires: perl-UUID
%description Perl-SDK
The vSphere SDK for Perl is a client-side Perl framework that provides an
easy-to-use scripting interface to the vSphere API. Administrators and
developers who are familiar with Perl can use the vSphere SDK for Perl to
automate a wide variety of administrative, provisioning, and monitoring tasks
in the vSphere environment. The vSphere SDK for Perl includes ready-to-use
utility applications, which you can immediately put to use in your virtual
datacenter.
The vSphere SDK for Perl installation includes the WS-Management Perl Library,
which allows you to write scripts that retrieve CIM data from the ESX host
using CIMOM, a service that provides standard CIM management functions over a
WBEM (Web-Based Enterprise Management).
You can use the SDK to manage ESX 3.0.x, ESX/ESXi 3.5, ESX/ESXi 4.0, ESX/ESXi
4.1, ESXi 5.0, vCenter Server 2.5, vCenter Server 4.0, vCenter Server 4.1,
vCenter Server 5.0, vCenter Server 5.1 and vCenter Server 5.5.
%package CLI
Summary: A CLI for interacting with VMware vSphere infrastructure
Group: Applications/System
Autoreq: 0
Requires: VMware-vSphere-67-Perl-SDK
Requires: perl-Archive-Zip
Requires: perl-Text-Template
%description CLI
The vSphere Command-Line Interface (vSphere CLI) command set allows you to run
common system administration commands against ESX/ESXi systems from any machine
with network access to those systems. You can also run most vSphere CLI
commands against a vCenter Server system and target any ESX/ESXi system that
vCenter Server system manages. vSphere CLI includes the ESXCLI command set,
vicfg- commands, and some other commands.
%prep
%setup -q -n vmware-vsphere-cli-distrib
%patch -P0 -P1
%patch -P2 -p1
%build
perl Makefile.PL INSTALLDIRS=vendor \
INSTALLVENDORSCRIPT=%{app_dir}/vcli
#INSTALL_BASE=%%{_prefix} \
#INSTALLSITELIB=%%{perl_vendorlib} \
#INSTALLSITEARCH=%%{perl_vendorarch} \
#INSTALLSITEMAN3DIR=%%{_prefix}/share/man/man3
make
%install
export NO_BRP_CHECK_RPATH=true
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT/ install
install -d -m 0755 $RPM_BUILD_ROOT%{app_dir}/vcli
cp -r lib/bin $RPM_BUILD_ROOT%{app_dir}/vcli
cp -r lib/lib64/ $RPM_BUILD_ROOT%{app_dir}/vcli/lib
install -d -m 0755 $RPM_BUILD_ROOT%{app_dir}/vcli/share/man/man1
cp man/*.1 $RPM_BUILD_ROOT%{app_dir}/vcli/share/man/man1/
# Install esxcfg/vicfg scripts
install -d -m 0755 $RPM_BUILD_ROOT%{app_dir}/bin
cp bin/* $RPM_BUILD_ROOT%{app_dir}/bin
install -d -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib
cp lib/lib32/lib*.1.0.2 $RPM_BUILD_ROOT%{_prefix}/lib/
cp lib/lib32/libv*.so $RPM_BUILD_ROOT%{_prefix}/lib/
# remove unecessary files
rm -f $RPM_BUILD_ROOT%{app_dir}/bin/vmware-uninstall-vSphere-CLI.pl*
rm -f $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
# vcli config file
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/vmware-vcli
cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/vmware-vcli/locations
answer BINDIR %{app_dir}/bin
answer LIBDIR %{app_dir}/vcli
answer INITDIR %{_sysconfdir}%{app_dir}
answer INITSCRIPTSDIR %{_initrddir}
EOF
echo $RPM_BUILD_ROOT%{perl_archlib}
find $RPM_BUILD_ROOT%{perl_vendorlib} -name \*.pm -exec chmod -v 644 {} \;
find $RPM_BUILD_ROOT%{perl_vendorlib} -name vmware_softwareidentity.pm -exec sed -i 's/\r//g' {} \;
find $RPM_BUILD_ROOT%{perl_vendorarch} -name .packlist -exec rm -fv {} \;
%fdupes $RPM_BUILD_ROOT%{app_dir}
%post -n %{name}-CLI -p /sbin/ldconfig
%postun -n %{name}-CLI -p /sbin/ldconfig
%files Perl-SDK
%defattr(-,root,root,-)
%dir %{app_dir}
%{perl_vendorarch}/auto/VIPerlToolkit
%{perl_vendorlib}/vmware-install.pl
%{perl_vendorlib}/VMware
%{perl_vendorlib}/WSMan
%{_prefix}/share/man/man3/VMware*
%files CLI
%exclude %{app_dir}/bin/vicli.bat
%exclude %{app_dir}/bin/six.pyc
%defattr(-,root,root,-)
%doc %{app_dir}/vcli/doc
%dir %{_sysconfdir}/vmware-vcli
%config(noreplace) %{_sysconfdir}/vmware-vcli/locations
%dir %{app_dir}/vcli
%{app_dir}/vcli/apps
%{app_dir}/vcli/bin
%{app_dir}/vcli/lib
%{app_dir}/vcli/share
%{_prefix}/lib/libcrypto.so.1.0.2
%{_prefix}/lib/libssl.so.1.0.2
%{_prefix}/lib/libvim-types.so
%{_prefix}/lib/libvmacore.so
%{_prefix}/lib/libvmomi.so
%dir %{app_dir}/bin
%{app_dir}/bin/esxcfg-advcfg
%{app_dir}/bin/esxcfg-authconfig
%{app_dir}/bin/esxcfg-cfgbackup
%{app_dir}/bin/esxcfg-dns
%{app_dir}/bin/esxcfg-dumppart
%{app_dir}/bin/esxcfg-hostops
%{app_dir}/bin/esxcfg-ipsec
%{app_dir}/bin/esxcfg-iscsi
%{app_dir}/bin/esxcfg-module
%{app_dir}/bin/esxcfg-mpath
%{app_dir}/bin/esxcfg-mpath35
%{app_dir}/bin/esxcfg-nas
%{app_dir}/bin/esxcfg-nics
%{app_dir}/bin/esxcfg-ntp
%{app_dir}/bin/esxcfg-rescan
%{app_dir}/bin/esxcfg-route
%{app_dir}/bin/esxcfg-scsidevs
%{app_dir}/bin/esxcfg-snmp
%{app_dir}/bin/esxcfg-syslog
%{app_dir}/bin/esxcfg-user
%{app_dir}/bin/esxcfg-vmknic
%{app_dir}/bin/esxcfg-volume
%{app_dir}/bin/esxcfg-vswitch
%{app_dir}/bin/resxtop
%{app_dir}/bin/svmotion
%{app_dir}/bin/vicfg-advcfg
%{app_dir}/bin/vicfg-authconfig
%{app_dir}/bin/vicfg-cfgbackup
%{app_dir}/bin/vicfg-dns
%{app_dir}/bin/vicfg-dumppart
%{app_dir}/bin/vicfg-hostops
%{app_dir}/bin/vicfg-ipsec
%{app_dir}/bin/vicfg-iscsi
%{app_dir}/bin/vicfg-module
%{app_dir}/bin/vicfg-mpath
%{app_dir}/bin/vicfg-mpath35
%{app_dir}/bin/vicfg-nas
%{app_dir}/bin/vicfg-nics
%{app_dir}/bin/vicfg-ntp
%{app_dir}/bin/vicfg-rescan
%{app_dir}/bin/vicfg-route
%{app_dir}/bin/vicfg-scsidevs
%{app_dir}/bin/vicfg-snmp
%{app_dir}/bin/vicfg-syslog
%{app_dir}/bin/vicfg-user
%{app_dir}/bin/vicfg-vmknic
%{app_dir}/bin/vicfg-volume
%{app_dir}/bin/vicfg-vswitch
%{app_dir}/bin/vifs
%{app_dir}/bin/vihostupdate
%{app_dir}/bin/vihostupdate35
%{app_dir}/bin/viperl-support
%{app_dir}/bin/vmkfstools
%{app_dir}/bin/vmware-cmd
%changelog