diff options
author | edwin <edwin@FreeBSD.org> | 2003-01-17 07:19:34 +0000 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2003-01-17 07:19:34 +0000 |
commit | 218731ba0f747e8e758a04491def93f45cbe161a (patch) | |
tree | 3cde19d016553357cfbcc1732f7dd66a3a805b7b /www/mod_v2h | |
parent | 2f94b3b07a50e11cd89eac4258b7fbc662b7ff5f (diff) | |
download | FreeBSD-ports-218731ba0f747e8e758a04491def93f45cbe161a.zip FreeBSD-ports-218731ba0f747e8e758a04491def93f45cbe161a.tar.gz |
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>
Diffstat (limited to 'www/mod_v2h')
-rw-r--r-- | www/mod_v2h/Makefile | 44 | ||||
-rw-r--r-- | www/mod_v2h/distinfo | 1 | ||||
-rw-r--r-- | www/mod_v2h/files/add-module | 61 | ||||
-rw-r--r-- | www/mod_v2h/files/files-Makefile | 26 | ||||
-rw-r--r-- | www/mod_v2h/pkg-comment | 1 | ||||
-rw-r--r-- | www/mod_v2h/pkg-descr | 9 | ||||
-rw-r--r-- | www/mod_v2h/pkg-plist | 4 |
7 files changed, 146 insertions, 0 deletions
diff --git a/www/mod_v2h/Makefile b/www/mod_v2h/Makefile new file mode 100644 index 0000000..72c1787 --- /dev/null +++ b/www/mod_v2h/Makefile @@ -0,0 +1,44 @@ +# ports collection makefile for: mod_v2h +# Date created: 6th May 2002 +# Whom: hikari-chan +# +# $FreeBSD$ +# + +PORTNAME= mod_v2h +PORTVERSION= 2.0 +CATEGORIES= www +MASTER_SITES= http://www.fractal.net/files/ +DISTNAME= mod_v2h + +MAINTAINER= hikari@hikari.org.uk + +BUILD_DEPENDS= ${LOCALBASE}/sbin/httpd:${PORTSDIR}/www/apache2 \ + ${LOCALBASE}/lib/mysql/libmysqlclient.so:${PORTSDIR}/databases/mysql323-client +RUN_DEPENDS= ${LOCALBASE}/sbin/httpd:${PORTSDIR}/www/apache2 \ + ${LOCALBASE}/lib/mysql/libmysqlclient.so:${PORTSDIR}/databases/mysql323-client + +WRKSRC= ${WRKDIR}/$(DISTNAME)-2 +USE_REINPLACE= yes +USE_PERL5_RUN= yes + +post-patch: + ${CP} ${FILESDIR}/add-module ${WRKSRC} + ${CP} ${FILESDIR}/files-Makefile ${WRKSRC}/Makefile + ${REINPLACE_CMD} \ + -e 's,@@PERL@@,${PERL},g' \ + -e 's,@@LOCAL@@,${LOCALBASE},g' \ + ${WRKSRC}/Makefile ${WRKSRC}/add-module + +post-install: + @${ECHO_MSG} "" + @${ECHO_MSG} "===> Stripping ${LOCALBASE}/libexec/apache2/mod_v2h.so" + @${STRIP_CMD} ${LOCALBASE}/libexec/apache2/mod_v2h.so + @${ECHO_MSG} "" + @${ECHO_MSG} "---------------------------------------" + @${ECHO_MSG} "Remember to check the documentation on:" + @${ECHO_MSG} "http://www.fractal.net/mod_v2h.tm" + @${ECHO_MSG} "---------------------------------------" + @${ECHO_MSG} "" + +.include <bsd.port.mk> diff --git a/www/mod_v2h/distinfo b/www/mod_v2h/distinfo new file mode 100644 index 0000000..cbc8cf5 --- /dev/null +++ b/www/mod_v2h/distinfo @@ -0,0 +1 @@ +MD5 (mod_v2h.tar.gz) = 8333be4ea39c043ad0bdfe0950709d64 diff --git a/www/mod_v2h/files/add-module b/www/mod_v2h/files/add-module new file mode 100644 index 0000000..754fc69 --- /dev/null +++ b/www/mod_v2h/files/add-module @@ -0,0 +1,61 @@ +#!@@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 $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"); +} else { + notice("unable to open configuration file"); +} + +} + +sub notice{ + print STDERR "$_[0]\n"; +} + + diff --git a/www/mod_v2h/files/files-Makefile b/www/mod_v2h/files/files-Makefile new file mode 100644 index 0000000..cca2a129 --- /dev/null +++ b/www/mod_v2h/files/files-Makefile @@ -0,0 +1,26 @@ +APXS=${LOCALBASE}/sbin/apxs +PERL=@@PERL@@ +RM=/bin/rm +CP=/bin/cp +MKDIR=/bin/mkdir + +CXX=g++ +CFLAGS+=-shared +EXTRA_INCLUDES+=-I${LOCALBASE}/include/mysql -I${LOCALBASE}/include/apache2 +LIBS+=-lmysqlclient +LDFLAGS+=-L${LOCALBASE}/lib/mysql -Wl,-R,/usr/local/lib/mysql \ +-Wl,-soname,mod_v2h.so + +all: + $(CXX) $(CFLAGS) $(EXTRA_INCLUDES) $(LDFLAGS) $(LIBS) -o mod_v2h.so mod_v2h.cpp + +install: + $(CP) mod_v2h.so ${LOCALBASE}/libexec/apache2/mod_v2h.so + $(PERL) add-module + $(MKDIR) -p ${LOCALBASE}/share/doc/mod_v2h + $(CP) README AUTHORS ${LOCALBASE}/share/doc/mod_v2h/ + +clean: + $(RM) -rf .libs + $(RM) -f mod_v2h.la + diff --git a/www/mod_v2h/pkg-comment b/www/mod_v2h/pkg-comment new file mode 100644 index 0000000..be43322 --- /dev/null +++ b/www/mod_v2h/pkg-comment @@ -0,0 +1 @@ +A mass virtual hosting module for Apache with support diff --git a/www/mod_v2h/pkg-descr b/www/mod_v2h/pkg-descr new file mode 100644 index 0000000..91bb079 --- /dev/null +++ b/www/mod_v2h/pkg-descr @@ -0,0 +1,9 @@ +mod_v2h is a mass virtual hosting module for Apache with support +for referencing translation paths from MySQL. mod_v2h also has +the ability to cache translation rules into a memory image for +faster performance. + +WWW: http://www.fractal.net/mod_v2h.tm + +- hikari-chan +hikari@hikari.org.uk diff --git a/www/mod_v2h/pkg-plist b/www/mod_v2h/pkg-plist new file mode 100644 index 0000000..5b07fe6 --- /dev/null +++ b/www/mod_v2h/pkg-plist @@ -0,0 +1,4 @@ +libexec/apache2/mod_v2h.so +%%PORTDOCS%%share/doc/mod_v2h/AUTHORS +%%PORTDOCS%%share/doc/mod_v2h/README +%%PORTDOCS%%@dirrm share/doc/mod_v2h |