[packages/apache-mod_rpaf] up to 0.8.4 - new homepage, new maintainer, license asl-2.0 - note config directives got renamed

glen glen at pld-linux.org
Fri Sep 11 15:15:08 CEST 2015


commit df25b1c40be67bf9b61b200ec6211e37e47cb72e
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Sep 11 16:13:58 2015 +0300

    up to 0.8.4
    - new homepage, new maintainer, license asl-2.0
    - note config directives got renamed

 apache-mod_rpaf-apache24.patch | 37 --------------------
 apache-mod_rpaf.conf           | 10 +++---
 apache-mod_rpaf.spec           | 46 +++++++++----------------
 mod_rpaf_degtine.patch         | 76 ------------------------------------------
 4 files changed, 21 insertions(+), 148 deletions(-)
---
diff --git a/apache-mod_rpaf.spec b/apache-mod_rpaf.spec
index 70633b6..82317d1 100644
--- a/apache-mod_rpaf.spec
+++ b/apache-mod_rpaf.spec
@@ -1,61 +1,45 @@
 %define		mod_name	rpaf
 %define		apxs		%{_sbindir}/apxs
-Summary:	Reverse proxy add forward module for Apache2
+Summary:	Reverse proxy add forward module for Apache
 Summary(pl.UTF-8):	Moduł Apache'a 2 dodający przekazywanie dla odwrotnych proxy
 Name:		apache-mod_%{mod_name}
-Version:	0.6
-Release:	3
-License:	Apache
+Version:	0.8.4
+Release:	1
+License:	Apache v2.0
 Group:		Networking/Daemons/HTTP
-Source0:	http://stderr.net/apache/rpaf/download/mod_%{mod_name}-%{version}.tar.gz
-# Source0-md5:	ba2b89274e1dd4c0f96f8d034fa305b1
+Source0:	https://github.com/gnif/mod_rpaf/archive/v%{version}/mod_%{mod_name}-%{version}.tar.gz
+# Source0-md5:	8fbd9ee19f8ea4e25ab8414685276105
 Source1:	%{name}.conf
-Patch0:		mod_rpaf_degtine.patch
-Patch1:		apache-mod_rpaf-apache24.patch
-URL:		http://stderr.net/apache/rpaf/
+URL:		https://github.com/gnif/mod_rpaf/
 BuildRequires:	apache-devel >= 2.2
 BuildRequires:	rpmbuild(macros) >= 1.268
 Requires:	apache(modules-api) = %apache_modules_api
-Conflicts:	apache(mod_extract_forwarded)
 Provides:	apache(mod_rpaf)
