source: trunk/dports/www/pserv/Portfile

Last change on this file was 114325, checked in by ryandesign@…, 4 years ago

use eq and ne instead of == and != when comparing ${os.platform} and ${os.subplatform}

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 114325 2013-12-05 09:20:31Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                pserv
7version             3.4
8categories          www
9platforms           darwin
10maintainers         nomaintainer
11license             GPL-2+
12
13description         Pico Server is a small web server.
14
15long_description    ${description}
16
17homepage            http://pserv.sourceforge.net/
18master_sites        sourceforge:project/pserv/pserv/${version}
19extract.suffix      .tar.Z
20
21checksums           rmd160  15ee471e2c0bc0aeb897dbe2eab5271928de8fbd \
22                    sha256  6a37e3056504db4e5623ce59fda95a759f7692f67dcb174ceb32d340b3441977
23
24patchfiles          patch-main.h \
25                    patch-pserv.conf
26
27post-patch {
28    reinplace "s|@PREFIX@|${prefix}|g" \
29                    ${worksrcpath}/defaults/pserv.conf \
30                    ${worksrcpath}/sources/main.h
31}
32
33configure.args      --bindir=${prefix}/sbin
34
35destroot.keepdirs   ${destroot}${prefix}/var/log/pserv
36
37set conf_files      {etc/pserv/mime_types.dat etc/pserv/pserv.conf var/www/index.html}
38
39if {${os.platform} eq "darwin" && ${os.major} > 8} {
40    set pserv_user _www
41} else {
42    set pserv_user www
43}
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}
Note: See TracBrowser for help on using the repository browser.