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
This commit is contained in:
Michael Adam 2009-10-10 00:51:15 +02:00
parent 641e5823c0
commit 1fda61b5a0
2 changed files with 25 additions and 10 deletions

View File

@ -3,3 +3,18 @@ sysconf_DATA = \
EXTRA_DIST = \ EXTRA_DIST = \
$(sysconf_DATA) $(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 $@

View File

@ -56,25 +56,25 @@ Timeout 600
# /usr/share/tinyproxy # /usr/share/tinyproxy
# /etc/tinyproxy # /etc/tinyproxy
# #
#ErrorFile 404 "/usr/share/tinyproxy/404.html" #ErrorFile 404 "@datadir@/404.html"
#ErrorFile 400 "/usr/share/tinyproxy/400.html" #ErrorFile 400 "@datadir@/400.html"
#ErrorFile 503 "/usr/share/tinyproxy/503.html" #ErrorFile 503 "@datadir@/503.html"
#ErrorFile 403 "/usr/share/tinyproxy/403.html" #ErrorFile 403 "@datadir@/403.html"
#ErrorFile 408 "/usr/share/tinyproxy/408.html" #ErrorFile 408 "@datadir@/408.html"
# #
# DefaultErrorFile: The HTML file that gets sent if there is no # DefaultErrorFile: The HTML file that gets sent if there is no
# HTML file defined with an ErrorFile keyword for the HTTP error # HTML file defined with an ErrorFile keyword for the HTTP error
# that has occured. # 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 # 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 # for the stathost. If this file doesn't exist a basic page is
# hardcoded in tinyproxy. # hardcoded in tinyproxy.
# #
StatFile "/usr/share/tinyproxy/stats.html" StatFile "@datadir@/stats.html"
# #
# Logfile: Allows you to specify the location where information should # 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 # and enable the Syslog directive. These directives are mutually
# exclusive. # exclusive.
# #
Logfile "/var/log/tinyproxy.log" Logfile "@localstatedir@/log/tinyproxy.log"
# #
# Syslog: Tell tinyproxy to use syslog instead of a logfile. This # 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 # PidFile: Write the PID of the main tinyproxy thread to this file so it
# can be used for signalling purposes. # 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 # 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: 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. # FilterURLs: Filter based on URLs rather than domains.