File dba-apa24-mod_auth_openidc-233.spec of Package dba-apa24-mod_auth_openidc-233

%define vers	233
%define version	2.3.3
%define apavers 2.4.27
%define apapack 2427
%define prefix	/DBA/apache24/WWW/2.4.x
%define apahome /DBA/apache24/WWW/%{apavers}
%define apxs    %{apahome}/bin/apxs
%define modname mod_auth_openidc

Name:           dba-apa24-%{modname}-%{vers}
Summary:        Apache Module for OpenID Connect
Version:        %{version}
Release:        1
License:        GPL
Url:            http://freeradius.org/mod_auth_radius/
Source0:        https://github.com/zmartzone/mod_auth_openidc/releases/download/v2.3.3/mod_auth_openidc-2.3.3.tar.gz
Group:          Productivity/Networking/Web/Servers
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  dba-apache-base dba-apache-%{apapack}
Requires:  	dba-apache-base

#!BuildIgnore:	dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c
#!BuildIgnore:  dba-curl-7371 mksh

%if %{?suse_version:1}0
BuildRequires:  libapr-util1-devel >= 1.3 libapr1-devel >= 1.3
%else
%if 0%{?centos_version} == 504 || 0%{?rhel_version} == 501
BuildRequires:  libapr-util1-devel >= 1.3 libapr1-devel >= 1.3
%else
BuildRequires:  apr-util-devel apr-devel
%endif
%endif

BuildRequires:  gcc-c++
BuildRequires:  curl-devel openssl-devel pcre-devel
BuildRequires:  dba-jansson-27-static
%define jandir  /DBA/jansson/2.7
BuildRequires:  dba-cjose-060-static
%define cjosedir  /DBA/cjose/0.6.0

%if 0%{?suse_version} >= 1110
BuildRequires:  -post-build-checks
%endif

%description
mod_auth_openidc is an authentication/authorization module for the Apache 2.x HTTP server that functions as an OpenID Connect Relying Party, authenticating users against an OpenID Connect Provider. It can also function as an OAuth 2.0 Resource Server, validating OAuth 2.0 access tokens presented by OAuth 2.0 Clients



%prep
%setup -q -n %{modname}-%{version}


%build
CFLAGS="$CFLAGS -I%{jandir}/include"
LDFLAGS="$LDFLAGS -L%{jandir}/lib"
export CFLAGS LDFLAGS

export JANSSON_CFLAGS="-I%{jandir}/include"
export JANSSON_LIBS="-L%{jandir}/lib"

export CJOSE_CFLAGS="-I%{cjosedir}/include"
export CJOSE_LIBS="-L%{cjosedir}/lib -lcjose"

./configure --with-apxs2=%{apxs}
# # %{apxs} -c src/mod_auth_openidc.c
%{__make}

nm ./src/.libs/mod_auth_openidc.so |grep -i cjose

%install
%{__mkdir_p} %{buildroot}%{prefix}/modules

install -m 755 src/.libs/%{modname}.so %{buildroot}%{prefix}/modules/%{modname}-%{version}.so


%post
cd %{prefix}/modules
%{__ln_s} -f %{modname}-%{version}.so %{modname}.so


%clean
%{__rm} -rf %{buildroot};


%files
%defattr(-,root,root,-)
%{prefix}/modules/%{modname}-%{version}.so


%changelog
* Thu Apr  5 2018 Holger Manthey <holger.manthey@bertelsmann.de>
- add static link for libcjose 
* Wed Apr  4 2018 Holger Manthey <holger.manthey@bertelsmann.de>
- initial build