1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
Source: libapache-mod-proxy-add-forward
Section: web
Priority: extra
Maintainer: Piotr Roszatycki <dexter@debian.org>
Standards-Version: 3.5.0
Upstream-Source: <URL:http://develooper.com/code/mpaf/>
Description: module for Apache which includes 'X-Forwarded-For' header
Origin: Debian
Copyright: .
"THE FOO LICENSE" (Revision 3.14159265358979323844):
.
<ask@netcetera.dk> wrote this file. As long as you retain this
notice you can do whatever you want with this stuff. If it does
anything you didn't want it to do, it is of course your own fault.
If we meet some day, and you think this stuff is worth it, you
can buy me a beer in return. - Ask Bjoern Hansen.
Major-Changes:
none
Build-Depends: apache-dev
Build: sh
CC=gcc
EXTRA_CFLAGS="-O2 -Wall"
if [ "${DEB_BUILD_OPTIONS#*debug}" != "$DEB_BUILD_OPTIONS" ]; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -g"
fi
make -f debian/mod_proxy_add_forward.mk EXTRA_CFLAGS="$EXTRA_CFLAGS" CC="$CC"
Clean: sh
make -f debian/mod_proxy_add_forward.mk clean || true
Package: libapache-mod-proxy-add-forward
Architecture: any
Depends: ${apache:Depends}, []
Description: Module for Apache which includes 'X-Forwarded-For' header
This module adds a 'X-Forwarded-For' header to outgoing proxy requests
like Squid does.
.
You can then get the client IP back on the proxied host by setting
r->connection->remote_ip from this header. It's very useful for the
common lightweight frontend/heavy backend mod_perl setup.
Install: sh
yada install -lib -into /usr/lib/apache/1.3 mod_proxy_add_forward.so
yada install -data -into /usr/lib/apache/1.3 debian/500proxy_add_forward.info
yada dpkg-shlibdeps
echo "apache:Depends=apache-common (>= $(dpkg -s apache-dev|grep ^Version|sed 's/^Version: //'))" \
>> debian/substvars
Postinst: bash
# This script is called as the last step of the installation of the
# package. All the package's files are in place, dpkg has already done
# its automatic conffile handling, and all the packages we depend of
# are already fully installed and configured.
.
# This function may enable our module.
enable () {
[ -f /etc/apache/httpd.conf ] || exit 0
if grep '^LoadModule.*mod_proxy_add_forward\.so' /etc/apache/httpd.conf 2>&1 >/dev/null
then
return 0
fi
echo -n "A new Apache module has been installed. Reconfigure apache [Y/n]? "
read CONFIG
if [ ".$CONFIG" == ".n" -o ".$CONFIG" == ".N" ]
then
return 0
fi
[ -x /usr/sbin/apacheconfig ] && /usr/sbin/apacheconfig --force-modules
return 0
}
.
# Restart apache if user wants.
ask_restart () {
echo -n "An Apache module has been modified. Restart apache [Y/n]? "
read CONFIG
if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ]
then
/usr/sbin/apachectl restart
fi
}
.
case "$1" in
configure)
# Configure this package. If the package must prompt the user for
# information, do it here. There are three sub-cases.
:
if test "${2+set}" != set; then
# We're being installed by an ancient dpkg which doesn't remember
# which version was most recently configured, or even whether
# there is a most recently configured version.
enable
:
elif test -z "$2" -o "$2" = "<unknown>"; then
# The package has not ever been configured on this system, or was
# purged since it was last configured.
# DJ: So let's enable the module!
enable
:
else
# Version $2 is the most recently configured version of this
# package.
ask_restart
:
fi ;;
abort-upgrade | abort-remove | abort-deconfigure)
:
;;
*) echo "$0: didn't understand being called with \`$1'" 1>&2
exit 1;;
esac
Postrm: bash
# function to comment us out in httpd.conf
killconf () {
tmpfile=/etc/apache/httpd.conf.tmp.$$
cat /etc/apache/httpd.conf |\
sed 's/^\(LoadModule.*mod_proxy_add_forward\.so\)/# \1/' > $tmpfile
mv -f $tmpfile /etc/apache/httpd.conf
ask_restart
}
.
# Restart apache if user wants.
ask_restart () {
echo -n "An Apache module has been modified. Restart apache [Y/n]? "
read CONFIG
if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ]
then
/usr/sbin/apachectl restart || true
fi
}
.
# This script is called twice during the removal of the package; once
# after the removal of the package's files from the system, and as
# the final step in the removal of this package, after the package's
# conffiles have been removed.
.
case "$1" in
remove)
# This package has been removed, but its configuration has not yet
# been purged.
killconf
:
;;
purge | disappear | upgrade | failed-upgrade | abort-upgrade)
:
;;
abort-install)
# Back out of an attempt to install this package. Undo the effects of
# "preinst install...". There are two sub-cases.
killconf
:
;;
*) echo "$0: didn't understand being called with \`$1'" 1>&2
exit 1;;
esac
|