Ignore:
Timestamp:
Mar 4, 2012, 2:44:28 AM (7 years ago)
Author:
ryandesign@…
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

Location:
trunk/dports/www/pserv
Files:
1 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/www/pserv/Portfile

    r90387 r90388  
    55
    66name                pserv
    7 version             3.0
     7version             3.4
    88categories          www
    99platforms           darwin
    1010maintainers         nomaintainer
     11license             GPL-2+
    1112
    1213description         Pico Server is a small web server.
     
    1516
    1617homepage            http://pserv.sourceforge.net/
    17 master_sites        sourceforge
     18master_sites        sourceforge:project/pserv/pserv/${version}
    1819extract.suffix      .tar.Z
    1920
    20 checksums           md5     2c38f859631ab09f3cd4ff15b4de457e
     21checksums           rmd160  15ee471e2c0bc0aeb897dbe2eab5271928de8fbd \
     22                    sha256  6a37e3056504db4e5623ce59fda95a759f7692f67dcb174ceb32d340b3441977
    2123
    2224patchfiles          patch-main.h \
    23                     patch-Makefile
     25                    patch-pserv.conf
    2426
    25 worksrcdir          pserv
     27post-patch {
     28    reinplace "s|@PREFIX@|${prefix}|g" \
     29                    ${worksrcpath}/defaults/pserv.conf \
     30                    ${worksrcpath}/sources/main.h
     31}
    2632
    27 use_configure       no
     33configure.args      --bindir=${prefix}/sbin
    2834
    29 build.dir           ${worksrcpath}/sources
    30 build.args          PREFIX=${prefix}
    31 build.target
     35destroot.keepdirs   ${destroot}${prefix}/var/log/pserv
    3236
    33 destroot {
    34     xinstall -m 755 ${worksrcpath}/sources/pserv \
    35         ${destroot}${prefix}/sbin
    36     xinstall -m 755 -d ${destroot}${prefix}/var/www/ \
    37         ${destroot}${prefix}/share/pserv/ \
    38         ${destroot}${prefix}/etc/pserv/ \
    39         ${destroot}${prefix}/var/log/pserv
    40     xinstall -m 644 ${worksrcpath}/defaults/index.html \
    41         ${destroot}${prefix}/var/www
    42     xinstall -m 644 ${worksrcpath}/defaults/mime_types.dat \
    43         ${destroot}${prefix}/share/pserv/
    44     xinstall -m 644 ${filespath}/pserv.conf \
    45         ${destroot}${prefix}/etc/pserv/
    46     reinplace "s|__PREFIX__|${prefix}|g" \
    47         ${destroot}${prefix}/etc/pserv/pserv.conf
    48     system "touch ${destroot}${prefix}/var/log/pserv/pserv.log"
     37set conf_files      {etc/pserv/mime_types.dat etc/pserv/pserv.conf var/www/index.html}
     38
     39if {${os.platform} == "darwin" && ${os.major} > 8} {
     40    set pserv_user _www
     41} else {
     42    set pserv_user www
    4943}
     44
     45startupitem.create      yes
     46startupitem.executable  sudo -u ${pserv_user} ${prefix}/sbin/pserv
     47
     48post-destroot {
     49    foreach conf_file ${conf_files} {
     50        move ${destroot}${prefix}/${conf_file} ${destroot}${prefix}/${conf_file}.sample
     51    }
     52   
     53    xinstall -o ${pserv_user} -g ${pserv_user} -d ${destroot}${prefix}/var/log/pserv
     54}
     55
     56post-activate {
     57    foreach conf_file ${conf_files} {
     58        if {![file exists ${prefix}/${conf_file}]} {
     59            copy ${prefix}/${conf_file}.sample ${prefix}/${conf_file}
     60        }
     61    }
     62}
  • trunk/dports/www/pserv/files/patch-main.h

    r21504 r90388  
    1 --- sources/main.h      Mon Aug 30 13:19:03 2004
    2 +++ sources/main.h.new  Mon Aug 30 16:48:33 2004
    3 @@ -15,7 +15,9 @@
    4  
    5  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
    6  */
    7 -
    8 +#define CONCAT(x,y)    x "" y
    9 +#define STRING(z)      #z
    10 +#define FUNCTION(a,b)  CONCAT( STRING(a), STRING(b) )
    11  
    12  /* --- CPP parsing options --- */
    13  #define PRINTF_DEBUG            /* enable this to print some debugging messages */
    14 @@ -37,18 +39,18 @@
     1--- sources/main.h.orig 2005-06-01 05:36:18.000000000 -0500
     2+++ sources/main.h      2012-03-03 20:03:48.000000000 -0600
     3@@ -37,18 +37,18 @@
    154 #define MIME_TYPE_DEFAULT   "application/octet-stream"
    165 
    176 /* configuration file location */
    18 -#define DEFAULT_CONFIG_LOCATION "/usr/people/multix/pserv/defaults/"
    19 +#define DEFAULT_CONFIG_LOCATION FUNCTION( PREFIX, /etc/pserv/ )
     7-#define DEFAULT_CONFIG_LOCATION "/usr/local/etc/pserv/"
     8+#define DEFAULT_CONFIG_LOCATION "@PREFIX@/etc/pserv/"
    209 
    2110 /* hard-wired defaults, if loading of config file fails */
    2211 #define DEFAULT_PORT           2000
    2312 #define DEFAULT_MAX_CHILDREN   5
    24 -#define DEFAULT_DOCS_LOCATION  "/home/multix/public_html"
    25 +#define DEFAULT_DOCS_LOCATION  FUNCTION( PREFIX, /var/www )
     13-#define DEFAULT_DOCS_LOCATION  "/usr/local/var/www"
     14+#define DEFAULT_DOCS_LOCATION  "@PREFIX@/var/www"
    2615 #define DEFAULT_FILE_NAME      "index.html"
    2716 #define DEFAULT_SEC_TO         1
    2817 #define DEFAULT_USEC_TO        100
    29 -#define DEFAULT_LOG_FILE       "/home/multix/pserv/pserv.log"
    30 -#define DEFAULT_MIME_FILE      "/home/multix/pserv/mime_types.dat"
    31 -#define DEFAULT_CGI_ROOT       "/home/multix/public_html/cgi-bin"
    32 +#define DEFAULT_LOG_FILE       FUNCTION( PREFIX, /var/log/pserv/pserv.log )
    33 +#define DEFAULT_MIME_FILE      FUNCTION( PREFIX, /share/pserv/mime_types.dat )
    34 +#define DEFAULT_CGI_ROOT       FUNCTION( PREFIX, /var/www/cgi-bin )
     18-#define DEFAULT_LOG_FILE       "/usr/local/var/log/pserv.log"
     19-#define DEFAULT_MIME_FILE      "/usr/local/etc/pserv/mime_types.dat"
     20-#define DEFAULT_CGI_ROOT       "/usr/local/var/www/cgi-bin"
     21+#define DEFAULT_LOG_FILE       "@PREFIX@/var/log/pserv/pserv.log"
     22+#define DEFAULT_MIME_FILE      "@PREFIX@/etc/pserv/mime_types.dat"
     23+#define DEFAULT_CGI_ROOT       "@PREFIX@/var/www/cgi-bin"
    3524 #define DEFAULT_SERVER_NAME    "localhost"
    3625 
Note: See TracChangeset for help on using the changeset viewer.