File apache2-mod_jk.spec of Package apache2-mod_jk

#
# spec file for package apache2-mod_jk
#
# 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 section            free
%define apache_branch      %(rpm -q --qf %%{version} apache2 | grep -E -o "2\\.[0-9]+")
%define connectors_root    tomcat-connectors-%{version}-src
%define apache2_sysconfdir %(%{apxs} -q SYSCONFDIR)
%define apache2_libexecdir %(%{apxs} -q LIBEXECDIR)
%define apache2_mmn        %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN)
%define apache2_cflags     %(%{apxs} -q CFLAGS)
%if "%{apache_branch}" == "2.4"
  %define apxs %{_bindir}/apxs2
%else
  %define apxs %{_sbindir}/apxs2
%endif
Name:           apache2-mod_jk
Version:        1.2.40
Release:        0
Summary:        Connectors between Apache and Tomcat Servlet Container
License:        Apache-2.0
Group:          Productivity/Networking/Web/Frontends
Url:            http://jakarta.apache.org
Source0:        http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-%{version}-src.tar.gz
Source1:        jk.conf
Source2:        README.SUSE
BuildRequires:  apache2-devel
BuildRequires:  java2-devel-packages
BuildRequires:  pcre-devel
Requires:       %{apache2_mmn}
Requires:       apache2
Provides:       mod_jk = %{version}
Provides:       mod_jk-ap20 = %{version}
Provides:       mod_jk-ap20:%{_libdir}/apache2/mod_jk.so
Provides:       tomcat-mod = %{version}
Obsoletes:      mod_jk-ap20 < %{version}
Obsoletes:      tomcat-mod < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package provides modules for Apache to invisibly integrate Tomcat
capabilities into an existing Apache installation.

To load the module into Apache, run the command "a2enmod jk" as root.

%prep
%setup -q -n %{connectors_root}

%build
# prepare apr
export APACHE2_CFLAGS="%{apache2_cflags}"
cd $RPM_BUILD_DIR/%{connectors_root}/native
%configure \
	--with-pic \
	--with-apxs=%{apxs}
make %{?_smp_mflags}

%install
# AJP Connector jk
install -d -m 755 %{buildroot}%{apache2_libexecdir}
pushd $RPM_BUILD_DIR/%{connectors_root}
install -m 755 native/apache-2.0/.libs/mod_jk.so %{buildroot}%{apache2_libexecdir}/
popd
cp %{SOURCE1} .
cp %{SOURCE2} .

%files
%defattr(-,root,root,-)
%doc LICENSE README.SUSE
#mod_jk.conf.sample workers.properties.sample
%doc conf/workers.properties
%doc jk.conf
%{apache2_libexecdir}/*

%changelog