diff -urN apt-cacher-0.7.orig/etc/apt-cacher/apache.conf apt-cacher-0.7/etc/apt-cacher/apache.conf
--- apt-cacher-0.7.orig/etc/apt-cacher/apache.conf 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/etc/apt-cacher/apache.conf 2004-04-14 11:58:34.000000000 +0200
@@ -1,6 +1,6 @@
-Alias /apt-cacher /usr/share/apt-cacher/apt-cacher.pl
+Alias /apt-cacher @PREFIX@/share/apt-cacher/apt-cacher.pl
-
+
Options ExecCGI
AddHandler cgi-script .pl
AllowOverride None
diff -urN apt-cacher-0.7.orig/etc/apt-cacher/apt-cacher.conf apt-cacher-0.7/etc/apt-cacher/apt-cacher.conf
--- apt-cacher-0.7.orig/etc/apt-cacher/apt-cacher.conf 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/etc/apt-cacher/apt-cacher.conf 2004-04-14 11:58:22.000000000 +0200
@@ -5,7 +5,7 @@
# cache_dir is used to set the location of the local cache. This can
# become quite large, so make sure it is somewhere with plenty of space.
-cache_dir=/var/cache/apt-cacher
+cache_dir=@PREFIX@/var/cache/apt-cacher
# The email address of the administrator is displayed in the info page
# and traffic reports.
@@ -36,7 +36,7 @@
# Note that the old 'logfile' and 'errorfile' directives are
# deprecated: if you set them explicitly they will be honoured, but it's
# better to just get rid of them from old config files.
-logdir=/var/log/apt-cacher
+logdir=@PREFIX@/var/log/apt-cacher
# At present apt-cacher has a problem telling if package lists have
# been updated on the server. This directive tells it how long to
diff -urN apt-cacher-0.7.orig/etc/cron.daily/apt-cacher apt-cacher-0.7/etc/cron.daily/apt-cacher
--- apt-cacher-0.7.orig/etc/cron.daily/apt-cacher 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/etc/cron.daily/apt-cacher 2004-04-14 11:58:02.000000000 +0200
@@ -1,12 +1,12 @@
#!/bin/sh
# Only do anything if apt-cacher is actually installed
-if [ ! -x /usr/share/apt-cacher/apt-cacher.pl ]; then
+if [ ! -x @PREFIX@/share/apt-cacher/apt-cacher.pl ]; then
exit 0
fi
# Run the report generator
-/usr/share/apt-cacher/apt-cacher-report.pl >/dev/null
+@PREFIX@/share/apt-cacher/apt-cacher-report.pl >/dev/null
# Run the cache cleaner
-/usr/share/apt-cacher/apt-cacher-cleanup.pl >/dev/null
\ No newline at end of file
+@PREFIX@/share/apt-cacher/apt-cacher-cleanup.pl >/dev/null
diff -urN apt-cacher-0.7.orig/etc/logrotate.d/apt-cacher apt-cacher-0.7/etc/logrotate.d/apt-cacher
--- apt-cacher-0.7.orig/etc/logrotate.d/apt-cacher 2004-02-04 00:37:31.000000000 +0100
+++ apt-cacher-0.7/etc/logrotate.d/apt-cacher 2004-04-14 11:57:42.000000000 +0200
@@ -1,4 +1,4 @@
-/var/log/apt-cacher/*.log {
+@PREFIX@/var/log/apt-cacher/*.log {
monthly
missingok
rotate 12
diff -urN apt-cacher-0.7.orig/share/apt-cacher/apt-cacher-cleanup.pl apt-cacher-0.7/share/apt-cacher/apt-cacher-cleanup.pl
--- apt-cacher-0.7.orig/share/apt-cacher/apt-cacher-cleanup.pl 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/share/apt-cacher/apt-cacher-cleanup.pl 2004-04-14 11:57:39.000000000 +0200
@@ -12,10 +12,10 @@
#############################################################################
### configuration ###########################################################
# Include the library for the config file parser
-require '/usr/share/apt-cacher/apt-cacher-lib.pl';
+require '@PREFIX@/share/apt-cacher/apt-cacher-lib.pl';
# Read in the config file and set the necessary variables
-my $configfile = '/etc/apt-cacher/apt-cacher.conf';
+my $configfile = '@PREFIX@/etc/apt-cacher/apt-cacher.conf';
my $configref;
eval {
diff -urN apt-cacher-0.7.orig/share/apt-cacher/apt-cacher-import.pl apt-cacher-0.7/share/apt-cacher/apt-cacher-import.pl
--- apt-cacher-0.7.orig/share/apt-cacher/apt-cacher-import.pl 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/share/apt-cacher/apt-cacher-import.pl 2004-04-14 11:56:45.000000000 +0200
@@ -29,10 +29,10 @@
#############################################################################
### configuration ###########################################################
# Include the library for the config file parser
-require '/usr/share/apt-cacher/apt-cacher-lib.pl';
+require '@PREFIX@/share/apt-cacher/apt-cacher-lib.pl';
# Read in the config file and set the necessary variables
-my $configfile = '/etc/apt-cacher/apt-cacher.conf';
+my $configfile = '@PREFIX@/etc/apt-cacher/apt-cacher.conf';
my $configref;
eval {
@@ -106,7 +106,7 @@
}
# Change file ownership back to www-data
-`chown -R www-data:www-data $config{cache_dir}`;
+`chown -R www:www $config{cache_dir}`;
print "Done.\n";
print "Packages imported: $packagesimported\n";
diff -urN apt-cacher-0.7.orig/share/apt-cacher/apt-cacher-lib.pl apt-cacher-0.7/share/apt-cacher/apt-cacher-lib.pl
--- apt-cacher-0.7.orig/share/apt-cacher/apt-cacher-lib.pl 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/share/apt-cacher/apt-cacher-lib.pl 2004-04-14 11:57:13.000000000 +0200
@@ -12,8 +12,8 @@
{
# set the default config variables
my $config = {
- cache_dir => '/var/log/cache/apt-cacher',
- logdir => '/var/log/apt-cacher',
+ cache_dir => '@PREFIX@/var/log/cache/apt-cacher',
+ logdir => '@PREFIX@/var/log/apt-cacher',
admin_email => 'root@localhost',
generate_reports => 0,
expire_hours => 36,
diff -urN apt-cacher-0.7.orig/share/apt-cacher/apt-cacher-report.pl apt-cacher-0.7/share/apt-cacher/apt-cacher-report.pl
--- apt-cacher-0.7.orig/share/apt-cacher/apt-cacher-report.pl 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/share/apt-cacher/apt-cacher-report.pl 2004-04-14 11:55:43.000000000 +0200
@@ -11,10 +11,10 @@
#############################################################################
### configuration ###########################################################
# Include the library for the config file parser
-require '/usr/share/apt-cacher/apt-cacher-lib.pl';
+require '@PREFIX@/share/apt-cacher/apt-cacher-lib.pl';
# Read in the config file and set the necessary variables
-my $configfile = '/etc/apt-cacher/apt-cacher.conf';
+my $configfile = '@PREFIX@/etc/apt-cacher/apt-cacher.conf';
my $configref;
eval {
diff -urN apt-cacher-0.7.orig/share/apt-cacher/apt-cacher.pl apt-cacher-0.7/share/apt-cacher/apt-cacher.pl
--- apt-cacher-0.7.orig/share/apt-cacher/apt-cacher.pl 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/share/apt-cacher/apt-cacher.pl 2004-04-14 11:55:01.000000000 +0200
@@ -167,10 +167,10 @@
my $path = $ENV{PATH_INFO};
# Include the library for the config file parser
-require '/usr/share/apt-cacher/apt-cacher-lib.pl';
+require '@PREFIX@/share/apt-cacher/apt-cacher-lib.pl';
# Read in the config file and set the necessary variables
-my $configfile = '/etc/apt-cacher/apt-cacher.conf';
+my $configfile = '@PREFIX@/etc/apt-cacher/apt-cacher.conf';
my $configref;
eval {
diff -urN apt-cacher-0.7.orig/share/apt-cacher/install.pl apt-cacher-0.7/share/apt-cacher/install.pl
--- apt-cacher-0.7.orig/share/apt-cacher/install.pl 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/share/apt-cacher/install.pl 2004-04-14 11:53:08.000000000 +0200
@@ -15,10 +15,10 @@
#############################################################################
### configuration ###########################################################
# Include the library for the config file parser
-require '/usr/share/apt-cacher/apt-cacher-lib.pl';
+require '@PREFIX@/share/apt-cacher/apt-cacher-lib.pl';
# Read in the config file and set the necessary variables
-my $configfile = '/etc/apt-cacher/apt-cacher.conf';
+my $configfile = '@PREFIX@/etc/apt-cacher/apt-cacher.conf';
my $configref;
eval {
@@ -73,63 +73,33 @@
# At the moment we need to create empty access and error logs so apt-cacher
# doesn't barf the first time it's run. Probably should change apt-cacher
# so it can handle missing logs, and create them itself if required.
-`chown www-data.www-data $config{logdir}`;
+`chown www:www $config{logdir}`;
`touch $config{logfile}`;
-`chown www-data.www-data $config{logfile}`;
+`chown www:www $config{logfile}`;
`touch $config{errorfile}`;
-`chown www-data.www-data $config{errorfile}`;
+`chown www:www $config{errorfile}`;
# These ownership changes are a cludge: need to make them check httpd.conf for the Apache
# user and set ownership to that, and do it with Perl instead of shell
-`chown -R www-data.www-data $config{cache_dir}`;
+`chown -R www:www $config{cache_dir}`;
# Define the include directive that will be added to httpd.conf
-my $config_line = "\n# This line has been appended by the Apt-cacher install script\nInclude /etc/apt-cacher/apache.conf";
+my $config_line = "\n# This line has been appended by the Apt-cacher install script\nInclude @PREFIX@/etc/apt-cacher/apache.conf";
# Tack the include line onto the end of Apache's httpd.conf and restart Apache.
# This *should* check first to see whether the include line already exists.
-if(-f "/etc/apache/httpd.conf" ) {
- open(APACHEFILE,">>/etc/apache/httpd.conf") or die;
+if(-f "@PREFIX@/etc/apache2/httpd.conf" ) {
+ open(APACHEFILE,">>@PREFIX@/etc/apache2/httpd.conf") or die;
print APACHEFILE "$config_line\n";
close APACHEFILE;
- if ( -f "/etc/init.d/apache" ) {
+ if ( -f "@PREFIX@/sbin/apachectl" ) {
print "Restarting Apache (if you have an SSL cert password, enter it now):";
- `/etc/init.d/apache restart`;
+ `@PREFIX@/sbin/apachectl -k stop`;
+ `@PREFIX@/sbin/apachectl -k start`;
print "... done.\n";
} else {
print "Apache startup script was not found. Please restart Apache manually.\n";
}
}
-# Tack the include line onto the end of Apache-SSL's httpd.conf and restart Apache-SSL.
-# This *should* check first to see whether the include line already exists.
-if(-f "/etc/apache-ssl/httpd.conf" ) {
- open(APACHEFILE,">>/etc/apache-ssl/httpd.conf") or die;
- print APACHEFILE "$config_line\n";
- close APACHEFILE;
- if ( -f "/etc/init.d/apache-ssl" ) {
- print "Restarting Apache-SSL (if you have an SSL cert password, enter it now):";
- `/etc/init.d/apache-ssl restart`;
- print "... done.\n";
- } else {
- print "Apache-SSL startup script was not found. Please restart Apache-SSL manually.\n";
- }
-}
-
-# Tack the include line onto the end of Apache2's apache2.conf and restart Apache2.
-# This *should* check first to see whether the include line already exists.
-if(-f "/etc/apache2/apache2.conf" ) {
- open(APACHEFILE,">>/etc/apache2/apache2.conf") or die;
- print APACHEFILE "$config_line\n";
- close APACHEFILE;
- if ( -f "/etc/init.d/apache2" ) {
- print "Restarting Apache2 (if you have an SSL cert password, enter it now):";
- `/etc/init.d/apache2 restart`;
- print "... done.\n";
- } else {
- print "Apache2 startup script was not found. Please restart Apache2 manually.\n";
- }
-}
-
-
exit(0);
diff -urN apt-cacher-0.7.orig/share/apt-cacher/remove.pl apt-cacher-0.7/share/apt-cacher/remove.pl
--- apt-cacher-0.7.orig/share/apt-cacher/remove.pl 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/share/apt-cacher/remove.pl 2004-04-14 11:50:07.000000000 +0200
@@ -9,10 +9,10 @@
#############################################################################
### configuration ###########################################################
# Include the library for the config file parser
-require '/usr/share/apt-cacher/apt-cacher-lib.pl';
+require '@PREFIX@/share/apt-cacher/apt-cacher-lib.pl';
# Read in the config file and set the necessary variables
-my $configfile = '/etc/apt-cacher/apt-cacher.conf';
+my $configfile = '@PREFIX@/etc/apt-cacher/apt-cacher.conf';
my $configref;
eval {
@@ -43,7 +43,7 @@
# Remove the include lines from Apache's httpd.conf
# This should really be turned into a function so I don't have to
# copy the whole lot for Apache-SSL!
-my $httpdconf = "/etc/apache/httpd.conf";
+my $httpdconf = "@PREFIX@/etc/apache2/httpd.conf";
if (-f $httpdconf) {
$old = $httpdconf;
$new = "$httpdconf.tmp.$$";
@@ -54,7 +54,7 @@
while () {
s/# This line has been appended by the Apt\-cacher install script/ /;
- s/Include \/etc\/apt\-cacher\/apache.conf/ /;
+ s/Include .*\/etc\/apt\-cacher\/apache.conf/ /;
(print NEW $_) or die "can't write to $new: $!";
}
@@ -65,85 +65,16 @@
rename($new, $old) or die "can't rename $new to $old: $!";
# Restart Apache
- if ( -f "/etc/init.d/apache" ) {
+ if ( -f "@PREFIX@/sbin/apachectl" ) {
print "Restarting Apache (if you have an SSL cert password, enter it now):";
- `/etc/init.d/apache restart`;
+ `@PREFIX@/sbin/apachectl -k stop`;
+ `@PREFIX@/sbin/apachectl -k start`;
print "... done.\n";
} else {
print "Apache startup script was not found. Please restart Apache manually.\n";
}
}
-# Remove the include lines from Apache-SSL's httpd.conf
-# This should really be turned into a function so I don't have to
-# copy the whole lot for Apache-SSL!
-$httpdconf = "/etc/apache-ssl/httpd.conf";
-if (-f $httpdconf) {
- $old = $httpdconf;
- $new = "$httpdconf.tmp.$$";
- $bak = "$httpdconf.bak";
-
- open(OLD, "< $old") or die "can't open $old: $!";
- open(NEW, "> $new") or die "can't open $new: $!";
-
- while () {
- s/# This line has been appended by the Apt\-cacher install script/ /;
- s/Include \/etc\/apt\-cacher\/apache.conf/ /;
- (print NEW $_) or die "can't write to $new: $!";
- }
-
- close(OLD) or die "can't close $old: $!";
- close(NEW) or die "can't close $new: $!";
-
- rename($old, $bak) or die "can't rename $old to $bak: $!";
- rename($new, $old) or die "can't rename $new to $old: $!";
-
- # Restart Apache-SSL
- if ( -f "/etc/init.d/apache-ssl" ) {
- print "Restarting Apache-SSL (if you have an SSL cert password, enter it now):";
- `/etc/init.d/apache-ssl restart`;
- print "... done.\n";
- } else {
- print "Apache-SSL startup script was not found. Please restart Apache-SSL manually.\n";
- }
-}
-
-# Remove the include lines from Apache2's apache2.conf
-# This should really be turned into a function so I don't have to
-# copy the whole lot for Apache-SSL!
-$httpdconf = "/etc/apache2/apache2.conf";
-if (-f $httpdconf) {
- $old = $httpdconf;
- $new = "$httpdconf.tmp.$$";
- $bak = "$httpdconf.bak";
-
- open(OLD, "< $old") or die "can't open $old: $!";
- open(NEW, "> $new") or die "can't open $new: $!";
-
- while () {
- s/# This line has been appended by the Apt\-cacher install script/ /;
- s/Include \/etc\/apt\-cacher\/apache.conf/ /;
- (print NEW $_) or die "can't write to $new: $!";
- }
-
- close(OLD) or die "can't close $old: $!";
- close(NEW) or die "can't close $new: $!";
-
- rename($old, $bak) or die "can't rename $old to $bak: $!";
- rename($new, $old) or die "can't rename $new to $old: $!";
-
- # Restart Apache2
- if ( -f "/etc/init.d/apache2" ) {
- print "Restarting Apache2 (if you have an SSL cert password, enter it now):";
- `/etc/init.d/apache2 restart`;
- print "... done.\n";
- } else {
- print "Apache2 startup script was not found. Please restart Apache2 manually.\n";
- }
-}
-
-
-
# Delete the cache directory and everything in it
system("rm -rf $config{cache_dir}");
diff -urN apt-cacher-0.7.orig/share/apt-cacher/upgrade.pl apt-cacher-0.7/share/apt-cacher/upgrade.pl
--- apt-cacher-0.7.orig/share/apt-cacher/upgrade.pl 2004-02-04 00:37:29.000000000 +0100
+++ apt-cacher-0.7/share/apt-cacher/upgrade.pl 2004-04-14 11:47:03.000000000 +0200
@@ -13,10 +13,10 @@
#############################################################################
### configuration ###########################################################
# Include the library for the config file parser
-require '/usr/share/apt-cacher/apt-cacher-lib.pl';
+require '@PREFIX@/share/apt-cacher/apt-cacher-lib.pl';
# Read in the config file and set the necessary variables
-my $configfile = '/etc/apt-cacher/apt-cacher.conf';
+my $configfile = '@PREFIX@/etc/apt-cacher/apt-cacher.conf';
my $configref;
eval {
@@ -47,7 +47,7 @@
# Remove the include lines from Apache's httpd.conf
# This should really be turned into a function so I don't have to
# copy the whole lot for Apache-SSL!
-my $httpdconf = "/etc/apache/httpd.conf";
+my $httpdconf = "@PREFIX@/etc/apache2/httpd.conf";
if (-f $httpdconf) {
$old = $httpdconf;
$new = "$httpdconf.tmp.$$";
@@ -58,7 +58,7 @@
while () {
s/# This line has been appended by the Apt\-cacher install script/ /;
- s/Include \/etc\/apt\-cacher\/apache.conf/ /;
+ s/Include .*\/etc\/apt\-cacher\/apache.conf/ /;
(print NEW $_) or die "can't write to $new: $!";
}
@@ -69,56 +69,13 @@
rename($new, $old) or die "can't rename $new to $old: $!";
## Restart Apache
- #if ( -f "/etc/init.d/apache" ) {
+ #if ( -f "@PREFIX@/etc/init.d/apache" ) {
# print "Restarting Apache (if you have an SSL cert password, enter it now):";
- # `/etc/init.d/apache restart`;
+ # `@PREFIX@/etc/init.d/apache restart`;
# print "... done.\n";
#} else {
# print "Apache startup script was not found. Please restart Apache manually.\n";
#}
}
-# Remove the include lines from Apache-SSL's httpd.conf
-# This should really be turned into a function so I don't have to
-# copy the whole lot for Apache-SSL!
-$httpdconf = "/etc/apache-ssl/httpd.conf";
-if (-f $httpdconf) {
- $old = $httpdconf;
- $new = "$httpdconf.tmp.$$";
- $bak = "$httpdconf.bak";
-
- open(OLD, "< $old") or die "can't open $old: $!";
- open(NEW, "> $new") or die "can't open $new: $!";
-
- while () {
- s/# This line has been appended by the Apt\-cacher install script/ /;
- s/Include \/etc\/apt\-cacher\/apache.conf/ /;
- (print NEW $_) or die "can't write to $new: $!";
- }
-
- close(OLD) or die "can't close $old: $!";
- close(NEW) or die "can't close $new: $!";
-
- rename($old, $bak) or die "can't rename $old to $bak: $!";
- rename($new, $old) or die "can't rename $new to $old: $!";
-
- ## Restart Apache-SSL
- #if ( -f "/etc/init.d/apache-ssl" ) {
- # print "Restarting Apache-SSL (if you have an SSL cert password, enter it now):";
- # `/etc/init.d/apache-ssl restart`;
- # print "... done.\n";
- #} else {
- # print "Apache-SSL startup script was not found. Please restart Apache-SSL manually.\n";
- #}
-}
-
-
-## Delete the cache directory and everything in it
-#system("rm -rf $config{cache_dir}");
-#
-## Delete the two log files (leaving the directory behind for now)
-#unlink($config{logfile});
-#unlink($config{errorfile});
-#unlink($config{reportfile});
-
exit(0);