%{!?apxs: %{expand:%%define apxs %{_sbindir}/apxs}}
Name: libapreq2
Version: 2.09
Release: 0.rc1.2%{?dist}
Summary: Apache HTTP request library
Group: System Environment/Libraries
License: Apache Software License
URL: http://httpd.apache.org/apreq/
Source0: http://people.apache.org/~pgollucci/apreq2/libapreq2-2.09-rc1.tar.gz
Source1: %{name}-httpd.conf
Patch0: %{name}-build.patch
Patch1: %{name}-2.07-rc3-ldflags.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: httpd-devel >= 2.0.48
BuildRequires: libtool
BuildRequires: apr-devel >= 0.9.4
BuildRequires: apr-util-devel >= 0.9.4
BuildRequires: perl(ExtUtils::XSBuilder)
BuildRequires: mod_perl-devel >= 2.0.0-0.rc5
Requires: httpd-mmn = %(cat $(%{apxs} -q INCLUDEDIR)/.mmn || echo ERROR)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Provides: libapreq = %{version}-%{release}
%description
libapreq is a shared library with associated modules for manipulating
client request data via the Apache API. Functionality includes
parsing of application/x-www-form-urlencoded and multipart/form-data
content, as well as HTTP cookies.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: httpd-devel >= 2.0.48
Provides: libapreq-devel = %{version}-%{release}
%description devel
%{summary}.
%package -n perl-%{name}
Summary: Perl interface to the Apache HTTP request library
Group: Development/Libraries
Requires: mod_perl >= 2.0.0-0.rc5
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Provides: perl-libapreq = %{version}-%{release}
%description -n perl-%{name}
This package contains a Perl interface to the Apache HTTP request
library.
%prep
%setup -q -n %{name}-%{version}-rc1
cd ..
rm -f %{name}-%{version}
ln -s %{name}-%{version}-rc1 %{name}-%{version}
cd %{name}-%{version}
# Filter unversioned provides for which there's a versioned one in perl-*:
cat << \EOF > %{name}-perl-prov
#!/bin/sh
%{__perl_provides} $* \
| grep -v 'perl(APR::\(Request\(::\(Apache2\|CGI\|Error\)\)\?\))$' \
| grep -v 'perl(Apache2::\(Cookie\|Request\|Upload\))$'
EOF
%define __perl_provides %{_builddir}/%{name}-%{version}/%{name}-perl-prov
chmod +x %{__perl_provides}
# Fix up paths in doc tag files:
# ap*-1-config in FC5, ap*-config in earlier
aprver=$(apr-1-config --version || apr-config --version)
apuver=$(apu-1-config --version || apu-config --version)
%{__perl} -pi -e \
"s|<path>.*?</path>|<path>%{_docdir}/%{name}-devel-%{version}/</path>|" \
docs/apreq2.tag
%{__perl} -pi -e \
"s|<path>.*?</path>|<path>%{_docdir}/apr-devel-$aprver/html/</path>|" \
docs/apr.tag
%{__perl} -pi -e \
"s|<path>.*?</path>|<path>%{_docdir}/apr-util-devel-$apuver/html/</path>|" \
docs/apu.tag
%patch0
%patch1
%{__perl} -pi -e 's|/usr/lib|%{_libdir}|' apreq2-config.in # patch1 ~ multilib
./buildconf
%build
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
%configure \
--disable-dependency-tracking \
--disable-static \
--with-apache2-apxs=%{apxs} \
--enable-perl-glue \
--with-mm-opts=INSTALLDIRS=vendor
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT __docs
make install DESTDIR=$RPM_BUILD_ROOT
install -Dpm 644 %{SOURCE1} \
$RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/apreq.conf
cp -pR docs/html __docs ; rm __docs/installdox
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name '*.bs' -a -size 0 -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name '*.la' -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type d -depth -exec rmdir {} 2>/dev/null ';'
chmod -R u+w $RPM_BUILD_ROOT/*
%check
# make test # requires write access to system locations?
%clean
rm -f $RPM_BUILD_ROOT/../%{name}-%{version}
rm -rf $RPM_BUILD_ROOT
%post
/sbin/ldconfig
[ $1 -eq 1 ] && %{_initrddir}/httpd condrestart >/dev/null || :
%postun
/sbin/ldconfig
%{_initrddir}/httpd condrestart >/dev/null || :
%files
%defattr(-,root,root,-)
%doc CHANGES LICENSE NOTICE README
%config(noreplace) %{_sysconfdir}/httpd/conf.d/apreq.conf
%{_libdir}/libapreq2.so.*
%{_libdir}/httpd/modules/mod_apreq2.so
%files devel
%defattr(-,root,root,-)
%doc STATUS __docs/* docs/*.tag
%{_bindir}/apreq2-config
%{_includedir}/apreq2/
%{_includedir}/httpd/apreq2/
%{_libdir}/libapreq2.so
%files -n perl-%{name}
%defattr(-,root,root,-)
%doc glue/perl/README
%{perl_vendorarch}/auto/APR/
%{perl_vendorarch}/APR/
%{perl_vendorarch}/Apache2/
%{_mandir}/man3/A*::*.3*
%changelog
* Sat Sep 09 2006 Bojan Smojver <bojan at rexursive.com> - 2.09-0.rc1.2
- re-tag
* Sat Sep 09 2006 Bojan Smojver <bojan at rexursive.com> - 2.09-0.rc1.1
- bump up to 2.09-rc1
* Fri Aug 11 2006 Bojan Smojver <bojan at rexursive.com> - 2.08-1
- bump up to 2.08
* Mon Aug 07 2006 Bojan Smojver <bojan at rexursive.com> - 2.08-0.rc5.1
- bump up to 2.08-RC5
* Fri Jul 21 2006 Bojan Smojver <bojan at rexursive.com> - 2.08-0.rc4.1
- bump up to 2.08-RC4
* Mon Jul 10 2006 Bojan Smojver <bojan at rexursive.com> - 2.08-0.rc3.1
- bump up to 2.08-RC3
* Thu Jun 01 2006 Bojan Smojver <bojan at rexursive.com> - 2.08-0.rc2.3
- include exisiting CFLAGS too
* Thu Jun 01 2006 Bojan Smojver <bojan at rexursive.com> - 2.08-0.rc2.2
- add -fno-strict-aliasing to CFLAGS (prevent endless loop)
* Tue May 23 2006 Bojan Smojver <bojan at rexursive.com> - 2.08-0.rc2.1
- bump up to 2.08-RC2 for Rawhide
- revert back some changes to spec file made for 2.08-RC1
* Fri May 19 2006 Bojan Smojver <bojan at rexursive.com> - 2.08-0.rc1.1
- bump up to 2.08-RC1 for Rawhide
* Wed Mar 01 2006 Bojan Smojver <bojan at rexursive.com> - 2.07-1.1
- rebuild
* Mon Feb 13 2006 Bojan Smojver <bojan at rexursive.com> - 2.07-1
- bump up to 2.07
* Fri Feb 03 2006 Bojan Smojver <bojan at rexursive.com> - 2.07-0.2.rc4
- re-tag for rebuild
* Fri Feb 03 2006 Bojan Smojver <bojan at rexursive.com> - 2.07-0.1.rc4
- bump up to 2.07-rc4
* Sat Dec 10 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.07-0.2.rc3
- Filter unversioned perl(*) provides for which a versioned one exists.
* Thu Dec 8 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.07-0.1.rc3
- Adapt to new apr, httpd.
- Don't print -L for standard dirs in apreq2-config --link-ld output.
* Sun Oct 16 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.07-0.rc3
- 2.07-rc3.
* Sat Oct 15 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.07-0.rc2
- 2.07-rc2.
* Fri Aug 5 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.06-2
- Include *.tag files in -devel docs, thanks to Bojan Smojver.
- Remove *.la instead of using %%exclude.
* Thu Jul 21 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.06-1
- 2.06.
* Tue Jul 19 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.06-0.2.rc4
- 2.06-dev-rc4.
* Sat Jul 16 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.06-0.2.rc3
- 2.06-dev-rc3.
* Wed Jul 13 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.06-0.2.rc2
- 2.06-dev-rc2.
* Sun Jul 10 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.06-0.1.rc1
- 2.06-dev-rc1.
- Improve summaries and descriptions.
* Wed Jun 29 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.05-0.6
- Rebuild with mod_perl 2.0.1.
- Drop static libs.
* Sat Jun 18 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.05-0.5
- Rebuild for FC4.
* Tue May 24 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.05-0.4
- Require httpd-mmn.
* Sat May 21 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.05-0.3
- Rebuild with mod_perl 2.0.0.
* Wed May 18 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.05-0.2
- Prevent %%post from failing at first install if httpd is not running.
- Provide (perl-)libapreq(-devel).
* Thu May 5 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.05-0.1
- 2.05-dev, aclocal patch applied upstream.
* Sat Dec 4 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:2.04_03-0.fdr.2
- Buildrequire mod_perl-devel, not mod_perl.
* Wed Aug 18 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:2.03_04-0.fdr.1
- Update to 2.03_04.
- Disable dependency tracking to speed up the build.
* Thu May 27 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:2.03-0.fdr.1
- First build.