+Conflicts:	apache(mod_extract_forwarded)
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		_pkglibdir	%(%{apxs} -q LIBEXECDIR 2>/dev/null)
 %define		_sysconfdir	%(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
 
 %description
-rpaf is for backend Apache servers what mod_proxy_add_forward is for
-frontend Apache servers. It does excactly the opposite of
-mod_proxy_add_forward written by Ask Bjoern Hansen. It will also work
-with mod_proxy that is distributed with Apache2 from version 2.0.36.
-
-%description -l en.UTF-8
-rpaf is for backend Apache servers what mod_proxy_add_forward is for
-frontend Apache servers. It does excactly the opposite of
-mod_proxy_add_forward written by Ask Bjørn Hansen. It will also work
-with mod_proxy that is distributed with Apache2 from version 2.0.36.
+Sets REMOTE_ADDR, HTTPS, and HTTP_PORT to the values provided by an
+upstream proxy.
 
 %description -l pl.UTF-8
 rpaf jest dla backendowych serwerów Apache tym, czym
-mod_proxy_add_forward jest dla frontendowych. Wykonuje dokładnie
-przeciwne operacje do mod_proxy_add_forward napisanego przez Aska
-Bjorna Hansena. Będzie także działać z mod_proxy w Apache'u 2
-począwszy od wersji 2.0.36.
+mod_proxy_add_forward jest dla frontendowych.
 
 %prep
 %setup -q -n mod_%{mod_name}-%{version}
-%patch0 -p1
-mv -f mod_%{mod_name}{-2.0,}.c
-%patch1 -p1
 
 %build
-%{apxs} -S CC="%{__cc}" -c -n mod_%{mod_name}.o mod_%{mod_name}.c
+%{apxs} -S CC="--tag=CC %{__cc}" -c -n mod_%{mod_name}.o mod_%{mod_name}.c
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
-install .libs/mod_rpaf.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/99_mod_%{mod_name}.conf
+install -p .libs/mod_rpaf.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/99_mod_%{mod_name}.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -70,6 +54,6 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc README CHANGES
+%doc README.md CHANGES
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
 %attr(755,root,root) %{_pkglibdir}/*.so
diff --git a/apache-mod_rpaf-apache24.patch b/apache-mod_rpaf-apache24.patch
deleted file mode 100644
index 11a2cba..0000000
--- a/apache-mod_rpaf-apache24.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- mod_rpaf-0.6/mod_rpaf.c.orig	2013-05-05 21:59:10.551469220 +0200
-+++ mod_rpaf-0.6/mod_rpaf.c	2013-05-05 22:00:23.974802023 +0200
-@@ -147,8 +147,8 @@
- 
- static apr_status_t rpaf_cleanup(void *data) {
-     rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)data;
--    rcr->r->connection->remote_ip   = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip);
--    rcr->r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->remote_ip);
-+    rcr->r->connection->client_ip   = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip);
-+    rcr->r->useragent_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->client_ip);
-     return APR_SUCCESS;
- }
- 
-@@ -171,7 +171,7 @@
-     if (!cfg->enable)
-         return DECLINED;
- 
--    if (is_in_array(r->connection->remote_ip, cfg->proxy_ips) == 1) {
-+    if (is_in_array(r->connection->client_ip, cfg->proxy_ips) == 1) {
-         /* check if cfg->headername is set and if it is use
-            that instead of X-Forwarded-For by default */
-         if (cfg->headername && (fwdvalue = apr_table_get(r->headers_in, cfg->headername))) {
-@@ -190,11 +190,11 @@
-                 if (*fwdvalue != '\0')
-                     ++fwdvalue;
-             }
--            rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->remote_ip);
-+            rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->client_ip);
-             rcr->r = r;
-             apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null);
--            r->connection->remote_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips));
--            r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip);
-+            r->connection->client_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips));
-+            r->useragent_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->client_ip);
-             if (cfg->sethostname) {
-                 const char *hostvalue;
-                 if (hostvalue = apr_table_get(r->headers_in, "X-Forwarded-Host")) {
diff --git a/apache-mod_rpaf.conf b/apache-mod_rpaf.conf
index 6274345..e302c3b 100644
--- a/apache-mod_rpaf.conf
+++ b/apache-mod_rpaf.conf
@@ -1,18 +1,20 @@
-# $Id$
 LoadModule rpaf_module modules/mod_rpaf.so
 
 # mod_rpaf - reverse proxy add forward
+#
+# See documentation for configuration directives:
+# https://github.com/gnif/mod_rpaf#configuration-directives
 <IfModule mod_rpaf.c>
 
 # Enable reverse proxy add forward
-#RPAFenable On
+#RPAF_enable On
 
 # which ips are forwarding requests to us
-#RPAFproxy_ips 127.0.0.1 10.0.0.1
+#RPAF_ProxyIPs 127.0.0.1 10.0.0.1
 
 # let rpaf update vhost settings 
 # allows to have the same hostnames as in the "real"
 # configuration for the forwarding Apache
-#RPAFsethostname Off
+#RPAF_SetHostName Off
 
 </IfModule>
diff --git a/mod_rpaf_degtine.patch b/mod_rpaf_degtine.patch
deleted file mode 100644
index 4aa63dd..0000000
--- a/mod_rpaf_degtine.patch
+++ /dev/null
@@ -1,76 +0,0 @@
---- mod_rpaf-0.6/mod_rpaf-2.0.c	2008-01-01 05:05:40.000000000 +0200
-+++ mod_rpaf-0.6-degtine/mod_rpaf-2.0.c	2008-01-14 12:47:44.248571877 +0200
-@@ -152,6 +152,16 @@
-     return APR_SUCCESS;
- }
- 
-+static char* last_not_in_array(apr_array_header_t *forwarded_for,
-+			       apr_array_header_t *proxy_ips) {
-+    int i;
-+    for (i = (forwarded_for->nelts)-1; i > 0; i--) {
-+	if (!is_in_array(((char **)forwarded_for->elts)[i], proxy_ips))
-+	    break;
-+    }
-+    return ((char **)forwarded_for->elts)[i];
-+}
-+
- static int change_remote_ip(request_rec *r) {
-     const char *fwdvalue;
-     char *val;
-@@ -183,7 +193,7 @@
-             rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->remote_ip);
-             rcr->r = r;
-             apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null);
--            r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]);
-+            r->connection->remote_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips));
-             r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip);
-             if (cfg->sethostname) {
-                 const char *hostvalue;
---- mod_rpaf-0.6/mod_rpaf.c	2008-01-01 05:03:15.000000000 +0200
-+++ mod_rpaf-0.6-degtine/mod_rpaf.c	2008-01-14 12:47:44.248571877 +0200
-@@ -148,7 +148,25 @@
- static void rpaf_cleanup(void *data) {
-     rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)data;
-     rcr->r->connection->remote_ip   = ap_pstrdup(rcr->r->connection->pool, rcr->old_ip);
-+#ifdef INET6
-+	switch (rcr->r->connection->remote_addr.ss_family) {
-+	case AF_INET:
-+		inet_pton(AF_INET, rcr->r->connection->remote_ip, &((struct sockaddr_in*)&rcr->r->connection->remote_addr)->sin_addr.s_addr);
-+		break;
-+	}
-+#else
-     rcr->r->connection->remote_addr.sin_addr.s_addr = inet_addr(rcr->r->connection->remote_ip);
-+#endif
-+}
-+
-+static char* last_not_in_array(array_header *forwarded_for,
-+			       array_header *proxy_ips) {
-+    int i;
-+    for (i = (forwarded_for->nelts)-1; i > 0; i--) {
-+	if (!is_in_array(((char **)forwarded_for->elts)[i], proxy_ips))
-+	    break;
-+    }
-+    return ((char **)forwarded_for->elts)[i];
- }
- 
- static int change_remote_ip(request_rec *r) {
-@@ -182,8 +200,17 @@
-             rcr->old_ip = ap_pstrdup(r->connection->pool, r->connection->remote_ip);
-             rcr->r = r;
-             ap_register_cleanup(r->pool, (void *)rcr, rpaf_cleanup, ap_null_cleanup);
--            r->connection->remote_ip = ap_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]);
--            r->connection->remote_addr.sin_addr.s_addr = inet_addr(r->connection->remote_ip);
-+            r->connection->remote_ip = ap_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips));
-+#ifdef INET6
-+			switch (r->connection->remote_addr.ss_family) {
-+			case AF_INET:
-+				inet_pton(AF_INET, r->connection->remote_ip, &((struct sockaddr_in*)&r->connection->remote_addr)->sin_addr.s_addr);
-+				break;
-+			}
-+#else
-+			r->connection->remote_addr.sin_addr.s_addr = inet_addr(r->connection->remote_ip);
-+#endif
-+
-             if (cfg->sethostname) {
-                 const char *hostvalue;
-                 if (hostvalue = ap_table_get(r->headers_in, "X-Forwarded-Host")) {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/apache-mod_rpaf.git/commitdiff/df25b1c40be67bf9b61b200ec6211e37e47cb72e



More information about the pld-cvs-commit mailing list