From: Emmanuel Lacour Date: Sat, 13 Oct 2007 14:27:23 +0000 (+0000) Subject: [svn-inject] Applying Debian modifications to trunk X-Git-Tag: 2.4.3-2 X-Git-Url: http://git.home-dn.net/?p=manu%2Fmod-proxy-html.git;a=commitdiff_plain;h=e23d1bdf874c2af6d7ab54fa834da653cc75c6cc;hp=748cf57ecbfa96be512de7454769e36f172ec40b [svn-inject] Applying Debian modifications to trunk --- diff --git a/config.html b/config.html index 1317a3e..fbbfedd 100644 --- a/config.html +++ b/config.html @@ -143,12 +143,4 @@ size and avoid the need to resize the buffer dynamically during a request. - + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..58f63a0 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,19 @@ +mod-proxy-html (2.4.3-2) unstable; urgency=low + + * mod_proxy_html.c: use new apache regex definitions, closes: #297912 + + -- Emmanuel Lacour Wed, 23 Mar 2005 13:00:22 +0000 + +mod-proxy-html (2.4.3-1) unstable; urgency=medium + + * debian/conf/proxy_html.load: fix libxml2 filename, closes: #283272 + * New upstream release + + -- Emmanuel Lacour Mon, 29 Nov 2004 09:11:20 +0100 + +mod-proxy-html (2.4.1-1) unstable; urgency=low + + * Initial Release, closes: #278006 + + -- Emmanuel Lacour Sun, 24 Oct 2004 06:17:25 +0200 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +4 diff --git a/debian/conf/proxy_html.load b/debian/conf/proxy_html.load new file mode 100644 index 0000000..b4699c8 --- /dev/null +++ b/debian/conf/proxy_html.load @@ -0,0 +1,2 @@ +LoadFile /usr/lib/libxml2.so.2 +LoadModule proxy_html_module /usr/lib/apache2/modules/mod_proxy_html.so diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..bfc9f40 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: mod-proxy-html +Section: web +Priority: optional +Maintainer: Emmanuel Lacour +Build-Depends: debhelper (>= 4.0.0), apache2-prefork-dev (>> 2.0.53), libxml2-dev (>> 2.5.10) +Standards-Version: 3.6.1 + +Package: libapache2-mod-proxy-html +Architecture: any +Depends: ${shlibs:Depends}, apache2, libxml2 (>> 2.5.10) +Description: Apache2 filter module for HTML links rewriting + mod_proxy_html is an output filter to rewrite HTML links in a proxy + situation, to ensure that links work for users outside the proxy. It + serves the same purpose as Apache's ProxyPassReverse directive does for + HTTP headers, and is an essential component of a reverse proxy. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..a9b5dab --- /dev/null +++ b/debian/copyright @@ -0,0 +1,26 @@ +This package was debianized by Emmanuel Lacour on +Sun, 24 Oct 2004 06:17:25 +0200. + +It was downloaded from http://apache.webthing.com/mod_proxy_html/ + +Upstream Author: Nick Kew + +Copyright (c) 2003-4, WebThing Ltd + +License: + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +see /usr/share/common-licenses/GPL for all details. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..59d28be --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +/usr/lib/apache2/modules +/etc/apache2/mods-available diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..3a0c4da --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +config.html +guide.html diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..1ef61ee --- /dev/null +++ b/debian/install @@ -0,0 +1,2 @@ +debian/conf/proxy_html.load /etc/apache2/mods-available/ +.libs/mod_proxy_html.so /usr/lib/apache2/modules/ diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..ccc14b4 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,63 @@ +#! /bin/sh +# postinst script for libapache2-mod-proxy-html +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# + +reload_apache() +{ + if apache2ctl configtest 2>/dev/null; then + invoke-rc.d apache2 force-reload || true + else + echo "Your apache2 configuration is broken, so we're not restarting it for you." + fi +} + + +case "$1" in + configure) + # Reload the module on upgrade if enabled + if [ -n "$2" ]; then + if [ -e /etc/apache2/mods-enabled/proxy_html.load ]; then + reload_apache + fi + else + # Enable the module + if [ -e /etc/apache2/apache2.conf ]; then + a2enmod proxy_html >/dev/null || true + reload_apache + fi + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..f6fbbc6 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,51 @@ +#! /bin/sh +# prerm script for libapache2-mod-proxy-html +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +reload_apache() +{ + if apache2ctl configtest 2>/dev/null; then + invoke-rc.d apache2 force-reload || true + else + echo "Your apache2 configuration is broken, so we're not restarting it for you." + fi +} + + +case "$1" in + remove) + if [ -e /etc/apache2/mods-enabled/proxy_html.load ]; then + a2dismod proxy_html >/dev/null || true + reload_apache + fi + ;; + upgrade|failed-upgrade|deconfigure) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..6d0655a --- /dev/null +++ b/debian/rules @@ -0,0 +1,50 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +build: build-stamp + +build-stamp: + dh_testdir + apxs2 -c -I/usr/include/libxml2 mod_proxy_html.c + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp mod_proxy_html.la mod_proxy_html.lo mod_proxy_html.o mod_proxy_html.slo + rm -rf .libs + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + dh_install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-arch +.PHONY: build clean binary-arch binary install diff --git a/guide.html b/guide.html index 50ffee8..7e7fd69 100644 --- a/guide.html +++ b/guide.html @@ -191,12 +191,4 @@ and after, and possibly in the middle of, a page. To work around this, set the force-response-1.0 environment variable in httpd.conf. For example,
BrowserMatch MSIE force-response-1.0

