Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37741645
en ru br
ALT Linux repos
S:2.16-alt1
5.0: 2.10-alt0.rc1.1

Group :: System/Servers
RPM: apache2-mod_apreq

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

# Spec file for Apache2 HTTP Server Request Library
# Based on Fedora Core 11

%define real_name    libapreq2
%define real_version 2.10-RC1
%define module_name  apreq
%define version      2.10
%define release      alt0.rc1.1


Name:      apache2-mod_apreq
Version:   %version
Release:   %release

Summary:   Apache2 HTTP request library

License:   Apache Software License v. 2.0
Group:     System/Servers
URL:       http://httpd.apache.org/apreq/
BuildArch: %_target_cpu

Packager:  Nikolay A. Fetisov <naf at altlinux.ru>

Source0:   http://people.apache.org/~bojan/%real_name-%real_version.tar

Source1:   %module_name.conf
Source2:   %module_name.start

Source3:   %real_name.pc.in

Patch0:    %real_name-build.patch
Patch1:    %real_name-2.07-rc3-ldflags.patch
Patch2:    %real_name-2.09-pkgconfig.patch
Patch3:    %real_name-2.10-alt-glue_rpath.patch
Patch4:    %real_name-2.10-alt-apreq2-config.patch

BuildRequires(pre): perl-base >= 5.6.1, perl-devel
BuildRequires(pre): apache2-devel >= 2.2.5
Requires(pre): apache2 >= %apache2_version-%apache2_release
BuildRequires: %(eval echo %apache2_apr_buildreq)

# Automatically added by buildreq on Sun Dec 14 2008

BuildRequires: apache2-httpd-prefork apache2-mod_perl-devel gcc-c++ libexpat-devel perl-ExtUtils-XSBuilder perl-libwww


Provides:      libapreq  = %version
Provides:      libapreq2 = %version

%define common_desc  libapreq  is a shared library with associated modules for manipulating\
client request data via the Apache API.\

%description
%common_desc
Functionality includes parsing of application/x-www-form-urlencoded
and multipart/form-data content,  as well as  HTTP cookies. It also
includes language bindings for Perl (Apache::Request and
Apache::Cookie).


%package        devel
Summary:        Development files for %name
Group:          Development/C
Requires:       %name = %version-%release, apache2-devel
Provides:       %name-devel = %version-%release
Obsoletes:      %name-devel

Provides:       libapreq-devel = %version
Provides:       libapreq2-devel = %version

%description    devel
%common_desc
This file contains files needed for building XS modules that use
libapreq2.

%package        doc
Summary:        Documentation for %name
Group:          System/Servers
BuildArch:      noarch

%description    doc
%common_desc
This file contains documentation for libapreq2.

%package     -n perl-%real_name
Summary:        Perl interface to the Apache HTTP request library
Group:          Development/Perl
Requires:       apache2-mod_perl >= 2.0.0
Provides:       perl-libapreq = %version-%release

%description -n perl-%real_name
%common_desc
This package contains a Perl interface to the Apache HTTP request
library.


# Skip search dependencies in modules with user-defined hooks

%add_findreq_skiplist */APR/Request/*.pm
%add_findreq_skiplist */Apache2/*.pm

%prep
%setup -q -n %real_name-%real_version

%patch0
%patch1
%patch2

%patch3
%patch4

# Fix multilib

/bin/sed -i -e 's,^libdir=.*,libdir=`pkg-config --variable=libdir %real_name`,' \
      -e 's,^LDFLAGS=.*,LDFLAGS=`pkg-config --libs %real_name`,' \
      -e 's,^LIBS=.*,LIBS=`pkg-config --libs %real_name`,' \
      -e 's,^INCLUDES=.*,INCLUDES=`pkg-config --cflags-only-I %real_name`,' \
       apreq2-config.in

/bin/cp -- %SOURCE3 .

/bin/mv -f -- LICENSE LICENSE.orig
/bin/ln -s -- $(relative %_licensedir/Apache-2.0 %_docdir/%name/LICENSE) LICENSE


%build
./buildconf
%autoreconf
%configure \
 --disable-dependency-tracking \
 --disable-static \
 --with-apache2-apxs=%apache2_apxs \
 --with-apr-config=%apache2_apr_config \
 --with-apu-config=%apache2_apu_config \
 --enable-perl-glue \
 --with-mm-opts=INSTALLDIRS=vendor \
 %nil
%make


%install
%make_install install DESTDIR=%buildroot

/bin/mkdir -p -- %buildroot%_libdir/pkgconfig
/bin/install -m 0644 -- %real_name.pc %buildroot%_libdir/pkgconfig

/bin/install -Dpm 0644 -- %SOURCE1 %buildroot%apache2_mods_available/%module_name.load
/bin/install -Dpm 0644 -- %SOURCE2 %buildroot%apache2_mods_start/100-%module_name.conf

# Documentation

/bin/cp -pR -- docs/html __docs
/bin/rm -rf -- __docs/installdox
/bin/cp -pR -- docs/man/man3/*  %buildroot%_man3dir/
/bin/rm -f -- %buildroot%_man3dir/apreq_xs*
/bin/rm -f -- %buildroot%_man3dir/todo*


%post
# Reconfigure Apache2:
%apache2_sbindir/a2chkconfig ||:

if [ -e %apache2_mods_enabled/%module_name.load ]; then
   CONF_OK=0
   %apache2_sbindir/apachectl2 configtest && CONF_OK=1 ||:
   if [ "$CONF_OK" = "1" ]; then
service %apache2_dname condrestart ||:
   else
       echo "Some errors detected in Apache2 configuration!"
echo "To use %real_name check configuration and start %apache2_dname service."
   echo
   fi
else
   echo "Apache2 %real_name module had been installed, but does't enabled."
   echo "Check %apache2_mods_start directory for files with '%module_name=no' lines."
   echo
fi

%preun
if [ "$1" = "0" ] ; then # last uninstall
   [ -e %apache2_mods_enabled/%module_name.load ] && %apache2_sbindir/a2dismod %module_name 2>&1 >/dev/null ||:
fi


%postun
# Reconfigure Apache2:
%apache2_sbindir/a2chkconfig ||:
if [ "$1" = "0" ] ; then # last uninstall
   CONF_OK=0
   %apache2_sbindir/apachectl2 configtest && CONF_OK=1 ||:
   if [ "$CONF_OK" = "1" ]; then
service %apache2_dname condrestart ||:
   else
       echo "Some errors detected in Apache2 configuration!"
echo "To complete %real_name uninstalling check configuration and restart %apache2_dname service."
echo
   fi
fi


%files
%doc CHANGES NOTICE README
%doc --no-dereference LICENSE

%config            %apache2_mods_available/%module_name.load
%config            %apache2_mods_start/100-%module_name.conf

%apache2_moduledir/mod_apreq2.so
%exclude %apache2_moduledir/mod_apreq2.la
%_libdir/libapreq2.so.*


%files devel
%doc STATUS
%_bindir/apreq2-config
%_includedir/apreq2*
%apache2_includedir/apreq2*
%_libdir/libapreq2.so
%_libdir/pkgconfig/*.pc
%_man3dir/apreq*
%_man3dir/libapreq*
%_man3dir/mod_apreq*


%files doc
%doc __docs/* docs/*.tag

%files -n perl-%real_name
%doc glue/perl/README
%perl_vendor_autolib/APR*
%perl_vendor_archlib/APR*
%perl_vendor_archlib/Apache2*
%exclude %_man3dir/*::*


%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin