head	1.3;
access;
symbols
	RELEASE_6_2_0:1.2
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.2
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1;
locks; strict;
comment	@# @;


1.3
date	2006.12.12.15.29.35;	author vd;	state dead;
branches;
next	1.2;

1.2
date	2005.08.02.09.48.31;	author clement;	state Exp;
branches;
next	1.1;

1.1
date	2003.01.17.07.19.34;	author edwin;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Remove expired leaf ports:
2006-12-01 x11/XFree86-aoutlibs: Requires a.out ld.so and support libraries
2006-12-10 x11/linux-XFree86-libs: superseeded by linux-xorg-libs port
2006-12-04 www/mod_v2h: No longer available for download, the website is gone
2006-12-04 www/mod_injection: No longer available for download, the website is gone
@
text
@#!@@@@PERL@@@@

# This was stolen from the Apache apxs script
$CFG_SYSCONFDIR = "@@@@LOCAL@@@@/etc/apache2";
$CFG_TARGET = "httpd";
$name = "v2h";
$dir = "libexec/apache2/";
$t = "mod_v2h.so";

push(@@lmd, sprintf("LoadModule %-18s %s", "${name}_module", "$dir$t"));

open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die("Couldn't open conf file");
my $content = join('', <FP>);
close(FP);

if ($content !~ m|\n#?\s*LoadModule\s+|) {
 error("Activation failed for custom $CFG_SYSCONFDIR/$CFG_TARGET.conf file.");
 error("At least one `LoadModule' directive already has to exist.");
 exit(1);
}

my $lmd;
my $c = '';

foreach $lmd (@@lmd) {
 if ($content !~ m|\n#?\s*$lmd|) {
  $content =~ s|^(.*\n#?\s*LoadModule\s+[^\n]+\n)|$1$c$lmd\n|sg;
 } else {
  $content =~ s|^(.*\n)#?\s*$lmd[^\n]*\n|$1$c$lmd\n|sg;
 }

 $lmd =~ m|LoadModule\s+(.+?)_module.*|;
 notice("[activating module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]");
}

my $amd;

foreach $amd (@@amd) {
 if ($content !~ m|\n#?\s*$amd|) {
  $content =~ s|^(.*\n#?\s*AddModule\s+[^\n]+\n)|$1$c$amd\n|sg;
 } else {
  $content =~ s|^(.*\n)#?\s*$amd[^\n]*\n|$1$c$amd\n|sg;
 }
}

if (@@lmd or @@amd) {
 if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) {
  print FP $content;
  close(FP);
  system("cp $CFG_SYSCONFDIR/$CFG_TARGET.conf.new $CFG_SYSCONFDIR/$CFG_TARGET.conf && " . "rm $CFG_SYSCONFDIR/$CFG_TARGET.conf.new");
} else {
 notice("unable to open configuration file");
}

}

sub notice{
    print STDERR "$_[0]\n";
}


@


1.2
log
@- Don't install httpd.conf.bak

Approved by:	portmgr (self)
@
text
@@


1.1
log
@New port: mod_v2h mass vhosting module for Apache

	mod_v2h is a mass virtual hosting module for Apache, it
	uses mySQL for holding its data.  I needed to install on a
	system, so I figured I might as well write a port for it
	while I was at it :)

PR:		ports/37803
Submitted by:	hikari-chan <hikari@@hikari.org.uk>
@
text
@d50 1
a50 1
  system("cp $CFG_SYSCONFDIR/$CFG_TARGET.conf $CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " . "cp $CFG_SYSCONFDIR/$CFG_TARGET.conf.new $CFG_SYSCONFDIR/$CFG_TARGET.conf && " . "rm $CFG_SYSCONFDIR/$CFG_TARGET.conf.new");
@