- + diff --git a/mod_proxy_html.c b/mod_proxy_html.c index dfdbf60..0215cb2 100644 --- a/mod_proxy_html.c +++ b/mod_proxy_html.c @@ -88,7 +88,7 @@ typedef struct urlmap { unsigned int flags ; union { const char* c ; - regex_t* r ; + ap_regex_t* r ; } from ; const char* to ; } urlmap ; @@ -208,7 +208,7 @@ static void dump_content(saxctxt* ctx) { size_t match ; char c = 0 ; int nmatch ; - regmatch_t pmatch[10] ; + ap_regmatch_t pmatch[10] ; char* subs ; size_t len, offs ; #ifndef GO_FASTER @@ -323,7 +323,7 @@ static void pstartElement(void* ctxt, const xmlChar* name, char* found ; saxctxt* ctx = (saxctxt*) ctxt ; size_t nmatch ; - regmatch_t pmatch[10] ; + ap_regmatch_t pmatch[10] ; #ifndef GO_FASTER int verbose = ctx->cfg->verbose ; #endif @@ -580,18 +580,18 @@ static htmlSAXHandlerPtr setupSAX(apr_pool_t* pool) { return sax ; } -static regex_t* seek_meta_ctype ; -static regex_t* seek_charset ; -static regex_t* seek_meta ; +static ap_regex_t* seek_meta_ctype ; +static ap_regex_t* seek_charset ; +static ap_regex_t* seek_meta ; static void proxy_html_child_init(apr_pool_t* pool, server_rec* s) { seek_meta_ctype = ap_pregcomp(pool, "(]*http-equiv[ \t\r\n='\"]*content-type[^>]*>)", - REG_EXTENDED|REG_ICASE) ; + AP_REG_EXTENDED|AP_REG_ICASE) ; seek_charset = ap_pregcomp(pool, "charset=([A-Za-z0-9_-]+)", - REG_EXTENDED|REG_ICASE) ; + AP_REG_EXTENDED|AP_REG_ICASE) ; seek_meta = ap_pregcomp(pool, "]*(http-equiv)[^>]*>", - REG_EXTENDED|REG_ICASE) ; + AP_REG_EXTENDED|AP_REG_ICASE) ; } static xmlCharEncoding sniff_encoding(request_rec* r, const char* cbuf, size_t bytes @@ -603,7 +603,7 @@ static xmlCharEncoding sniff_encoding(request_rec* r, const char* cbuf, size_t b char* encoding = NULL ; char* p ; char* q ; - regmatch_t match[2] ; + ap_regmatch_t match[2] ; unsigned char* buf = (unsigned char*)cbuf ; VERBOSE( ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, @@ -673,7 +673,7 @@ static meta* metafix(request_rec* r, const char* buf /*, size_t bytes*/ const char* q ; char* header ; char* content ; - regmatch_t pmatch[2] ; + ap_regmatch_t pmatch[2] ; char delim ; while ( ! ap_regexec(seek_meta, buf+offs, 2, pmatch, 0) ) { @@ -942,10 +942,10 @@ static const char* set_urlmap(cmd_parms* cmd, void* CFG, newmap->to = apr_pstrdup(cmd->pool, to) ; } else { regflags - = REGFLAG(REG_EXTENDED,flags,'x') - | REGFLAG(REG_ICASE,flags,'i') - | REGFLAG(REG_NOSUB,flags,'n') - | REGFLAG(REG_NEWLINE,flags,'s') + = REGFLAG(AP_REG_EXTENDED,flags,'x') + | REGFLAG(AP_REG_ICASE,flags,'i') + | REGFLAG(AP_REG_NOSUB,flags,'n') + | REGFLAG(AP_REG_NEWLINE,flags,'s') ; newmap->from.r = ap_pregcomp(cmd->pool, from, regflags) ; newmap->to = apr_pstrdup(cmd->pool, to) ;