aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorale <ale@FreeBSD.org>2004-05-05 18:22:37 +0800
committerale <ale@FreeBSD.org>2004-05-05 18:22:37 +0800
commit08113c1a0b63acab0a4cd86e3a23f88a3823ac8b (patch)
tree6b3ecb0066fb39935c872aa4361a9ffff9e60ada
parentea571a3847d3cfcaae1d3c31ea387677fea7f8e4 (diff)
downloadfreebsd-ports-gnome-08113c1a0b63acab0a4cd86e3a23f88a3823ac8b.tar.gz
freebsd-ports-gnome-08113c1a0b63acab0a4cd86e3a23f88a3823ac8b.tar.zst
freebsd-ports-gnome-08113c1a0b63acab0a4cd86e3a23f88a3823ac8b.zip
Add OPTIONS to disable logging and PHP support.
-rw-r--r--www/pserv/Makefile15
-rw-r--r--www/pserv/files/patch-log.c45
-rw-r--r--www/pserv/files/patch-main.h11
3 files changed, 65 insertions, 6 deletions
diff --git a/www/pserv/Makefile b/www/pserv/Makefile
index 1bbbe6681f42..a49c10076efe 100644
--- a/www/pserv/Makefile
+++ b/www/pserv/Makefile
@@ -21,9 +21,22 @@ WRKSRC= ${WRKDIR}/${PORTNAME}
BUILD_WRKSRC= ${WRKSRC}/sources
USE_REINPLACE= yes
+OPTIONS= LOG "Enable logging" on \
+ PHP "Enable PHP support" on
+
+.include <bsd.port.pre.mk>
+
post-patch:
@${REINPLACE_CMD} "s|%%PREFIX%%|${PREFIX}|g;s|%%LOCALBASE%%|${LOCALBASE}|g" \
${WRKSRC}/defaults/pserv.conf
+.if defined(WITHOUT_LOG)
+ @${REINPLACE_CMD} "s|define LOG|undef LOG|" \
+ ${WRKSRC}/sources/main.h
+.endif
+.if defined(WITHOUT_PHP)
+ @${REINPLACE_CMD} "s|define PHP|undef PHP|" \
+ ${WRKSRC}/sources/main.h
+.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/sources/pserv ${PREFIX}/sbin/
@@ -31,4 +44,4 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/defaults/pserv.conf ${PREFIX}/etc/
${INSTALL_SCRIPT} ${FILESDIR}/pserv.sh ${PREFIX}/etc/rc.d/
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/www/pserv/files/patch-log.c b/www/pserv/files/patch-log.c
new file mode 100644
index 000000000000..0ff9c67e19a7
--- /dev/null
+++ b/www/pserv/files/patch-log.c
@@ -0,0 +1,45 @@
+--- sources/log.c.orig Wed May 5 12:12:12 2004
++++ sources/log.c Wed May 5 12:04:57 2004
+@@ -20,6 +20,7 @@
+
+ int logFileOpen()
+ {
++#ifdef LOG
+ char timeStr[256];
+ struct tm *timeStruct;
+ time_t timeTemp;
+@@ -37,15 +38,18 @@
+ #ifdef PRINTF_DEBUG
+ printf("Opened Log File.\n");
+ #endif
++#endif
+ return 0;
+ }
+
+ int logFileClose()
+ {
++#ifdef LOG
+ fclose(lf);
+ #ifdef PRINTF_DEBUG
+ printf("Closed Log File.\n");
+ #endif
++#endif
+ return 0;
+ }
+
+@@ -57,6 +61,7 @@
+ struct request req;
+ int code;
+ {
++#ifdef LOG
+ char timeStr[256];
+ struct tm *timeStruct;
+ time_t timeTemp;
+@@ -104,6 +109,7 @@
+ printf ("Unknown event to log! Programming error!\n");
+ }
+ fflush(lf);
++#endif
+ return 0;
+ }
+
diff --git a/www/pserv/files/patch-main.h b/www/pserv/files/patch-main.h
index d5db8f3b8e22..becb85a99092 100644
--- a/www/pserv/files/patch-main.h
+++ b/www/pserv/files/patch-main.h
@@ -1,12 +1,13 @@
--- sources/main.h.orig Sat Dec 20 11:16:21 2003
-+++ sources/main.h Thu Jan 8 12:31:15 2004
-@@ -27,12 +27,13 @@
++++ sources/main.h Wed May 5 12:06:07 2004
+@@ -27,12 +27,14 @@
/* --- CPP parsing options --- */
-#define PRINTF_DEBUG /* enable this to print some debugging messages */
+#undef PRINTF_DEBUG /* enable this to print some debugging messages */
#undef ON_THE_FLY_CONVERSION /* enable this for line ending conversion */
++#define LOG /* enable logging to file */
#define BRAIN_DEAD_CAST /* if your compiler is brainwashed and does not cast standard types.h structures */
#define FORKING_SERVER /* enables to fork for every request */
#define AUTO_INDEX /* enables auto-index of directories */
@@ -15,7 +16,7 @@
/* --- Configure options --- */
-@@ -44,18 +45,19 @@
+@@ -44,18 +46,19 @@
#define MIME_TYPE_DEFAULT "application/octet-stream"
/* configuration file location */
@@ -41,7 +42,7 @@
#define DEFAULT_SERVER_NAME "localhost"
/* amount of connections queued in listening */
-@@ -127,8 +129,10 @@
+@@ -127,8 +130,10 @@
#define ADDRESS_LEN 16
#define METHOD_LEN 16
#define PROTOCOL_LEN 16
@@ -52,7 +53,7 @@
/* the maximum path name of your system should be available in MAXNAMLEN
defined in dirent.h. If not, set a reasonable value like 1024 */
-@@ -143,7 +147,9 @@
+@@ -143,7 +148,9 @@
char protocolVersion[PROTOCOL_LEN+1];
int keepAlive;
char userAgent[USER_AGENT_LEN+1];