Blob Blame Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"] ')}
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')}

Name:          openwsman
Version:       2.2.0
Release:        7%{?dist}
License:        BSD
Url:            http://www.openwsman.org/
Source:         http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
Source2:        python-config
Patch0:         %{name}-initscript.patch
Patch1:         %{name}-pam-auth.patch
Patch2:         perl-bindings.patch
Patch3:         openwsman-randfile.patch
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXXX)
Group:          System Environment/Daemons
Summary:        Opensource Implementation of WS-Management
BuildRequires:  sblim-sfcc-devel curl-devel libxml2-devel pkgconfig pam-devel openssl-devel swig python python-devel ruby ruby-devel libtool
BuildRequires:  perl pkgconfig openssl-devel net-tools
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(postun): initscripts

%description
Openwsman is a project intended to provide an open-source
implementation of the Web Services Management specification
(WS-Management) and to expose system management information on the
Linux operating system using the WS-Management protocol. WS-Management
is based on a suite of web services specifications and usage
requirements that exposes a set of operations focused on and covers
all system management aspects.

%package -n libwsman1
License:        BSD
Group:          System Environment/Libraries
Summary:        Opensource Implementation of WS-Management
Provides:       %{name} = %{version}
Obsoletes:      %{name} < %{version}
Requires:       %{name}-client

%description -n libwsman1
Openwsman library for packages dependent on openwsman
%package -n libwsman-devel
License:        BSD
Group:          Development/Libraries
Summary:        Opensource Implementation of WS-Management
Provides:       %{name}-devel = %{version}
Obsoletes:      %{name}-devel < %{version}
Requires:       libwsman1 = %{version}
Requires:       %{name}-server = %{version}
Requires:       %{name}-client = %{version}
Requires:       sblim-sfcc-devel libxml2-devel pam-devel
Requires:       curl-devel

%description -n libwsman-devel
Development files for openwsman

%package client
License:        BSD
Group:          System Environment/Libraries
Summary:        Openwsman Client libraries

%description client
Openwsman Client libraries

%package server
License:        BSD
Group:          System Environment/Daemons
Requires:       net-tools
Requires:       openwsman-client
Requires(post):       chkconfig
Requires(preun):      chkconfig
Requires(postun):     initscripts
Summary:        Openwsman Server and service libraries

%description server
Openwsman Server and service libraries


%package python
License:        BSD
Group:          Development/Libraries
Summary:        Python bindings for openwsman client API
Requires:       python

%description python
This package provides Python bindings to access the openwsman client
API.

%package ruby
License:        BSD
Group:          Development/Libraries
Requires:       ruby
Requires:       ruby(abi) = 1.8
Summary:        Ruby bindings for openwsman client API

%description ruby
This package provides Ruby bindings to access the openwsman client API.

%package perl
License:        BSD
Group:          Development/Libraries
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Summary:        Perl bindings for openwsman client API

%description perl
This package provides Perl bindings to access the openwsman client API.





%prep
%setup -q 
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
cp -p %{SOURCE2} %{_builddir}/%{name}-%{version}
sed -i -e 's|#!/usr/bin/python2.5|#!%{__python}|' %{_builddir}/%{name}-%{version}/python-config

