# -*- mode: rpm-spec; -*-

%define version_major  1.0
%define version_relext 0.20031201

%define version_package 1.0-20031201

## for apache2
%define _with_cgi_bin /var/www/cgi-bin
## for apache1
#define _with_cgi_bin /home/httpd/cgi-bin

%define _sysconfdir /etc/opensoap
%define _with_servicesdir /usr/lib/opensoap

%define _localstatedir /var/opensoap
# may need to be modified like /var/{log,spool,run}/opensoap

Summary: SOAP-based middleware for XML Web Services applications.
Summary(ja): XML Web�����ӥ����ץꥱ����������SOAP�١����ߥɥ륦������
Name: opensoap
Version: 2.0.1
Release: 0vl1
Epoch: 1
Group: System Environment/Libraries
Source: http://www.opensoap.jp/download/%{name}-%{version}.tar.gz
Patch0: opensoap-2.0.1-protected.patch

License: BSD
URL: http://www.opensoap.jp/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
#Patch: %{name}-%{version_package}.patch

BuildRequires: libxml2-devel openssl-devel apache2-devel
Requires: libxml2 openssl

%description
OpenSOAP provides an environment for XML Web Services.
API libraries to use SOAP (Simple Object Access Protocol) and the
server for service applications are provided.  Also Transaction and
Security functions are implemented.
This main package includes shared libraries for executing OpenSOAP
application software, and such basic tools as Soaping client/service
and Transaction service.

%description -l ja
OpenSOAP��XML Web�����ӥ��Τ���δĶ����󶡤��ޤ���SOAP (Simple Object
Access Protocol)�����Ѥ��뤿���API�饤�֥��ȡ������ӥ����ץꥱ������
���ѤΤ���Υ����Ф��󶡤����ȥ�󥶥������䥻�����ƥ��ε�ǽ�����
�Ƥ��ޤ���
�������Υѥå������ˤϡ�OpenSOAP���ץꥱ������󥽥եȼ¹Ի���ɬ�פ�
��ͭ�饤�֥�ꡢ�ڤӡ����ܥġ���Ǥ���Soaping���饤�����/�����ӥ���
Transaction�����ӥ����ޤޤ�ޤ���

%package devel
Summary: Libraries, include files to develop OpenSOAP applications.
Summary(ja): OpenSOAP���ץꥱ�������ȯ�Τ���Υ饤�֥��ȥإå��ե����롣
Group: Development/Libraries
Requires: %{name} = %{epoch}:%{version}-%{release}

%description devel
Libraries, include-header files and documentation which can be used to
develop software based on SOAP for Web Services, and to compile the
source code for OpenSOAP application programs.

%description devel -l ja
���Υ饤�֥��ȥإå��ե����롢�ڤӥɥ������������Ѥ��뤳�Ȥǡ�
Web�����ӥ��Τ����SOAP�̿������Ѥ��륽�եȥ�������ȯ�����ꡢ���ꤷ
��OpenSOAP���ץꥱ�������Υ����������ɤ򥳥�ѥ���ڤӥ�󥯤��뤳��
����ǽ�Ȥʤ�ޤ���

%package server
Summary: Server for the original OpenSOAP functions.
Summary(ja): OpenSOAP�ȼ��ε�ǽ��¸����뤿��Υ����С�
Group: System Environment/Daemons
Requires: %{name} = %{epoch}:%{version}-%{release}
Provides: mod_opensoap = %{version}-%{release}

%description server
The OpenSOAP Server supports operations for Web Service systems and
provides practical functions, such as asynchronous client connections
for non-real time processing, message forwarding for searching valid
services and passing through firewalls, and signing messages for
security validation.

%description server -l ja
OpenSOAP�����Фϡ��絬�Ϥ�Web�����ӥ������ƥ�α��Ѥ򥵥ݡ��Ȥ��ޤ���
�����ӥ�����ꥢ�륿����������б�������Ʊ�����饤�������³��ǽ��������
����õ����ե�������������ۤ���¸����륵���д֥�å�����ž����ǽ�����
�������ؤν�̾�ʤɤ�Ԥ��������ƥ���ǽ���ޤޤ�Ƥ��ޤ���

%package samples
Summary: Sample application programs of OpenSOAP.
Summary(ja): OpenSOAP�Υ���ץ륢�ץꥱ�������ץ�����ࡣ
Group: Applications/Networking
Requires: %{name} = %{epoch}:%{version}-%{release}

%description samples
This is a collection of simple sample application programs using
OpenSOAP.  Please try them if you just want to use OpenSOAP.  If you
are interested in developing application programs, please also refer
to the source codes.

%description samples -l ja
OpenSOAP���ץꥱ�������δ�ñ�ʥ���ץ�δ󤻽���Ǥ���
OpenSOAP��Ȥꤢ�����ȤäƤߤ������ˡ����󤪻�����������ץꥱ������
��ץ�����೫ȯ�˶�̣�Τ������ϡ������������ɤ⤴����������

%prep
%setup -q 
%patch0 -p1 -b .protected

%build
%configure --sysconfdir=%{_sysconfdir} --with-servicesdir=%{_with_servicesdir} --with-cgi-bin=%{_with_cgi_bin} --localstatedir=%{_localstatedir} --with-ssl-include=/usr/include

## doc files to be copied
cp -pr doc docs
find docs -name 'Makefile*' -exec rm {} \;
rm -rf docs/api/*/Doxyfile
rm -rf docs/api/*/text/
cp -pr samples docs/

make

%install
rm -rf $RPM_BUILD_ROOT
LIBRARY_PATH="$RPM_BUILD_ROOT"%{_libdir} make DESTDIR="$RPM_BUILD_ROOT" install
# samples
make DESTDIR="$RPM_BUILD_ROOT" install-samples

