File apache2-mod_proxy_msrpc.spec of Package apache2-mod_proxy_msrpc

#
# spec file for package apache2-mod_proxy_msrpc (Version 0.2)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 Johannes Engel (jcnengel@gmail.com)
#
# 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/
#
# norootforbuild

%define modname mod_proxy_msrpc
%if 0%{?suse_version}
%define apxs /usr/sbin/apxs2
%else
%define apxs /usr/sbin/apxs
%endif
%define apache apache2
%define apache_serverroot %(%{apxs} -q PREFIX)
%define apache_includedir %(%{apxs} -q INCLUDEDIR)
%define apache_libexecdir %(%{apxs} -q LIBEXECDIR)
%if 0%{?suse_version}
%define apache_sysconfdir %(%{apxs} -q SYSCONFDIR)
%else
%define apache_sysconfdir %(%{apxs} -q PREFIX)
%endif
%define apache_localstatedir %(%{apxs} -q LOCALSTATEDIR)
%define apache_mmn        %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN)

Name:           apache2-mod_proxy_msrpc
Summary:        Apache2 module to act as a proxy for Exchange
Version:        0.2
Release:        1
License:        Apache-2.0
Group:          Productivity/Networking/Web/Servers
Autoreqprov:    on
Url:            https://github.com/bombadil/mod_proxy_msrpc
Source0:        %{modname}-%{version}.tar.gz
Source1:		vhost-exchange.template
Source2:		README
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
BuildRequires:  apache2-devel >= 2.4
%else
BuildRequires:  httpd-devel >= 2.4 httpd >= 2.4
%endif
BuildRequires:	libuuid-devel
Requires:  apache2 >= 2.4 %{apache_mmn}


%description
This module intends to make Apache work in a reverse proxy setup
  in front of a MS Exchange server offering Outlook Anywhere
  services.


%prep
%setup -n %{modname}-%{modname}-%{version}
pushd src
%{__cp} -a %{S:1} .
#%{__cp} -a %{S:2} .
popd

%build
pushd src
%{apxs} -luuid -c %{modname}.c msrpc_pdu_parser.c msrpc_sync.c
popd

%install
# install needed files
pushd src
%{__install} -D -m0644 .libs/%{modname}.so $RPM_BUILD_ROOT%{apache_libexecdir}/%{modname}.so
%{__install} -D -m0644 vhost-exchange.template $RPM_BUILD_ROOT%{apache_sysconfdir}/vhosts.d/vhost-exchange.template
popd

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc README.pod
%dir %{apache_sysconfdir}/vhosts.d
%config %{apache_sysconfdir}/vhosts.d/vhost-exchange.template
%{apache_libexecdir}/*.so

%changelog