aboutsummaryrefslogtreecommitdiff
path: root/www/pserv
diff options
context:
space:
mode:
authorOliver Lehmann <oliver@FreeBSD.org>2005-05-28 09:08:44 +0000
committerOliver Lehmann <oliver@FreeBSD.org>2005-05-28 09:08:44 +0000
commite63323d90203c910f5e65db7a164e6cef20dcb49 (patch)
treed0f6551e10a23472d2b6f03ff91638309965e981 /www/pserv
parenta6a52769ec7277df95d38e0b0a4f531e95829d4f (diff)
downloadports-e63323d90203c910f5e65db7a164e6cef20dcb49.tar.gz
ports-e63323d90203c910f5e65db7a164e6cef20dcb49.zip
update to 3.3
change installation of etc/mime.types to etc/mime.types.pserv (stop conflicting with other ports) PR: ports/80726 Approved by: maintainer timeout (21 days)
Notes
Notes: svn path=/head/; revision=136326
Diffstat (limited to 'www/pserv')
-rw-r--r--www/pserv/Makefile10
-rw-r--r--www/pserv/distinfo4
-rw-r--r--www/pserv/files/patch-handlers.c22
-rw-r--r--www/pserv/files/patch-log.c30
-rw-r--r--www/pserv/files/patch-main.c43
-rw-r--r--www/pserv/files/patch-main.h50
-rw-r--r--www/pserv/files/patch-pserv.conf16
-rw-r--r--www/pserv/pkg-plist2
8 files changed, 74 insertions, 103 deletions
diff --git a/www/pserv/Makefile b/www/pserv/Makefile
index a5e3ab5d7794..41222052095b 100644
--- a/www/pserv/Makefile
+++ b/www/pserv/Makefile
@@ -6,18 +6,16 @@
#
PORTNAME= pserv
-PORTVERSION= 3.1
+PORTVERSION= 3.3
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
-EXTRACT_SUFX= .tar.Z
MAINTAINER= ale@FreeBSD.org
COMMENT= A portable and small webserver written in C
-WRKSRC= ${WRKDIR}/${PORTNAME}
-BUILD_WRKSRC= ${WRKSRC}/sources
USE_REINPLACE= yes
+GNU_CONFIGURE= yes
OPTIONS= LOG "Enable logging" on \
PHP "Enable PHP support" on
@@ -26,7 +24,7 @@ OPTIONS= LOG "Enable logging" on \
post-patch:
@${REINPLACE_CMD} "s|%%PREFIX%%|${PREFIX}|g;s|%%LOCALBASE%%|${LOCALBASE}|g" \
- ${WRKSRC}/defaults/pserv.conf
+ ${WRKSRC}/defaults/pserv.conf ${WRKSRC}/sources/main.h
.if defined(WITHOUT_LOG)
@${REINPLACE_CMD} "s|define LOG|undef LOG|" \
${WRKSRC}/sources/main.h
@@ -38,7 +36,7 @@ post-patch:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/sources/pserv ${PREFIX}/sbin/
- ${INSTALL_DATA} ${WRKSRC}/defaults/mime_types.dat ${PREFIX}/etc/mime.types
+ ${INSTALL_DATA} ${WRKSRC}/defaults/mime_types.dat ${PREFIX}/etc/mime.types.pserv
${INSTALL_DATA} ${WRKSRC}/defaults/pserv.conf ${PREFIX}/etc/
${INSTALL_SCRIPT} ${FILESDIR}/pserv.sh ${PREFIX}/etc/rc.d/
diff --git a/www/pserv/distinfo b/www/pserv/distinfo
index 6c758c4c4f3f..ef6a27624ff4 100644
--- a/www/pserv/distinfo
+++ b/www/pserv/distinfo
@@ -1,2 +1,2 @@
-MD5 (pserv-3.1.tar.Z) = c106d7709bf2a65e9acf16147f2e3a1f
-SIZE (pserv-3.1.tar.Z) = 49511
+MD5 (pserv-3.3.tar.gz) = fa8c5f18af5b7bab277f5dab2ad2a48e
+SIZE(pserv-3.3.tar.gz) = 105048
diff --git a/www/pserv/files/patch-handlers.c b/www/pserv/files/patch-handlers.c
index a2190ce615e5..c3a602e951f0 100644
--- a/www/pserv/files/patch-handlers.c
+++ b/www/pserv/files/patch-handlers.c
@@ -1,5 +1,5 @@
---- sources/handlers.c.orig Fri Nov 5 23:04:15 2004
-+++ sources/handlers.c Wed Nov 24 15:12:55 2004
+--- sources/handlers.c.orig Mon May 16 23:03:16 2005
++++ sources/handlers.c Sat May 28 10:38:18 2005
@@ -25,6 +25,7 @@
#endif
@@ -8,7 +8,7 @@
extern int port; /* server port */
extern char defaultFileName[MAX_PATH_LEN+1]; /* default name for index, default or similar file */
-@@ -323,6 +324,14 @@
+@@ -269,6 +270,14 @@
i = 0;
/* beware of not overfilling this array, check MAX_ENVP_LEN */
@@ -23,21 +23,9 @@
strcpy(newEnvp[i], "SERVER_SOFTWARE=");
strcat(newEnvp[i], SERVER_SOFTWARE_STR);
strcat(newEnvp[i], "/");
-@@ -345,6 +354,11 @@
- strcat(newEnvp[i++], req.userAgent);
- strcpy(newEnvp[i], "SCRIPT_FILENAME=");
- strcat(newEnvp[i++], completedPath);
-+ if (req.cookie[0] != '\0')
-+ {
-+ strcpy(newEnvp[i], "HTTP_COOKIE=");
-+ strcat(newEnvp[i++], req.cookie);
-+ }
- newEnvp[i] = NULL;
-
- /* we change the current working directory to the scripts one */
-@@ -377,8 +391,237 @@
- return 0;
+@@ -326,8 +335,237 @@
}
+ #endif /* ENABLE_CGI */
+#ifdef PHP
+int phpHandler(port, sock, phpFileName, completedPath, req, postStr)
diff --git a/www/pserv/files/patch-log.c b/www/pserv/files/patch-log.c
index 0ff9c67e19a7..9f49b31c926a 100644
--- a/www/pserv/files/patch-log.c
+++ b/www/pserv/files/patch-log.c
@@ -1,33 +1,33 @@
---- 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 Mon May 16 23:03:16 2005
++++ sources/log.c Sat May 28 10:41:25 2005
+@@ -23,6 +23,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
+@@ -38,6 +39,7 @@
+ fflush(lf); /* otherwise we have mysterious problems with fork() !! */
+
+ DBGPRINTF(("Opened Log File.\n"));
++#endif
return 0;
}
+@@ -45,8 +47,10 @@
+ */
int logFileClose()
{
+#ifdef LOG
fclose(lf);
- #ifdef PRINTF_DEBUG
- printf("Closed Log File.\n");
- #endif
-+#endif
+ DBGPRINTF(("Closed Log File.\n"));
++#endif
return 0;
}
-@@ -57,6 +61,7 @@
+@@ -61,6 +65,7 @@
struct request req;
int code;
{
@@ -35,7 +35,7 @@
char timeStr[256];
struct tm *timeStruct;
time_t timeTemp;
-@@ -104,6 +109,7 @@
+@@ -108,6 +113,7 @@
printf ("Unknown event to log! Programming error!\n");
}
fflush(lf);
diff --git a/www/pserv/files/patch-main.c b/www/pserv/files/patch-main.c
index 6da1b90e2a43..e299755b5bc7 100644
--- a/www/pserv/files/patch-main.c
+++ b/www/pserv/files/patch-main.c
@@ -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 Mon May 16 23:13:18 2005
++++ sources/main.c Sat May 28 10:42:47 2005
@@ -23,6 +23,7 @@
char defaultFileName[MAX_PATH_LEN+1];
char logFileName[MAX_PATH_LEN+1];
@@ -8,9 +8,9 @@
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")))
+ else if (!strncmp(reqArray[1], "Connection: keep-alive", strlen("Connection: keep-alive")))
reqStruct->keepAlive = YES;
- /* user-agent, content-length and else */
+ /* user-agent, content-length, content-type, cookie and else */
@@ -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,8 +44,8 @@
}
i++;
}
-@@ -437,18 +455,39 @@
- /* we append the default file name */
+@@ -442,18 +460,39 @@
+ * we append the default file name */
strcat(completeFilePath, defaultFileName);
analyzeExtension(mimeType, completeFilePath);
- dumpFile(sock, completeFilePath, mimeType, req);
@@ -87,7 +87,7 @@
}
}
} else if (!strcmp(req.method, "HEAD"))
-@@ -517,7 +556,14 @@
+@@ -485,7 +524,14 @@
strcat(completeFilePath, defaultFileName);
}
analyzeExtension(mimeType, completeFilePath);
@@ -103,7 +103,7 @@
}
} else if (!strcmp(req.method, "POST"))
{
-@@ -531,13 +577,6 @@
+@@ -499,13 +545,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 @@
+@@ -522,7 +561,7 @@
return -1;
} else if (req.contentLength >= BUFFER_SIZE)
{
@@ -126,7 +126,7 @@
return -1;
}
while (!readFinished)
-@@ -631,7 +670,77 @@
+@@ -601,7 +640,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
+@@ -637,7 +746,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 @@
+@@ -646,7 +755,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 @@
+@@ -747,11 +858,25 @@
if (mimeTypesFileName == NULL)
{
strcpy(mimeTypesFileName, DEFAULT_MIME_FILE);
@@ -252,12 +252,3 @@
}
if (!feof(f)) fscanf(f, "%s %s", str1, str2);
if (str1 != NULL && str2 != NULL && !strcmp(str1, "cgiRoot"))
-@@ -1008,7 +1133,7 @@
- } */
- } else
- {
-- sayError(newSocket, BUFFER_OVERFLOW, "", NULL);
-+ sayError(newSocket, POST_BUFFER_OVERFLOW, "", NULL);
- }
- }
- if (close(newSocket))
diff --git a/www/pserv/files/patch-main.h b/www/pserv/files/patch-main.h
index 35e07635b947..723591350aa3 100644
--- a/www/pserv/files/patch-main.h
+++ b/www/pserv/files/patch-main.h
@@ -1,58 +1,52 @@
---- 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 */
- #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 */
+--- sources/main.h.orig Mon May 16 23:08:30 2005
++++ sources/main.h Sat May 28 10:47:09 2005
+@@ -27,6 +27,8 @@
+
#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 LOG /* enable logging to file */
+#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 +40,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/"
+-#define DEFAULT_CONFIG_LOCATION "/usr/local/etc/pserv/"
++#define DEFAULT_CONFIG_LOCATION "%%PREFIX%%/etc/pserv/"
/* 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/www/data"
+-#define DEFAULT_DOCS_LOCATION "/usr/local/var/www"
++#define DEFAULT_DOCS_LOCATION "%%PREFIX%%/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_PHP_FILE "/usr/local/bin/php"
-+#define DEFAULT_CGI_ROOT "/usr/local/www/cgi-bin"
+-#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 "%%PREFIX%%/etc/mime.types.pserv"
++#define DEFAULT_PHP_FILE "%%LOCALBASE%%/bin/php"
++#define DEFAULT_CGI_ROOT "%%PREFIX%%/www/cgi-bin"
#define DEFAULT_SERVER_NAME "localhost"
/* amount of connections queued in listening */
-@@ -120,8 +123,10 @@
+@@ -122,8 +125,10 @@
#define ADDRESS_LEN 16
#define METHOD_LEN 16
#define PROTOCOL_LEN 16
-+#define CONTENT_TYPE_LEN 256
++#define CONTENT_TYPE_LEN 256
#define USER_AGENT_LEN 256
#define MAX_QUERY_STRING_LEN 1024
-+#define MAX_COOKIE_LEN 4096
++#define MAX_COOKIE_LEN 4096
/* ------ Structures ------- */
/* we use +1 to be safe with handling the end-of-string */
-@@ -139,7 +144,9 @@
+@@ -141,7 +146,9 @@
char protocolVersion[PROTOCOL_LEN+1];
int keepAlive;
char userAgent[USER_AGENT_LEN+1];
diff --git a/www/pserv/files/patch-pserv.conf b/www/pserv/files/patch-pserv.conf
index d40fee1e80af..967831f614d7 100644
--- a/www/pserv/files/patch-pserv.conf
+++ b/www/pserv/files/patch-pserv.conf
@@ -1,18 +1,18 @@
---- 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 May 16 23:08:29 2005
++++ defaults/pserv.conf Sat May 28 10:50:28 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
++mimeTypesFile %%PREFIX%%/etc/mime.types.pserv
+phpFile %%LOCALBASE%%/bin/php
+cgiRoot %%PREFIX%%/www/cgi-bin
diff --git a/www/pserv/pkg-plist b/www/pserv/pkg-plist
index 930e95b16861..23f610d3cfe9 100644
--- a/www/pserv/pkg-plist
+++ b/www/pserv/pkg-plist
@@ -1,4 +1,4 @@
sbin/pserv
-etc/mime.types
+etc/mime.types.pserv
etc/pserv.conf
etc/rc.d/pserv.sh