File apache2-mod_owa.spec of Package apache2-mod_owa
#
# spec file for package apache2-mod_owa
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, 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 apxs /usr/sbin/apxs2
%define apache apache2
#%%define apache_libexecdir %%(%%{apxs} -q LIBEXECDIR)
#%%define apache_sysconfdir %%(%%{apxs} -q SYSCONFDIR)
#%%define apache_includedir %%(%%{apxs} -q INCLUDEDIR)
#%%define apache_serverroot %%(%%{apxs} -q PREFIX)
#%%define apache_mmn %%(MMN=$(%%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN)
Name: apache2-mod_owa
Summary: Apache PL/SQL Gateway Module
License: OCSL
Group: Productivity/Networking/Web/Servers
Url: https://oss.oracle.com/projects/mod_owa/dist/documentation/modowa.htm
Version: 2.11.10
Release: 0
Source0: https://oss.oracle.com/projects/mod_owa/dist/files/unix_all.tgz
Source1: %{name}.permissions
Source2: %{name}.logrotate
Source99: %{name}.rpmlintrc
Patch0: %{name}.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: permissions
Requires: %{apache_mmn}
Requires: apache2
Requires: logrotate
BuildRequires: apache2-devel
BuildRequires: apache-rpm-macros
BuildRequires: libapr1-devel
BuildRequires: libapr-util1-devel
BuildRequires: oracle-instantclient-devel
BuildRequires: logrotate
Conflicts: apache2-mod_owa12.1
Conflicts: apache2-mod_owa12.2
Conflicts: apache2-mod_owa18.3
Conflicts: apache2-mod_owa19
%description
mod_owa is an open-source implementation of the PL/SQL gateway available in
Oracle's OAS/OWS product. The gateway is able to call PL/SQL procedures
in a manner similar to the way Java servlets are supported, with the Oracle
database acting as the "virtual machine". Arguments are marshalled through
SQL*Net to your procedures, and responses returned the same way.
HTTP header elements are made available via a CGI-like mechanism.
%prep
%setup -q -n modowa
%patch -P 0 -p1
%build
pushd src
cp ../bin/apache24/modowa.mk .
# Query version from oracle-instantclient-devel
# First version does not run anymore suse_version >= 1500
#ora_version=`rpm -q --qf "%%{VERSION}\n" oracle-instantclient-devel`
ora_version=`rpm -qi oracle-instantclient-devel | grep Version | tr -d "Version :"`
%define ora_version $ora_version
xargs sed -i -e "s:@ORA_VERSION@:%{ora_version}:g" modowa.mk
make -kf modowa.mk
popd
%install
%{__install} -d %{buildroot}%{apache_sysconfdir}/conf.d
%{__install} -d %{buildroot}%{apache_libexecdir}
%{__install} -d m0770 %{buildroot}/var/log/apache2-mod_owa
%{__cp} -pR bin/apache24/modowa.conf %{buildroot}%{apache_sysconfdir}/conf.d/mod_owa.conf
%{__cp} -pR src/mod_owa.so %{buildroot}%{apache_libexecdir}/mod_owa.so
# set log-path
xargs sed -i -e "s:/usr/local/apache20/logs/owa.log:/var/log/apache2-mod_owa/owa.log:g" %{buildroot}%{apache_sysconfdir}/conf.d/mod_owa.conf
# install permissions file
%{__install} -D -m 0644 %{S:1} $RPM_BUILD_ROOT%{_sysconfdir}/permissions.d/mod_owa
# Install logrotate
%{__install} -D -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/mod_owa
%post
# Permissions Set
%set_permissions /var/log/apache2-mod_owa/
%verifyscript
# Permissions Verify
%verify_permissions -e /var/log/apache2-mod_owa/
%files
%defattr(-,root,root)
%doc doc/
%dir %attr(0770,wwwrun,www) /var/log/apache2-mod_owa
%config(noreplace) %{apache_sysconfdir}/conf.d/mod_owa.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/mod_owa
%config(noreplace) %{_sysconfdir}/permissions.d/mod_owa
%{apache_libexecdir}/mod_owa.so
%changelog