summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElan Ruusamäe2011-12-22 15:40:29 (GMT)
committercvs2git2012-06-24 12:13:13 (GMT)
commite27d3d4fd339b86bdb98391c12af93e02009761d (patch)
treebcf89fd8d8219494dd931160da3b96d91909766a
parent70256a6a56dc3b14cfabfbd0bb04543902f59a36 (diff)
downloadapache1-mod_rpaf-e27d3d4fd339b86bdb98391c12af93e02009761d.zip
apache1-mod_rpaf-e27d3d4fd339b86bdb98391c12af93e02009761d.tar.gz
- run tests
Changed files: apache1-mod_rpaf.spec -> 1.28 tests.patch -> 1.1
-rw-r--r--apache1-mod_rpaf.spec36
-rw-r--r--tests.patch55
2 files changed, 83 insertions, 8 deletions
diff --git a/apache1-mod_rpaf.spec b/apache1-mod_rpaf.spec
index bae4414..bd57c84 100644
--- a/apache1-mod_rpaf.spec
+++ b/apache1-mod_rpaf.spec
@@ -1,29 +1,43 @@
#
# Conditional build:
%bcond_without ipv6 # disable IPv6 support
-#
+%bcond_without tests # do not perform "make test"
+
%define mod_name rpaf
%define apxs %{_sbindir}/apxs1
Summary: Reverse proxy add forward module for Apache
Summary(pl.UTF-8): Moduł Apache'a dodający przekazywanie dla odwrotnych proxy
Name: apache1-mod_%{mod_name}
Version: 0.6
-Release: 1
+Release: 2
License: Apache
Group: Networking/Daemons
Source0: http://stderr.net/apache/rpaf/download/mod_rpaf-%{version}.tar.gz
# Source0-md5: ba2b89274e1dd4c0f96f8d034fa305b1
Source1: %{name}.conf
Patch0: mod_rpaf_degtine.patch
+Patch1: tests.patch
URL: http://stderr.net/apache/rpaf/
-%{?with_ipv6:BuildRequires: apache1(ipv6)-devel}
BuildRequires: apache1-devel >= 1.3.39
BuildRequires: rpmbuild(macros) >= 1.268
-%{!?with_ipv6:BuildConflicts: apache1(ipv6)-devel}
Requires: apache1(EAPI)
-%{?with_ipv6:Requires: apache1(ipv6)}
Provides: apache(mod_rpaf)
-%{!?with_ipv6:Conflicts: apache1(ipv6)}
+%if %{with ipv6}
+BuildRequires: apache1(ipv6)-devel
+Requires: apache1(ipv6)
+%else
+BuildConflicts: apache1(ipv6)-devel
+Conflicts: apache1(ipv6)
+%endif
+%if %{with tests}
+BuildRequires: apache1-base
+BuildRequires: apache1-mod_alias
+BuildRequires: apache1-mod_cgi
+BuildRequires: apache1-mod_log_config
+BuildRequires: apache1-mod_mime
+BuildRequires: apache1-mod_rewrite
+BuildRequires: perl-libwww
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
@@ -52,16 +66,22 @@ od wersji 1.3.25.
%setup -qc
mv mod_%{mod_name}-%{version}/* .
%patch0 -p1
+%patch1 -p1
%build
%{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
+%if %{with tests}
+ln -sf %{_libdir}/apache1 modules
+%{__make} test
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
-install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/99_mod_%{mod_name}.conf
+install -p mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/99_mod_%{mod_name}.conf
%clean
rm -rf $RPM_BUILD_ROOT
diff --git a/tests.patch b/tests.patch
new file mode 100644
index 0000000..4e40512
--- /dev/null
+++ b/tests.patch
@@ -0,0 +1,55 @@
+--- apache1-mod_rpaf-0.6/gen_tests.sh 2007-12-13 05:40:22.000000000 +0200
++++ apache1-mod_rpaf-0.6-tests/gen_tests.sh 2011-12-22 17:22:21.742653887 +0200
+@@ -1,23 +1,21 @@
+ #!/bin/sh
+ PATH=$PATH:/home/thomas/build/apache-dev/bin
+ DIRECTORY=`pwd`/t
+-HTTPD=`which httpd`
+-HTTPD2=`which apache2`
++HTTPD=`which /usr/sbin/apache 2>/dev/null`
++APACHE2=`which /usr/sbin/httpd 2>/dev/null`
+
+-cat test-Makefile-template | sed -s "s|\@\@HTTPD\@\@|$HTTPD|" | sed -s "s|\@\@HTTPD2\@\@|$HTTPD2|" > t/Makefile
++cat test-Makefile-template | sed -s "s|\@\@HTTPD\@\@|$HTTPD|" | sed -s "s|\@\@HTTPD2\@\@|$APACHE2|" > t/Makefile
+
+
+-if [ "$HTTPD" != "" ]; then
++if [ -x "$HTTPD" ]; then
+ echo "Found httpd as $HTTPD"
+ echo "Creating test configuration for apache 1.3.x"
+ echo "in directory $DIRECTORY"
+ cat httpd-rpaf.conf-template | sed -s "s|\@\@DIR\@\@|$DIRECTORY|" > t/httpd-rpaf.conf
+ fi
+
+-APACHE2=`which apache2`
+-
+-if [ "$APACHE2" != "" ]; then
+- echo "Found apache2 as $HTTPD"
++if [ -x "$APACHE2" ]; then
++ echo "Found apache2 as $APACHE2"
+ echo "Creating test configuration for apache 2.x.x"
+ echo "in directory $DIRECTORY"
+ cat httpd-rpaf.conf-template-2.0 | sed -s "s|\@\@DIR\@\@|$DIRECTORY|" > t/httpd-rpaf.conf-2.0
+--- apache1-mod_rpaf-0.6/httpd-rpaf.conf-template 2008-01-01 05:03:15.000000000 +0200
++++ apache1-mod_rpaf-0.6-tests/httpd-rpaf.conf-template 2011-12-22 17:36:42.348061324 +0200
+@@ -1,10 +1,18 @@
+ ServerType standalone
+ PidFile httpd.pid
+-Port 2500
+-ServerName 127.0.0.1
++
++#Port 2500
++#ServerName 127.0.0.1
++Listen 127.0.0.1 2500
++
+ #ServerRoot @@DIR@@
+ DocumentRoot @@DIR@@/htdocs/
+ ErrorLog rpaf-error_log
++LoadModule alias_module ../modules/mod_alias.so
++LoadModule cgi_module ../modules/mod_cgi.so
++LoadModule mime_module ../modules/mod_mime.so
++LoadModule rewrite_module ../modules/mod_rewrite.so
++LoadModule log_config_module ../modules/mod_log_config.so
+ LoadModule rpaf_module ../mod_rpaf.so
+ ScriptAlias /cgi-bin @@DIR@@/htdocs/cgi-bin
+ TypesConfig /dev/null