ports/80363: Update www/pserv to 3.2
Vasil Dimov
vd at datamax.bg
Tue Apr 26 13:40:22 UTC 2005
>Number: 80363
>Category: ports
>Synopsis: Update www/pserv to 3.2
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Tue Apr 26 13:40:21 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Vasil Dimov
>Release: FreeBSD 5.4-STABLE i386
>Organization:
DataMax
>Environment:
System: FreeBSD sinanica.bg.datamax 5.4-STABLE FreeBSD 5.4-STABLE #5: Mon Apr 11 14:07:32 EEST 2005 root at sinanica.bg.datamax:/usr/obj/usr/src/sys/SINANICA-SMP i386
>Description:
Update www/pserv from 3.1 to 3.2
* Project has switched to GNU configure, sync our Makefile
* Add two more configurable options to the `make config' menu (as seen
from ./configure --help)
* Remove patch-Makefile
* Sync patch-log.c, patch-main.c, patch-main.h, patch-pserv.conf with
the new source, mainly line number differences
>How-To-Repeat:
>Fix:
--- pserv_update_3.1-3.2.diff begins here ---
diff -urN pserv-3.1/Makefile pserv/Makefile
--- pserv-3.1/Makefile Wed Dec 8 15:03:19 2004
+++ pserv/Makefile Tue Apr 26 12:52:31 2005
@@ -6,23 +6,36 @@
#
PORTNAME= pserv
-PORTVERSION= 3.1
+PORTVERSION= 3.2
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
-EXTRACT_SUFX= .tar.Z
MAINTAINER= ale at FreeBSD.org
COMMENT= A portable and small webserver written in C
-WRKSRC= ${WRKDIR}/${PORTNAME}
-BUILD_WRKSRC= ${WRKSRC}/sources
USE_REINPLACE= yes
OPTIONS= LOG "Enable logging" on \
- PHP "Enable PHP support" on
+ PHP "Enable PHP support" on \
+ PARALLEL "Build parallel server (fork after request)" on \
+ CGI "CGI support" on
+
+GNU_CONFIGURE= yes
.include <bsd.port.pre.mk>
+
+.if defined(WITH_PARALLEL)
+CONFIGURE_ARGS+= --enable-forking
+.else
+CONFIGURE_ARGS+= --disable-forking
+.endif
+
+.if defined(WITH_CGI)
+CONFIGURE_ARGS+= --enable-cgi
+.else
+CONFIGURE_ARGS+= --disable-cgi
+.endif
post-patch:
@${REINPLACE_CMD} "s|%%PREFIX%%|${PREFIX}|g;s|%%LOCALBASE%%|${LOCALBASE}|g" \
diff -urN pserv-3.1/distinfo pserv/distinfo
--- pserv-3.1/distinfo Wed Dec 8 15:03:19 2004
+++ pserv/distinfo Fri Apr 22 17:21:51 2005
@@ -1,2 +1,2 @@
-MD5 (pserv-3.1.tar.Z) = c106d7709bf2a65e9acf16147f2e3a1f
-SIZE (pserv-3.1.tar.Z) = 49511
+MD5 (pserv-3.2.tar.gz) = d20e49388004553f55bb44b025b0e01b
+SIZE (pserv-3.2.tar.gz) = 108399
diff -urN pserv-3.1/files/patch-Makefile pserv/files/patch-Makefile
--- pserv-3.1/files/patch-Makefile Wed Dec 8 15:03:20 2004
+++ pserv/files/patch-Makefile Thu Jan 1 02:00:00 1970
@@ -1,17 +0,0 @@
---- sources/Makefile.orig Fri Nov 5 23:04:15 2004
-+++ sources/Makefile Wed Nov 24 14:52:32 2004
-@@ -1,11 +1,11 @@
- #Change the following to your needs
--CC = gcc
--#insert here flags, eg. optimizations
--CFLAGS = -Wall -Os -pedantic
-+CC ?= gcc
- LIBS =
- SRCS = main.c handlers.c mime.c log.c
- OBJS = main.o handlers.o mime.o log.o
- PROGRAM = pserv
-+
-+all : $(PROGRAM)
-
- $(PROGRAM) : $(OBJS)
- $(CC) -o $(PROGRAM) $(OBJS) $(LIBS)
diff -urN pserv-3.1/files/patch-log.c pserv/files/patch-log.c
--- pserv-3.1/files/patch-log.c Wed May 5 13:22:37 2004
+++ pserv/files/patch-log.c Fri Apr 22 17:38:00 2005
@@ -1,21 +1,23 @@
---- 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 @@
-
+--- sources/log.c.orig Fri Apr 22 17:34:15 2005
++++ sources/log.c Fri Apr 22 17:36:52 2005
+@@ -23,6 +23,7 @@
+ */
int logFileOpen()
{
+#ifdef LOG
char timeStr[256];
struct tm *timeStruct;
time_t timeTemp;
-@@ -37,15 +38,18 @@
+@@ -40,6 +41,7 @@
#ifdef PRINTF_DEBUG
printf("Opened Log File.\n");
#endif
-+#endif
++#endif
return 0;
}
+@@ -47,10 +49,12 @@
+ */
int logFileClose()
{
+#ifdef LOG
@@ -23,11 +25,11 @@
#ifdef PRINTF_DEBUG
printf("Closed Log File.\n");
#endif
-+#endif
++#endif
return 0;
}
-@@ -57,6 +61,7 @@
+@@ -65,6 +69,7 @@
struct request req;
int code;
{
@@ -35,7 +37,7 @@
char timeStr[256];
struct tm *timeStruct;
time_t timeTemp;
-@@ -104,6 +109,7 @@
+@@ -112,6 +117,7 @@
printf ("Unknown event to log! Programming error!\n");
}
fflush(lf);
diff -urN pserv-3.1/files/patch-main.c pserv/files/patch-main.c
--- pserv-3.1/files/patch-main.c Mon Nov 8 18:17:36 2004
+++ pserv/files/patch-main.c Fri Apr 22 17:49:53 2005
@@ -1,5 +1,5 @@
---- sources/main.c.orig Mon Aug 30 13:19:03 2004
-+++ sources/main.c Wed Sep 15 15:03:04 2004
+--- sources/main.c.orig Fri Feb 11 14:25:20 2005
++++ sources/main.c Fri Apr 22 17:47:18 2005
@@ -23,6 +23,7 @@
char defaultFileName[MAX_PATH_LEN+1];
char logFileName[MAX_PATH_LEN+1];
@@ -8,7 +8,7 @@
char cgiRoot[MAX_PATH_LEN+1]; /* root for CGI scripts exec */
struct timeval sockTimeVal;
mimeData *mimeArray; /* here we will hold all MIME data, inited once, never to be changed */
-@@ -322,10 +323,13 @@
+@@ -314,10 +315,13 @@
reqStruct->keepAlive = YES;
else if (!strncmp(reqArray[1], "Connection: Keep-Alive", strlen("Connection: keep-alive")))
reqStruct->keepAlive = YES;
@@ -23,7 +23,7 @@
while (i < readLines)
{
if (!strncmp(reqArray[i], "User-Agent:", strlen("User-Agent:")))
-@@ -340,6 +344,20 @@
+@@ -332,6 +336,20 @@
#ifdef PRINTF_DEBUG
printf("content length %ld\n", reqStruct->contentLength);
#endif
@@ -44,7 +44,7 @@
}
i++;
}
-@@ -437,18 +455,39 @@
+@@ -431,18 +449,39 @@
/* we append the default file name */
strcat(completeFilePath, defaultFileName);
analyzeExtension(mimeType, completeFilePath);
@@ -87,7 +87,7 @@
}
}
} else if (!strcmp(req.method, "HEAD"))
-@@ -517,7 +556,14 @@
+@@ -513,7 +552,14 @@
strcat(completeFilePath, defaultFileName);
}
analyzeExtension(mimeType, completeFilePath);
@@ -103,7 +103,7 @@
}
} else if (!strcmp(req.method, "POST"))
{
-@@ -531,13 +577,6 @@
+@@ -527,13 +573,6 @@
int readFinished;
printf("Handling of POST method\n");
@@ -114,10 +114,10 @@
- sayError(sock, UNHANDLED_METHOD, "", req);
- return -1;
- }
+ #ifdef ENABLE_CGI
#ifdef PRINTF_DEBUG
printf ("begin of post handling\n");
-
-@@ -553,7 +592,7 @@
+@@ -550,7 +589,7 @@
return -1;
} else if (req.contentLength >= BUFFER_SIZE)
{
@@ -126,7 +126,7 @@
return -1;
}
while (!readFinished)
-@@ -631,7 +670,77 @@
+@@ -628,7 +667,77 @@
#ifdef PRINTF_DEBUG
printf("buff: |%s|\n", buff);
#endif
@@ -203,9 +203,9 @@
+#endif
+ }
}
- } else
- {
-@@ -660,7 +769,7 @@
+ #endif /* ENABLE_CGI */
+ #ifndef ENABLE_CGI
+@@ -664,7 +773,7 @@
f = fopen(configFile, "r");
if (f == NULL)
{
@@ -214,7 +214,7 @@
*serverPort = DEFAULT_PORT;
*maxChildren = DEFAULT_MAX_CHILDREN;
strcpy(homePath, DEFAULT_DOCS_LOCATION);
-@@ -669,7 +778,9 @@
+@@ -673,7 +782,9 @@
sockTimeVal.tv_usec = DEFAULT_USEC_TO;
strcpy(logFileName, DEFAULT_LOG_FILE);
strcpy(mimeTypesFileName, DEFAULT_MIME_FILE);
@@ -224,7 +224,7 @@
return -1;
}
if (!feof(f)) fscanf(f, "%s %s", str1, str2);
-@@ -770,11 +881,25 @@
+@@ -774,11 +885,25 @@
if (mimeTypesFileName == NULL)
{
strcpy(mimeTypesFileName, DEFAULT_MIME_FILE);
@@ -252,7 +252,7 @@
}
if (!feof(f)) fscanf(f, "%s %s", str1, str2);
if (str1 != NULL && str2 != NULL && !strcmp(str1, "cgiRoot"))
-@@ -1008,7 +1133,7 @@
+@@ -1012,7 +1137,7 @@
} */
} else
{
diff -urN pserv-3.1/files/patch-main.h pserv/files/patch-main.h
--- pserv-3.1/files/patch-main.h Wed Dec 8 15:03:20 2004
+++ pserv/files/patch-main.h Tue Apr 26 11:47:58 2005
@@ -1,47 +1,45 @@
---- sources/main.h.orig Wed Nov 24 11:12:35 2004
-+++ sources/main.h Wed Nov 24 14:58:06 2004
-@@ -20,12 +20,14 @@
- /* --- CPP parsing options --- */
- #undef PRINTF_DEBUG /* enable this to print some debugging messages */
+--- sources/main.h.orig Fri Feb 11 14:25:20 2005
++++ sources/main.h Tue Apr 26 11:47:35 2005
+@@ -24,10 +24,10 @@
+ #define 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 LOG /* enable logging to file */
#define AUTO_INDEX /* enables auto-index of directories */
#define SOCKADDR_REUSE /* enables reuse oth the socket (quick relaunch) */
- #define VOID_SIG_HANDLERS /* enables different signal function types */
- #undef ADDR_LEN_TYPE_INT /* in accept() if addrlen is int */
+-
+#define PHP /* enables transparent PHP support */
/* --- Configure options --- */
#define CONFIG_FILE_NAME "pserv.conf" /* name of the configuration file, concatenated to DEFAULT_CONFIG_LOCATION */
-@@ -36,18 +38,19 @@
+@@ -38,18 +38,19 @@
#define MIME_TYPE_DEFAULT "application/octet-stream"
/* configuration file location */
--#define DEFAULT_CONFIG_LOCATION "/usr/people/multix/pserv/defaults/"
+-#define DEFAULT_CONFIG_LOCATION "/usr/local/etc/pserv/"
+#define DEFAULT_CONFIG_LOCATION "/usr/local/etc/"
/* hard-wired defaults, if loading of config file fails */
-#define DEFAULT_PORT 2000
+#define DEFAULT_PORT 80
#define DEFAULT_MAX_CHILDREN 5
--#define DEFAULT_DOCS_LOCATION "/usr/people/multix/public_html"
+-#define DEFAULT_DOCS_LOCATION "/usr/local/var/www"
+#define DEFAULT_DOCS_LOCATION "/usr/local/www/data"
#define DEFAULT_FILE_NAME "index.html"
#define DEFAULT_SEC_TO 1
#define DEFAULT_USEC_TO 100
--#define DEFAULT_LOG_FILE "/home/multix/pserv/pserv.log"
--#define DEFAULT_MIME_FILE "/home/multix/pserv/mime_types.dat"
--#define DEFAULT_CGI_ROOT "/home/multix/public_html/cgi-bin"
-+#define DEFAULT_LOG_FILE "/var/log/pserv.log"
-+#define DEFAULT_MIME_FILE "/usr/local/etc/mime.types"
+-#define DEFAULT_LOG_FILE "/usr/local/var/log/pserv.log"
+-#define DEFAULT_MIME_FILE "/usr/local/etc/pserv/mime_types.dat"
+-#define DEFAULT_CGI_ROOT "/usr/local/var/www/cgi-bin"
++#define DEFAULT_LOG_FILE "/var/log/pserv.log"
++#define DEFAULT_MIME_FILE "/usr/local/etc/mime.types"
+#define DEFAULT_PHP_FILE "/usr/local/bin/php"
-+#define DEFAULT_CGI_ROOT "/usr/local/www/cgi-bin"
++#define DEFAULT_CGI_ROOT "/usr/local/www/cgi-bin"
#define DEFAULT_SERVER_NAME "localhost"
/* amount of connections queued in listening */
-@@ -120,8 +123,10 @@
+@@ -122,8 +123,10 @@
#define ADDRESS_LEN 16
#define METHOD_LEN 16
#define PROTOCOL_LEN 16
@@ -52,7 +50,7 @@
/* ------ Structures ------- */
/* we use +1 to be safe with handling the end-of-string */
-@@ -139,7 +144,9 @@
+@@ -141,7 +144,9 @@
char protocolVersion[PROTOCOL_LEN+1];
int keepAlive;
char userAgent[USER_AGENT_LEN+1];
diff -urN pserv-3.1/files/patch-pserv.conf pserv/files/patch-pserv.conf
--- pserv-3.1/files/patch-pserv.conf Wed Dec 8 15:03:20 2004
+++ pserv/files/patch-pserv.conf Mon Apr 25 10:40:22 2005
@@ -1,17 +1,17 @@
---- defaults/pserv.conf.orig Tue Nov 9 19:03:50 2004
-+++ defaults/pserv.conf Wed Nov 24 15:00:53 2004
+--- defaults/pserv.conf.orig Mon Apr 25 10:38:40 2005
++++ defaults/pserv.conf Mon Apr 25 10:40:00 2005
@@ -1,9 +1,10 @@
-port 8080
-+port 80
++port 80
maxChildren 4
--documentsPath /usr/people/multix/public_html
+-documentsPath /usr/local/var/www
+documentsPath %%PREFIX%%/www/data
defaultFile index.html
secTimeout 1
uSecTimeout 100000
--logFile /usr/people/multix/pserv/pserv.log
--mimeTypesFile /usr/people/multix/pserv/defaults/mime_types.dat
--cgiRoot /usr/people/multix/public_html/cgi-bin
+-logFile /usr/local/var/log/pserv.log
+-mimeTypesFile /usr/local/etc/pserv/mime_types.dat
+-cgiRoot /usr/local/var/www/cgi-bin
+logFile /var/log/pserv.log
+mimeTypesFile %%PREFIX%%/etc/mime.types
+phpFile %%LOCALBASE%%/bin/php
--- pserv_update_3.1-3.2.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list