summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-10-10 00:51:15 +0200
committerMichael Adam <obnox@samba.org>2009-10-10 00:58:55 +0200
commit1fda61b5a0301344e174b58ce49b29abd9ab6127 (patch)
treefdc72c7072fe537a0350fe6722a3b561b9286400 /etc
parent641e5823c0116ab358d07aa9568ef5fcddb584cd (diff)
downloadtinyproxy-1fda61b5a0301344e174b58ce49b29abd9ab6127.tar.gz
tinyproxy-1fda61b5a0301344e174b58ce49b29abd9ab6127.zip
generate etc/tinyproxy.conf from a tinyproxy.conf.in template
This is a first cut at providing a tinyproxy.conf file with more useful default or example directories. It uses datadir, sysconfdir and localstatedir. Because automake is a little special here, this template can not simply be processed by configure (AC_CONFIG_FILES(...)), as these variables can only be used like this in makefiles. Instead, we need a little sed-processor in the Makfile in etc/. Michael
Diffstat (limited to 'etc')
-rw-r--r--etc/Makefile.am15
-rw-r--r--etc/tinyproxy.conf.in (renamed from etc/tinyproxy.conf)20
2 files changed, 25 insertions, 10 deletions
diff --git a/etc/Makefile.am b/etc/Makefile.am
index 5e8b370..9282d1b 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -3,3 +3,18 @@ sysconf_DATA = \
EXTRA_DIST = \
$(sysconf_DATA)
+
+edit = sed \
+ -e 's|@bindir[@]|$(bindir)|g' \
+ -e 's|@datadir[@]|$(datadir)|g' \
+ -e 's|@datarootdir[@]|$(datarootdir)|g' \
+ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
+ -e 's|@localstatedir[@]|$(localstatedir)|g' \
+ -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
+ -e 's|@prefix[@]|$(prefix)|g'
+
+tinyproxy.conf: tinyproxy.conf.in
+ rm -f $@ $@.tmp
+ $(edit) $@.in >$@.tmp
+ mv $@.tmp $@
+
diff --git a/etc/tinyproxy.conf b/etc/tinyproxy.conf.in
index 3eaa9ed..1bc2eaa 100644
--- a/etc/tinyproxy.conf
+++ b/etc/tinyproxy.conf.in
@@ -56,25 +56,25 @@ Timeout 600
# /usr/share/tinyproxy
# /etc/tinyproxy
#
-#ErrorFile 404 "/usr/share/tinyproxy/404.html"
-#ErrorFile 400 "/usr/share/tinyproxy/400.html"
-#ErrorFile 503 "/usr/share/tinyproxy/503.html"
-#ErrorFile 403 "/usr/share/tinyproxy/403.html"
-#ErrorFile 408 "/usr/share/tinyproxy/408.html"
+#ErrorFile 404 "@datadir@/404.html"
+#ErrorFile 400 "@datadir@/400.html"
+#ErrorFile 503 "@datadir@/503.html"
+#ErrorFile 403 "@datadir@/403.html"
+#ErrorFile 408 "@datadir@/408.html"
#
# DefaultErrorFile: The HTML file that gets sent if there is no
# HTML file defined with an ErrorFile keyword for the HTTP error
# that has occured.
#
-DefaultErrorFile "/usr/share/tinyproxy/default.html"
+DefaultErrorFile "@datadir@/default.html"
#
# StatFile: The HTML file that gets sent when a request is made
# for the stathost. If this file doesn't exist a basic page is
# hardcoded in tinyproxy.
#
-StatFile "/usr/share/tinyproxy/stats.html"
+StatFile "@datadir@/stats.html"
#
# Logfile: Allows you to specify the location where information should
@@ -82,7 +82,7 @@ StatFile "/usr/share/tinyproxy/stats.html"
# and enable the Syslog directive. These directives are mutually
# exclusive.
#
-Logfile "/var/log/tinyproxy.log"
+Logfile "@localstatedir@/log/tinyproxy.log"
#
# Syslog: Tell tinyproxy to use syslog instead of a logfile. This
@@ -112,7 +112,7 @@ LogLevel Info
# PidFile: Write the PID of the main tinyproxy thread to this file so it
# can be used for signalling purposes.
#
-PidFile "/var/run/tinyproxy.pid"
+PidFile "@localstatedir@/run/tinyproxy.pid"
#
# XTinyproxy: Tell Tinyproxy to include the X-Tinyproxy header, which
@@ -210,7 +210,7 @@ ViaProxyName "tinyproxy"
#
# Filter: This allows you to specify the location of the filter file.
#
-#Filter "/etc/tinyproxy/filter"
+#Filter "@sysconfdir@/filter"
#
# FilterURLs: Filter based on URLs rather than domains.