6206ab
ab6512
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
ab6512
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
ab6512
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
ab6512
%endif
6206ab
%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"] ')}
2cdcef
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')}
srinivas ramanatha 702dc6
eb3d4c
Name:           openwsman
6206ab
BuildRequires:  swig
6206ab
BuildRequires:  libcurl-devel libxml2-devel pam-devel sblim-sfcc-devel
b833a8
#BuildRequires:  python python-devel ruby ruby-devel rubygem(rdoc) perl
4e5ae9
BuildRequires:  python python-devel perl
6206ab
BuildRequires:  perl-devel pkgconfig openssl-devel
ab6512
BuildRequires:  cmake
797f46
BuildRequires:  systemd-units
b833a8
Version:        2.3.0
797f46
Release:        2%{?dist}
srinivas ramanatha 702dc6
Url:            http://www.openwsman.org/
6206ab
License:        BSD
6206ab
Group:          Applications/System
ab6512
Summary:        Open source Implementation of WS-Management
c8234d
Source:         http://downloads.sourceforge.net/project/openwsman/%{name}/%{version}/%{name}-%{version}.tar.bz2
ab6512
# help2man generated manpage for openwsmand binary
ab6512
Source1:        openwsmand.8.gz
797f46
# service file for systemd
797f46
Source2:        openwsman.service
797f46
# script for testing presence of the certificates in ExecStartPre
797f46
Source3:        owsmantestcert.sh
ab6512
Patch0:         %{name}-sitelibdir.patch
4e5ae9
Patch2:         openwsman-2.2.7-disable-ruby.patch
Vitezslav Crhonek 047514
Patch3:         openwsman-2.2.7-libssl.patch
srinivas ramanatha 702dc6
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXXX)
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
%description
srinivas ramanatha 702dc6
Openwsman is a project intended to provide an open-source
6206ab
implementation of the Web Services Management specipication
srinivas ramanatha 702dc6
(WS-Management) and to expose system management information on the
srinivas ramanatha 702dc6
Linux operating system using the WS-Management protocol. WS-Management
srinivas ramanatha 702dc6
is based on a suite of web services specifications and usage
srinivas ramanatha 702dc6
requirements that exposes a set of operations focused on and covers
srinivas ramanatha 702dc6
all system management aspects.
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
6206ab
6206ab
6206ab
%package -n libwsman1
6206ab
License:        BSD
6206ab
Group:          System Environment/Libraries
ab6512
Summary:        Open source Implementation of WS-Management
6206ab
Provides:       %{name} = %{version}
6206ab
Obsoletes:      %{name} < %{version}
6206ab
6206ab
%description -n libwsman1
6206ab
Openwsman library for packages dependent on openwsman
6206ab
6206ab
6206ab
6206ab
6206ab
%package -n libwsman-devel
6206ab
License:        BSD
srinivas ramanatha 702dc6
Group:          Development/Libraries
ab6512
Summary:        Open source Implementation of WS-Management
6206ab
Provides:       %{name}-devel = %{version}
6206ab
Obsoletes:      %{name}-devel < %{version}
6206ab
Requires:       libwsman1 = %{version}
6206ab
Requires:       %{name}-server = %{version}
6206ab
Requires:       %{name}-client = %{version}
6206ab
Requires:       sblim-sfcc-devel libxml2-devel pam-devel
6206ab
Requires:       libcurl-devel
6206ab
6206ab
%description -n libwsman-devel
6206ab
Development files for openwsman
6206ab
6206ab
6206ab
6206ab
%package client
6206ab
License:        BSD
6206ab
Group:          System Environment/Libraries
6206ab
Summary:        Openwsman Client libraries
6206ab
6206ab
%description client
6206ab
Openwsman Client libraries
6206ab
6206ab
6206ab
6206ab
6206ab
%package server
6206ab
License:        BSD
6206ab
Group:          System Environment/Daemons
6206ab
Requires:       net-tools
6206ab
Requires(post):       chkconfig
6206ab
Requires(preun):      chkconfig
6206ab
Requires(postun):     initscripts
6206ab
Summary:        Openwsman Server and service libraries
6206ab
6206ab
%description server
6206ab
Openwsman Server and service libraries
6206ab
6206ab
6206ab
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
%package python
6206ab
License:        BSD
srinivas ramanatha 702dc6
Group:          Development/Libraries
6206ab
Summary:        Python bindings for openwsman client API
6206ab
Requires:       python
6206ab
srinivas ramanatha 702dc6
%description python
6206ab
This package provides Python bindings to access the openwsman client
6206ab
API.
6206ab
6206ab
srinivas ramanatha 702dc6
6206ab
4e5ae9
#%package ruby
4e5ae9
#License:        BSD
4e5ae9
#Group:          Development/Libraries
4e5ae9
#Requires:       ruby
4e5ae9
#Requires:       ruby(abi) = 1.9.1
4e5ae9
#Summary:        Ruby bindings for openwsman client API
4e5ae9
#
4e5ae9
#%description ruby
4e5ae9
#This package provides Ruby bindings to access the openwsman client API.
6206ab
6206ab
6206ab
6206ab
6206ab
%package perl
6206ab
License:        BSD
6206ab
Group:          Development/Libraries
6206ab
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
6206ab
Summary:        Perl bindings for openwsman client API
6206ab
6206ab
%description perl
6206ab
This package provides Perl bindings to access the openwsman client API.
6206ab
6206ab
6206ab
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
%prep
6206ab
%setup -q
ab6512
# don't make backup of file patched by patch0, it'll be installed...
6206ab
%patch0 -p1
4e5ae9
%patch2 -p1
Vitezslav Crhonek 047514
%patch3 -p1 -b .libssl
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
%build
6206ab
# Removing executable permissions on .c and .h files to fix rpmlint warnings. 
6206ab
chmod -x src/cpp/WsmanClient.h
ab6512
ab6512
rm -rf build
ab6512
mkdir build
srinivas ramanatha 702dc6
0b25a0
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -DFEDORA -DNO_SSL_CALLBACK"
ab6512
export SSL_LIB=`readlink %{_libdir}/libssl.so`
ab6512
cd build
ab6512
cmake \
ab6512
  -DCMAKE_INSTALL_PREFIX=/usr \
