[90388] trunk/dports/www/pserv

ryandesign at macports.org ryandesign at macports.org
Sat Mar 3 18:44:33 PST 2012


Revision: 90388
          http://trac.macports.org/changeset/90388
Author:   ryandesign at macports.org
Date:     2012-03-03 18:44:28 -0800 (Sat, 03 Mar 2012)
Log Message:
-----------
pserv: update to 3.4; use rmd160 and sha256 checksum types; GPL-2+ license; rewrite master_sites to avoid redirects; don't clobber conf files or index.html in case user had modified them; install a launchd plist

Modified Paths:
--------------
    trunk/dports/www/pserv/Portfile
    trunk/dports/www/pserv/files/patch-main.h

Added Paths:
-----------
    trunk/dports/www/pserv/files/patch-pserv.conf

Removed Paths:
-------------
    trunk/dports/www/pserv/files/patch-Makefile
    trunk/dports/www/pserv/files/pserv.conf

Modified: trunk/dports/www/pserv/Portfile
===================================================================
--- trunk/dports/www/pserv/Portfile	2012-03-04 01:57:48 UTC (rev 90387)
+++ trunk/dports/www/pserv/Portfile	2012-03-04 02:44:28 UTC (rev 90388)
@@ -4,46 +4,59 @@
 PortSystem          1.0
 
 name                pserv
-version             3.0
+version             3.4
 categories          www
 platforms           darwin
 maintainers         nomaintainer
+license             GPL-2+
 
 description         Pico Server is a small web server.
 
 long_description    ${description}
 
 homepage            http://pserv.sourceforge.net/
-master_sites        sourceforge
+master_sites        sourceforge:project/pserv/pserv/${version}
 extract.suffix      .tar.Z
 
-checksums           md5     2c38f859631ab09f3cd4ff15b4de457e
+checksums           rmd160  15ee471e2c0bc0aeb897dbe2eab5271928de8fbd \
+                    sha256  6a37e3056504db4e5623ce59fda95a759f7692f67dcb174ceb32d340b3441977
 
 patchfiles          patch-main.h \
-                    patch-Makefile
+                    patch-pserv.conf
 
-worksrcdir          pserv
+post-patch {
+    reinplace "s|@PREFIX@|${prefix}|g" \
+                    ${worksrcpath}/defaults/pserv.conf \
+                    ${worksrcpath}/sources/main.h
+}
 
-use_configure       no
+configure.args      --bindir=${prefix}/sbin
 
-build.dir           ${worksrcpath}/sources
-build.args          PREFIX=${prefix}
-build.target
+destroot.keepdirs   ${destroot}${prefix}/var/log/pserv
 