# install SYSV init stuff
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
install -m755 etc/init.d/opensoap.redhat \
	$RPM_BUILD_ROOT/etc/rc.d/init.d/opensoap

%clean
rm -rf $RPM_BUILD_ROOT

%post server
# Register the opensoap service
/sbin/chkconfig --add opensoap

%preun server
if [ $1 = 0 ]; then
#	%{_sbindir}/opensoap-server-ctl stop || exit 0
	/sbin/service opensoap stop
	/sbin/chkconfig --del opensoap
fi

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%{_bindir}/soaping
%{_libdir}/libFileLib.so.*
%{_libdir}/libOpenSOAPClient.so.*
%{_libdir}/libOpenSOAPInterface.so.*
%{_libdir}/libOpenSOAPService.so.*
%{_libdir}/libOpenSOAPSecurity.so.*
%{_libdir}/libSharedLib.so.*
%{_libdir}/libTraceLib.so.*
%{_with_cgi_bin}/TransactionService.cgi
%{_with_cgi_bin}/SoapingService.cgi
%{_with_servicesdir}/Soaping
%{_with_servicesdir}/Transaction
%{_localstatedir}/services/Transaction
%{_mandir}/man1/*
%{_mandir}/ja/man1/*
%doc INSTALL INSTALL.ujis README README.ujis LICENSE
%doc HISTORY HISTORY.ujis TODO TODO.ujis
%doc docs/tools

%files devel
%defattr(-,root,root)
%{_includedir}/OpenSOAP
%{_libdir}/libFileLib.so
%{_libdir}/libOpenSOAPClient.so
%{_libdir}/libOpenSOAPInterface.so
%{_libdir}/libOpenSOAPService.so
%{_libdir}/libOpenSOAPSecurity.so
%{_libdir}/libSharedLib.so
%{_libdir}/libTraceLib.so
%{_libdir}/libFileLib.*a
%{_libdir}/libOpenSOAPClient.*a
%{_libdir}/libOpenSOAPInterface.*a
%{_libdir}/libOpenSOAPService.*a
%{_libdir}/libOpenSOAPSecurity.*a
%{_libdir}/libSharedLib.*a
%{_libdir}/libTraceLib.*a
%doc docs/api/en
%doc docs/api/ja

%files server
%defattr(-,root,root)
%{_sbindir}/*
%{_libdir}/libOpenSOAPServer.*
#{_libdir}/libHTTPMessage.*
%{_libdir}/libSOAPMessage.*
%{_libdir}/libconnection.*
%{_libdir}/apache2/modules/mod_opensoap.so
%config %{_sysconfdir}/server.conf
%config %{_sysconfdir}/privKey.pem
%config %{_sysconfdir}/pubKey.pem
%{_sysconfdir}/*pem.default
%{_sysconfdir}/ssml/Soaping.ssml
%{_sysconfdir}/ssml/Transaction.ssml
%{_with_cgi_bin}/soapInterface.cgi
%{_mandir}/man8/*
%{_mandir}/ja/man8/*
%doc docs/server/*
%config /etc/rc.d/init.d/opensoap

%files samples
%defattr(-,root,root)

%doc docs/samples/*
%{_with_cgi_bin}/*Calc*
%{_with_cgi_bin}/Hello*
%{_with_cgi_bin}/GetCertService.cgi
%{_with_cgi_bin}/*Shopping*
%{_with_cgi_bin}/TransactionApp.cgi
%{_with_cgi_bin}/TransactionHtml
%{_with_cgi_bin}/TransactionABankService.cgi
%{_with_cgi_bin}/Echo*
%{_with_servicesdir}/*Calc*
%{_with_servicesdir}/*Hello*
%{_with_servicesdir}/GetCert
%{_with_servicesdir}/*Shopping*
%{_with_servicesdir}/TransactionABank
%{_with_servicesdir}/Echo
%{_bindir}/*Calc*
%{_bindir}/*Hello*
%{_bindir}/GetCertClient
%{_bindir}/registCA
# %{_bindir}/genrsakey
# %{_bindir}/secEnv
%{_bindir}/*Shopping*
%{_bindir}/TransactionClient
%{_bindir}/EchoClient
%{_sysconfdir}/ssml/*Calc*
%{_sysconfdir}/ssml/GetCert.ssml
%{_sysconfdir}/ssml/*Hello*
%{_sysconfdir}/ssml/*Shopping*
%{_sysconfdir}/ssml/TransactionABank.ssml
%{_sysconfdir}/ssml/Echo.ssml
%{_localstatedir}/services/CalcAsync
%{_localstatedir}/services/GetCert
%{_localstatedir}/services/ShoppingSec

%changelog
* Wed Oct 03 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.1-0vl1
- updated to 2.0.1
- added Patch0 based on Bugzilla

* Mon Dec 01 2003 Nobuhito OKADA <okada@opensoap.jp> 1.0-0.20031201
- added /usr/kerberos/include to avoid ssl compilation errors on RedHat9

* Wed Sep 03 2003 Nobuhito OKADA <okada@opensoap.jp> 1.0-0.20030903
- specify LIBRARY_PATH for make install

* Fri May 30 2003 Nobuhito OKADA <okada@opensoap.jp> 1.0-0.20030530
- added init script
- added Epoch because versioning was confusing
- added man/ja/
- build opensoap-samples properly

* Sat Mar  1 2003 Nobuhito OKADA <okada@opensoap.jp> 1.0_20030228-2
- added %defattr
- removed Vendor
- corrected _with_cgi_bin (bug of define ?)

* Thu Feb 28 2003 Nobuhito OKADA <okada@opensoap.jp> 1.0_20030228-1
- Released as the first version.