Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 496f69937afa999099b048ae3c5ab64e > files > 4

libapreq2-2.04_03-6mdk.src.rpm

#Module-Specific definitions
%define rversion 2.04_03
%define mod_name mod_apreq
%define mod_conf 76_%{mod_name}.conf
%define mod_so %{mod_name}.so

%define apache_version 2.0.53

%define	major 2
%define libname	%mklibname apreq %{major}

Summary:	Apache Request Library
Name:		%{libname}
Version:	%{rversion}
Release:	%mkrel 6
License:	Apache License
Group:          System/Libraries
URL:		http://httpd.apache.org/apreq/
Source:		libapreq2-%{rversion}-dev.tar.bz2
Source1:	76_mod_apreq.conf.bz2
Patch0:		libapreq2-2.03-dev-version_check_fix.diff.bz2
BuildRequires:	autoconf2.5
BuildRequires:	automake1.7
BuildRequires:	chrpath
BuildRequires:	perl-devel
BuildRequires:	perl-Tie-IxHash
BuildRequires:	perl-ExtUtils-XSBuilder
BuildRequires:	apache2-mod_perl-devel
Prereq:		apache2 = %{apache_version}
Prereq:		apache2-conf
BuildRequires:	apache2-devel >= %{apache_version}
BuildRequires:	apache2-source >= %{apache_version}
BuildRoot:	%{_tmppath}/%{name}-%{version}

%description
libapreq is a safe, standards-compliant, high-performance library used for
parsing HTTP cookies, query-strings and POST data. The original version
(libapreq-1.X) was designed by Lincoln Stein and Doug MacEachern. The perl
APIs Apache::Request and Apache::Cookie are the lightweight mod_perl analogs of
the CGI and CGI::Cookie perl modules.

This package contains the shared libraries for %{name}

%package -n	%{libname}-devel
Summary:	Development library and header files for the Apache Request Library
Version:	%{rversion}
Group:		Development/C
Requires:	%{libname} = %{version}-%{release}
Provides:	libapreq-devel

%description -n	%{libname}-devel
libapreq is a safe, standards-compliant, high-performance library used for
parsing HTTP cookies, query-strings and POST data. The original version
(libapreq-1.X) was designed by Lincoln Stein and Doug MacEachern. The perl
APIs Apache::Request and Apache::Cookie are the lightweight mod_perl analogs of
the CGI and CGI::Cookie perl modules.

This package contains the development library and its header files.

%package -n	perl-libapreq2
Summary:	Apache Request Library Perl Glue
Version:	%{rversion}
Group:		System/Servers
Requires:	apache2-mod_perl

%description -n perl-libapreq2
libapreq is a safe, standards-compliant, high-performance library used for
parsing HTTP cookies, query-strings and POST data. The original version
(libapreq-1.X) was designed by Lincoln Stein and Doug MacEachern. The perl
APIs Apache::Request and Apache::Cookie are the lightweight mod_perl analogs of
the CGI and CGI::Cookie perl modules.

%package -n	apache2-%{mod_name}
Summary:	Mod_%{rname} is a DSO module for the apache2 Web server
Version:	%{apache_version}_%{rversion}
Group:		System/Servers
Requires:	apache2 = %{apache_version}
Requires:	apache2-conf
Requires:	perl-libapreq2 = %{rversion}

%description -n	apache2-%{mod_name}
Mod_%{name} is a DSO module for the apache2 Web server.

%prep

%setup -q -n libapreq2-2.04-dev
%patch0 -p0

# got the idea why this wasn't working from debian, thanks guys!
# P0 combined with this hack fixes it all...
perl -pi -e "s|_APACHE2_REAL_VERSION_|%{apache_version}|g" build/version_check.pl

bzcat %{SOURCE1} > %{mod_conf}

%build
export WANT_AUTOCONF_2_5=1
libtoolize --copy --force; aclocal-1.7; autoconf; automake-1.7 --add-missing

%configure2_5x \
    --with-apache2-apxs=%{_sbindir}/apxs2

# hose the Makefile to not run apxs
grep -v -e 'apxs.*mod_apreq\.la' env/Makefile > env/Makefile.hosed
mv -f env/Makefile.hosed env/Makefile
%make