%build
sh autoconfiscate.sh
chmod a-x src/lib/*.[ch]
chmod a-x src/cpp/*.[ch]
chmod a-x include/*.[ch]

# disable eventing, as Fedora libcurl isn't linked against openssl
# disable tests in 2.1.0, http://www.openwsman.org/bug/263
%configure  --enable-python=yes --enable-ruby=yes --enable-eventing=no --disable-more-warnings --disable-static --enable-perl --enable-ipv6 PATH=$PATH:.
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -DFEDORA"
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_flags}

%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/openwsman/plugins/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/openwsman/authenticators/*.la
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
install -m 644 etc/openwsman.conf $RPM_BUILD_ROOT%{_sysconfdir}/openwsman
install -m 644 etc/ssleay.cnf $RPM_BUILD_ROOT%{_sysconfdir}/openwsman
install -m 755 etc/init/openwsmand.sh $RPM_BUILD_ROOT%{_sysconfdir}/init.d/openwsmand
ln -sf %{_sysconfdir}/init.d/openwsmand $RPM_BUILD_ROOT%{_sbindir}/rcopenwsmand

%clean
rm -rf %{buildroot}
%post -n libwsman1 -p /sbin/ldconfig

%postun -n libwsman1 -p /sbin/ldconfig

%post server
/sbin/ldconfig
chkconfig --add  openwsmand

%preun server
chkconfig --del openwsmand

%postun server
rm -f /var/log/wsmand.log
/sbin/ldconfig

%post client -p /sbin/ldconfig

%postun client -p /sbin/ldconfig

%files -n libwsman1
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog README TODO
%{_libdir}/libwsman.so.*
%{_libdir}/libwsman_client.so.*
%{_libdir}/libwsman_curl_client_transport.so.*

%files -n libwsman-devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/pkgconfig/*
%{_libdir}/*.so
%doc AUTHORS COPYING ChangeLog README

%files python
%defattr(-,root,root)
%{python_sitearch}/*.so
%{python_sitelib}/*.py
#%{python_sitelib}/*.pyc
#%{python_sitelib}/*.pyo
%doc AUTHORS COPYING ChangeLog README

%files ruby
%defattr(-,root,root)
%{ruby_sitearch}/openwsman.so
%dir %{ruby_sitelib}/openwsman
%{ruby_sitelib}/openwsman/openwsman.rb
%{ruby_sitelib}/openwsman/wsxmlnode.rb
%doc AUTHORS COPYING ChangeLog README

%files perl
%defattr(-,root,root)
%{perl_vendorarch}/openwsman.so
%{perl_vendorlib}/openwsman.pm
%doc AUTHORS COPYING ChangeLog README

%files server
# Don't remove *.so files from the server package.
# the server fails to start without these files.
%defattr(-,root,root)
%dir %{_sysconfdir}/openwsman
%config(noreplace) %{_sysconfdir}/openwsman/openwsman.conf
%config(noreplace) %{_sysconfdir}/openwsman/ssleay.cnf
%attr(0755,root,root) %{_sysconfdir}/openwsman/owsmangencert.sh
%config(noreplace) %{_sysconfdir}/pam.d/openwsman
%attr(0755,root,root) %{_sysconfdir}/init.d/openwsmand
%dir %{_libdir}/openwsman
%dir %{_libdir}/openwsman/authenticators
%{_libdir}/openwsman/authenticators/*.so
%{_libdir}/openwsman/authenticators/*.so.*
%dir %{_libdir}/openwsman/plugins
%{_libdir}/openwsman/plugins/*.so
%{_libdir}/openwsman/plugins/*.so.*
%{_sbindir}/openwsmand
%{_sbindir}/rcopenwsmand
%{_libdir}/libwsman_server.so.*
%doc AUTHORS COPYING ChangeLog README

%files client
%defattr(-,root,root)
%{_libdir}/libwsman_clientpp.so.*
%doc AUTHORS COPYING ChangeLog README


%changelog
* Thu Dec 31 2009 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.0-7
- Removed the dependency on libcurl-devel and added curl-devel.
- remove the hard coding of ruby while determing the sitearch and sitelibs.

* Mon Dec 28 2009 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.0-6
- Changed the random file used for creating an openssl cert

* Mon Dec 28 2009 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.0-5
- Added a few Build dependencies

* Mon Dec 28 2009 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.0-4
- Following the upstream packaging, updated the spec file to break the
- package into server, client, lib components.

* Tue Nov  3 2009 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.0-3
- Changed the python-config script for it to be working on el4

* Thu Oct  1 2009 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.0-2
- Increasing the release number to make another tag 

* Thu Oct  1 2009 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.2.0-1
- Updated the sources to 2.2.0. Couple of major changes are as follows:
- Major changes:
- 	Adapt IANA ports of 5985 (http) and 5986 (https)
- 	Change the Ruby bindings module name to 'Openwsman'
- 	Change the Ruby plugin module name to 'Openwsman'
- 	IPv6 support (A_Venkatachalam@Dell.com)
- 	preliminary support for wbem intrinsic operations
-           'EnumerateClassNames' and 'GetClass' (kkaempf@suse.de)
-            (needs fixed sblim-sfcc, see www.openwsman.org for details)
- Added a few more files in %files 

* Mon Sep 22 2008 Matt Domsch <Matt_Domsch@dell.com> - 2.1.0-1
- update to 2.1.0, resolves security issues

* Tue Aug 19 2008  <srinivas_ramanatha@dell.com> - 2.0.0-1
- Modified the spec file to adhere to fedora packaging guidelines.