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