# Build the perl modules
pushd glue/perl
    %{__perl} ../../build/xsbuilder.pl run
    CFLAGS="%{optflags}" %{__perl} Makefile.PL -apxs %{_sbindir}/apxs2 INSTALLDIRS=vendor
    %make
    mv Makefile Makefile.xx
popd

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%makeinstall_std

# install the module
install -d %{buildroot}%{_libdir}/apache2
install -d %{buildroot}%{_libdir}/apache2-extramodules
libtool --mode=install install env/mod_apreq.la %{buildroot}%{_libdir}/apache2/
mv %{buildroot}%{_libdir}/apache2/%{mod_so} %{buildroot}%{_libdir}/apache2-extramodules/

# install module conf files for the "conf.d" dir loading structure
install -d %{buildroot}%{_sysconfdir}/httpd/conf.d
install -m0640 %{mod_conf} %{buildroot}%{_sysconfdir}/httpd/conf.d/

# install one extra devel file
install -m0755 apreq*-config %{buildroot}%{_bindir}/

# install the perl stuff
pushd glue/perl
cp Makefile.xx Makefile
%makeinstall_std
popd

# nuke rpath
chrpath -d %{buildroot}%{perl_vendorlib}/*/Apache2/auto/Apache/Cookie/Cookie.so
chrpath -d %{buildroot}%{perl_vendorlib}/*/Apache2/auto/Apache/Request/Request.so
chrpath -d %{buildroot}%{perl_vendorlib}/*/Apache2/auto/Apache/Upload/Upload.so

# fix docs
rm -rf html
cp -rp docs/html .
rm html/installdox
chmod 644 html/*

# install man files
install -d %{buildroot}%{_mandir}/man3
install -m0644 docs/man/man3/* %{buildroot}%{_mandir}/man3/

# cleanup
rm -rf %{buildroot}%{_libdir}/apache2

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%post -n apache2-%{mod_name}
if [ -e %{_sbindir}/ADVXctl ]; then %{_sbindir}/ADVXctl update;fi

%postun -n apache2-%{mod_name}
if [ -e %{_sbindir}/ADVXctl ]; then %{_sbindir}/ADVXctl update;fi

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files -n %{libname}
%defattr(-,root,root)
%doc CHANGES INSTALL PREREQUISITES README
%{_libdir}/libapreq*.so.*

%files -n %{libname}-devel
%defattr(-,root,root)
%doc CHANGES INSTALL PREREQUISITES README html
%{_bindir}/apreq*-config
%{_libdir}/libapreq*.so
%{_libdir}/libapreq*.la
%{_libdir}/libapreq*.a
%{_includedir}/apreq*

%files -n apache2-%{mod_name}
%defattr(-,root,root)
%doc CHANGES INSTALL PREREQUISITES README
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{mod_conf}
%attr(0755,root,root) %{_libdir}/apache2-extramodules/%{mod_so}

%files -n perl-libapreq2
%defattr(-,root,root)
%doc CHANGES INSTALL PREREQUISITES README
%{perl_vendorlib}/*/Apache2/auto/Apache/Cookie
%{perl_vendorlib}/*/Apache2/auto/Apache/Request
%{perl_vendorlib}/*/Apache2/auto/Apache/Upload
%{perl_vendorlib}/*/Apache2/Apache/*
%{_mandir}/man3/*

%changelog
* Sun Mar 20 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.04_03-6mdk
- use the %%mkrel macro

* Fri Feb 18 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.04_03-5mdk
- spec file cleanups, remove the ADVX-build stuff

* Wed Feb 09 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.04_03-4mdk
- rebuilt for apache 2.0.53

* Fri Feb  4 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.04_03-3mdk
- rebuilt against new openldap libs

* Tue Dec 07 2004 Rafael Garcia-Suarez <rgarciasuarez@mandrakesoft.com> 2.04_03-2mdk
- Rebuild for new perl
- Remove MANIFEST files

* Fri Sep 03 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.04_03-1mdk
- 2.04_03

* Tue Aug 10 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.03_04-3mdk
- rebuilt

* Sun Aug 01 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.03_04-2mdk
- rebuilt for apache 2.0.50

* Mon Jun 21 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.03_04-1mdk
- initial mandrake package based on the spec file by Bojan Smojver