ab6512
  -DCMAKE_VERBOSE_MAKEFILE=TRUE \
ab6512
  -DCMAKE_BUILD_TYPE=Release \
ab6512
  -DCMAKE_C_FLAGS_RELEASE:STRING="$RPM_OPT_FLAGS -fno-strict-aliasing" \
ab6512
  -DCMAKE_CXX_FLAGS_RELEASE:STRING="$RPM_OPT_FLAGS" \
ab6512
  -DCMAKE_SKIP_RPATH=1 \
ab6512
  -DPACKAGE_ARCHITECTURE=`uname -m` \
ab6512
  -DLIB=%{_lib} \
ab6512
   ..
ab6512
ab6512
make CFLAGS="-DSSL_LIB='\"$SSL_LIB\"'"
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
%install
srinivas ramanatha 702dc6
rm -rf %{buildroot}
ab6512
cd build
c8234d
make DESTDIR=%{buildroot} install
ab6512
cd ..
c8234d
rm -f %{buildroot}/%{_libdir}/*.la
c8234d
rm -f %{buildroot}/%{_libdir}/openwsman/plugins/*.la
c8234d
rm -f %{buildroot}/%{_libdir}/openwsman/authenticators/*.la
ab6512
[ -d %{buildroot}/%{ruby_sitelib} ] && rm -f %{buildroot}/%{ruby_sitelib}/openwsmanplugin.rb
bc7d70
[ -d %{buildroot}/%{ruby_sitelib} ] && rm -f %{buildroot}/%{ruby_sitelib}/openwsman.rb
ab6512
[ -d %{buildroot/}%{ruby_vendorlib} ] && rm -f %{buildroot}/%{ruby_vendorlib}/openwsmanplugin.rb
ab6512
mkdir -p %{buildroot}%{_sysconfdir}/init.d
c8234d
install -m 644 etc/openwsman.conf %{buildroot}/%{_sysconfdir}/openwsman
ab6512
install -m 644 etc/openwsman_client.conf %{buildroot}/%{_sysconfdir}/openwsman
797f46
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
797f46
install -p -m 644 %{SOURCE2} %{buildroot}/%{_unitdir}/openwsman.service
ab6512
install -m 644 etc/ssleay.cnf %{buildroot}/%{_sysconfdir}/openwsman
797f46
install -p -m 755 %{SOURCE3} %{buildroot}/%{_sysconfdir}/openwsman
ab6512
# install manpage
ab6512
mkdir -p %{buildroot}/%{_mandir}/man8/
ab6512
cp %SOURCE1 %{buildroot}/%{_mandir}/man8/
ab6512
# install missing headers
ab6512
install -m 644 include/wsman-xml.h %{buildroot}/%{_includedir}/openwsman
ab6512
install -m 644 include/wsman-xml-binding.h %{buildroot}/%{_includedir}/openwsman
ab6512
install -m 644 include/wsman-dispatcher.h %{buildroot}/%{_includedir}/openwsman
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
%clean
c8234d
rm -rf %{buildroot}
6206ab
6206ab
%post -n libwsman1 -p /sbin/ldconfig
srinivas ramanatha 702dc6
6206ab
%postun -n libwsman1 -p /sbin/ldconfig
6206ab
6206ab
%post server
6206ab
/sbin/ldconfig
797f46
if [ $1 -eq 1 ] ; then
797f46
  # Initial installation 
797f46
  /bin/systemctl daemon-reload >/dev/null 2>&1 || :
797f46
fi
6206ab
6206ab
%preun server
c8234d
if [ $1 = 0 ] ; then
797f46
       /bin/systemctl --no-reload disable openwsman.service > /dev/null 2>&1 || :
797f46
       /bin/systemctl stop openwsman.service > /dev/null 2>&1 || :
c8234d
fi
6206ab
6206ab
%postun server
6206ab
rm -f /var/log/wsmand.log
c8234d
797f46
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
c8234d
if [ "$1" -ge "1" ] ; then
797f46
     /bin/systemctl try-restart openwsman.service >/dev/null 2>&1 || :
c8234d
fi
6206ab
/sbin/ldconfig
6206ab
6206ab
%post client -p /sbin/ldconfig
6206ab
6206ab
%postun client -p /sbin/ldconfig
6206ab
6206ab
%files -n libwsman1
c8234d
%defattr(-,root,root,-)
b833a8
%doc AUTHORS COPYING ChangeLog README.md TODO
6206ab
%{_libdir}/libwsman.so.*
6206ab
%{_libdir}/libwsman_client.so.*
6206ab
%{_libdir}/libwsman_curl_client_transport.so.*
srinivas ramanatha 702dc6
6206ab
%files -n libwsman-devel
c8234d
%defattr(-,root,root,-)
srinivas ramanatha 702dc6
%{_includedir}/*
6206ab
%{_libdir}/pkgconfig/*
srinivas ramanatha 702dc6
%{_libdir}/*.so
b833a8
%doc AUTHORS COPYING ChangeLog README.md
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
%files python
c8234d
%defattr(-,root,root,-)
2cdcef
%{python_sitearch}/*.so
ab6512
%{python_sitearch}/*.py
ab6512
%{python_sitearch}/*.pyc
ab6512
%{python_sitearch}/*.pyo
b833a8
%doc AUTHORS COPYING ChangeLog README.md
srinivas ramanatha 702dc6
4e5ae9
#%files ruby
4e5ae9
#%defattr(-,root,root,-)
bc7d70
#%{ruby_sitearch}/openwsman.so
4e5ae9
#%{ruby_sitearch}/_openwsman.so
4e5ae9
#%dir %{ruby_sitelib}/openwsman
4e5ae9
#%{ruby_sitelib}/openwsman/*.rb
b833a8
#%doc AUTHORS COPYING ChangeLog README.md
srinivas ramanatha 702dc6
6206ab
%files perl
c8234d
%defattr(-,root,root,-)
6206ab
%{perl_vendorarch}/openwsman.so
6206ab
%{perl_vendorlib}/openwsman.pm
b833a8
%doc AUTHORS COPYING ChangeLog README.md
srinivas ramanatha 702dc6
6206ab
%files server
6206ab
# Don't remove *.so files from the server package.
6206ab
# the server fails to start without these files.
c8234d
%defattr(-,root,root,-)
6206ab
%dir %{_sysconfdir}/openwsman
6206ab
%config(noreplace) %{_sysconfdir}/openwsman/openwsman.conf
6206ab
%config(noreplace) %{_sysconfdir}/openwsman/ssleay.cnf
6206ab
%attr(0755,root,root) %{_sysconfdir}/openwsman/owsmangencert.sh
797f46
%attr(0755,root,root) %{_sysconfdir}/openwsman/owsmantestcert.sh
6206ab
%config(noreplace) %{_sysconfdir}/pam.d/openwsman
797f46
%{_unitdir}/openwsman.service
6206ab
%dir %{_libdir}/openwsman
6206ab
%dir %{_libdir}/openwsman/authenticators
6206ab
%{_libdir}/openwsman/authenticators/*.so
6206ab
%{_libdir}/openwsman/authenticators/*.so.*
6206ab
%dir %{_libdir}/openwsman/plugins
6206ab
%{_libdir}/openwsman/plugins/*.so
6206ab
%{_libdir}/openwsman/plugins/*.so.*
6206ab
%{_sbindir}/openwsmand
6206ab
%{_libdir}/libwsman_server.so.*
ab6512
%{_mandir}/man8/*
b833a8
%doc AUTHORS COPYING ChangeLog README.md
srinivas ramanatha 702dc6
6206ab
%files client
c8234d
%defattr(-,root,root,-)
6206ab
%{_libdir}/libwsman_clientpp.so.*
ab6512
%config(noreplace) %{_sysconfdir}/openwsman/openwsman_client.conf
b833a8
%doc AUTHORS COPYING ChangeLog README.md
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
%changelog
797f46
* Wed May 23 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.3.0-2
797f46
- Add systemd support
797f46
b833a8
* Tue Mar 27 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.3.0-1
b833a8
- Update to openwsman-2.3.0
b833a8
Vitezslav Crhonek 047514
* Thu Feb 09 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.7-4
Vitezslav Crhonek 047514
- Fix libssl loading
Vitezslav Crhonek 047514
4e5ae9
* Thu Feb 09 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.7-3
4e5ae9
- Temporarily disable ruby subpackage
4e5ae9
Vitezslav Crhonek 969202
* Thu Jan 26 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.7-2
Vitezslav Crhonek 969202
- Remove unnecessary net-tools requirement
Vitezslav Crhonek 969202
  Resolves: #784787
Vitezslav Crhonek 969202
bc7d70
* Wed Jan 11 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.7-1
bc7d70
- Update to openwsman-2.2.7
bc7d70
Marcela Mašláňová 0c2cd4
* Mon Jun 20 2011 Marcela Mašláňová <mmaslano@redhat.com> - 2.2.5-3
Marcela Mašláňová 0c2cd4
- Perl mass rebuild
Marcela Mašláňová 0c2cd4
Marcela Mašláňová 6d5c9b
* Fri Jun 10 2011 Marcela Mašláňová <mmaslano@redhat.com> - 2.2.5-2
Marcela Mašláňová 6d5c9b
- Perl 5.14 mass rebuild
Marcela Mašláňová 6d5c9b
5c0b32
* Wed Mar 23 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.5-1
5c0b32
- Update to openwsman-2.2.5
5c0b32
4016df
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.4-3
4016df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
4016df
0b25a0
* Thu Dec  9 2010 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.4-2
0b25a0
- Recompile with -DNO_SSL_CALLBACK
0b25a0
ab6512
* Tue Nov 16 2010 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.4-1
ab6512
- Update to openwsman-2.2.4
ab6512
- Add help2man generated manpage for openwsmand binary
ab6512
- Add missing openwsman headers to libwsman-devel
ab6512
- Add configuration file to openwsman-client
ab6512
Jesse Keating 628aec
* Wed Sep 29 2010 jkeating - 2.2.3-9
Jesse Keating 628aec
- Rebuilt for gcc bug 634757
Jesse Keating 628aec
6091aa
* Mon Sep 13 2010 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.3-8
6091aa
- Move initscript to the right place
6091aa
- Fix return values from initscript according to guidelines
6091aa
Praveen K Paladugu f23808
* Tue Aug 10 2010 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.3-7
Praveen K Paladugu f23808
- Moved the certificate generation from init script. The user will have to 
Praveen K Paladugu f23808
-   generate the certificate manually.
Praveen K Paladugu f23808
Praveen K Paladugu 0acef0
* Mon Aug  2 2010 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.3-6
Praveen K Paladugu 0acef0
- Fixed the version checking of swig and forced all the ruby files to be 
Praveen K Paladugu 0acef0
-   installed into site{lib,arch} dirs 
Praveen K Paladugu 0acef0
2808c5
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 2.2.3-5
2808c5
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
2808c5
7a03ef
* Tue Jun 01 2010 Marcela Maslanova <mmaslano@redhat.com> - 2.2.3-4
7a03ef
- Mass rebuild with perl-5.12.0
7a03ef
c8234d
* Tue Apr 22 2010 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.3-3
c8234d
- authors.patch: Moved all the AUTHORS info to AUTHORS file.
c8234d
- Corrected the Source tag.
c8234d
- Corrected the package dependencies to break cyclic dependencies.
c8234d
- Fixed the default attributes.
c8234d
- Fixed the preun & postun scripts, to make sure the openwsmand service
c8234d
-    is stopped before the package is removed.
c8234d
- Added 'condrestart' function to the init script.
c8234d
- Had to let the *.so files be part of the openwsman-server becuase
c8234d
-    some of the source files explicitly call out for *.so files.
c8234d
c8234d
6206ab
* Thu Apr 15 2010 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.3-2
6206ab
- Updated the spec file to adhere to the upstream standard of breaking
6206ab
- the package in server, client, lib modules 
6206ab
- randfile.patch: when openwsmand daemon creates a certificate the
6206ab
- first time it needs a file which have random content it. This
6206ab
- is pointed to $HOME/.rnd in /etc/openwsman/ssleay.cnf. Changed this
6206ab
- random file to /dev/urandom. 
6206ab
- initscript.patch: patch to edit the init script so that the services
6206ab
- are not started by default.
6206ab
6206ab
eb3d4c
* Wed Mar  3 2010 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.3-1
eb3d4c
- Update to openwsman-2.2.3
eb3d4c
c8234d
2cdcef
* Wed Sep 23 2009 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.0-1
2cdcef
- Added the new 2.2.0 sources.
2cdcef
- Changed the release and version numbers.
eb3d4c
f5a149
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 2.1.0-4
f5a149
- rebuilt with new openssl
f5a149
d87c14
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-3
d87c14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
d87c14
f35985
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-2
f35985
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
f35985
srinivas ramanatha 702dc6
* Mon Sep 22 2008 Matt Domsch <Matt_Domsch@dell.com> - 2.1.0-1
srinivas ramanatha 702dc6
- update to 2.1.0, resolves security issues
srinivas ramanatha 702dc6
srinivas ramanatha 702dc6
* Tue Aug 19 2008  <srinivas_ramanatha@dell.com> - 2.0.0-1%{?dist}
srinivas ramanatha 702dc6
- Modified the spec file to adhere to fedora packaging guidelines.