-destroot {
-    xinstall -m 755 ${worksrcpath}/sources/pserv \
-        ${destroot}${prefix}/sbin
-    xinstall -m 755 -d ${destroot}${prefix}/var/www/ \
-        ${destroot}${prefix}/share/pserv/ \
-        ${destroot}${prefix}/etc/pserv/ \
-        ${destroot}${prefix}/var/log/pserv
-    xinstall -m 644 ${worksrcpath}/defaults/index.html \
-        ${destroot}${prefix}/var/www
-    xinstall -m 644 ${worksrcpath}/defaults/mime_types.dat \
-        ${destroot}${prefix}/share/pserv/
-    xinstall -m 644 ${filespath}/pserv.conf \
-        ${destroot}${prefix}/etc/pserv/
-    reinplace "s|__PREFIX__|${prefix}|g" \
-        ${destroot}${prefix}/etc/pserv/pserv.conf
-    system "touch ${destroot}${prefix}/var/log/pserv/pserv.log"
+set conf_files      {etc/pserv/mime_types.dat etc/pserv/pserv.conf var/www/index.html}
+
+if {${os.platform} == "darwin" && ${os.major} > 8} {
+    set pserv_user _www
+} else {
+    set pserv_user www
 }
+
+startupitem.create      yes
+startupitem.executable  sudo -u ${pserv_user} ${prefix}/sbin/pserv
+
+post-destroot {
+    foreach conf_file ${conf_files} {
+        move ${destroot}${prefix}/${conf_file} ${destroot}${prefix}/${conf_file}.sample
+    }
+    
+    xinstall -o ${pserv_user} -g ${pserv_user} -d ${destroot}${prefix}/var/log/pserv
+}
+
+post-activate {
+    foreach conf_file ${conf_files} {
+        if {![file exists ${prefix}/${conf_file}]} {
+            copy ${prefix}/${conf_file}.sample ${prefix}/${conf_file}
+        }
+    }
+}

Deleted: trunk/dports/www/pserv/files/patch-Makefile
===================================================================
--- trunk/dports/www/pserv/files/patch-Makefile	2012-03-04 01:57:48 UTC (rev 90387)
+++ trunk/dports/www/pserv/files/patch-Makefile	2012-03-04 02:44:28 UTC (rev 90388)
@@ -1,11 +0,0 @@
---- sources/Makefile	Mon Aug 30 13:19:03 2004
-+++ sources/Makefile.new	Mon Aug 30 16:43:06 2004
-@@ -1,7 +1,7 @@
- #Change the following to your needs
- CC = gcc
- #insert here flags, eg. optimizations
--CFLAGS = -Wall -Os 
-+CFLAGS = -Wall -O2 -DPREFIX=$(PREFIX)
- LIBS = 
- SRCS = main.c handlers.c mime.c log.c
- OBJS = main.o handlers.o mime.o log.o

Modified: trunk/dports/www/pserv/files/patch-main.h
===================================================================
--- trunk/dports/www/pserv/files/patch-main.h	2012-03-04 01:57:48 UTC (rev 90387)
+++ trunk/dports/www/pserv/files/patch-main.h	2012-03-04 02:44:28 UTC (rev 90388)
@@ -1,37 +1,26 @@
---- sources/main.h	Mon Aug 30 13:19:03 2004
-+++ sources/main.h.new	Mon Aug 30 16:48:33 2004
-@@ -15,7 +15,9 @@
- 
- You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
--
-+#define CONCAT(x,y)    x "" y
-+#define STRING(z)      #z
-+#define FUNCTION(a,b)  CONCAT( STRING(a), STRING(b) )
- 
- /* --- CPP parsing options --- */
- #define PRINTF_DEBUG            /* enable this to print some debugging messages */
-@@ -37,18 +39,18 @@
+--- sources/main.h.orig	2005-06-01 05:36:18.000000000 -0500
++++ sources/main.h	2012-03-03 20:03:48.000000000 -0600
+@@ -37,18 +37,18 @@
  #define MIME_TYPE_DEFAULT   "application/octet-stream"
  
  /* configuration file location */
--#define DEFAULT_CONFIG_LOCATION "/usr/people/multix/pserv/defaults/"
-+#define DEFAULT_CONFIG_LOCATION FUNCTION( PREFIX, /etc/pserv/ )
+-#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_MAX_CHILDREN	5
--#define DEFAULT_DOCS_LOCATION	"/home/multix/public_html"
-+#define DEFAULT_DOCS_LOCATION	FUNCTION( PREFIX, /var/www )
+-#define DEFAULT_DOCS_LOCATION	"/usr/local/var/www"
++#define DEFAULT_DOCS_LOCATION	"@PREFIX@/var/www"
  #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    	FUNCTION( PREFIX, /var/log/pserv/pserv.log )
-+#define DEFAULT_MIME_FILE   	FUNCTION( PREFIX, /share/pserv/mime_types.dat )
-+#define DEFAULT_CGI_ROOT    	FUNCTION( PREFIX, /var/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    	"@PREFIX@/var/log/pserv/pserv.log"
++#define DEFAULT_MIME_FILE   	"@PREFIX@/etc/pserv/mime_types.dat"
++#define DEFAULT_CGI_ROOT    	"@PREFIX@/var/www/cgi-bin"
  #define DEFAULT_SERVER_NAME 	"localhost"
  
  /* amount of connections queued in listening */

Added: trunk/dports/www/pserv/files/patch-pserv.conf
===================================================================
--- trunk/dports/www/pserv/files/patch-pserv.conf	                        (rev 0)
+++ trunk/dports/www/pserv/files/patch-pserv.conf	2012-03-04 02:44:28 UTC (rev 90388)
@@ -0,0 +1,16 @@
+--- defaults/pserv.conf.orig	2004-12-14 08:17:28.000000000 -0600
++++ defaults/pserv.conf	2012-03-03 20:11:45.000000000 -0600
+@@ -1,9 +1,9 @@
+ port	8080
+ maxChildren	4
+-documentsPath   /usr/local/var/www
++documentsPath   @PREFIX@/var/www
+ defaultFile	index.html
+ secTimeout	1
+ uSecTimeout	100000
+-logFile		/usr/local/var/log/pserv.log
+-mimeTypesFile	/usr/local/etc/pserv/mime_types.dat
+-cgiRoot		/usr/local/var/www/cgi-bin
++logFile		@PREFIX@/var/log/pserv/pserv.log
++mimeTypesFile	@PREFIX@/etc/pserv/mime_types.dat
++cgiRoot		@PREFIX@/var/www/cgi-bin

Deleted: trunk/dports/www/pserv/files/pserv.conf
===================================================================
--- trunk/dports/www/pserv/files/pserv.conf	2012-03-04 01:57:48 UTC (rev 90387)
+++ trunk/dports/www/pserv/files/pserv.conf	2012-03-04 02:44:28 UTC (rev 90388)
@@ -1,9 +0,0 @@
-port	8080
-maxChildren	4
-documentsPath	__PREFIX__/var/www
-defaultFile	index.html
-secTimeout	1
-uSecTimeout	100000
-logFile		__PREFIX__/var/log/pserv/pserv.log
-mimeTypesFile	__PREFIX__/share/pserv/mime_types.dat
-cgiRoot		__PREFIX__/var/www/cgi-bin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120303/dd96a4fc/attachment.html>


More information about the macports-changes mailing list