Ticket #474: Portfile.3

File Portfile.3, 4.4 KB (added by wb@…, 21 years ago)

Destrooted Zope Portfile

Line 
1# Zope Portfile ###############################################################
2# $Id$
3
4PortSystem          1.0
5name                zope
6version             2.6.1
7revision            0
8categories          www python zope
9maintainers         wb@willbarton.com
10description         Object-Oriented Python Web Application Server
11platforms           darwin
12homepage            http://www.zope.org
13master_sites        http://www.zope.org/Products/Zope/${version}/${version}
14distname            Zope-${version}-src
15distfiles           Zope-${version}-src.tgz
16checksums           md5 a17f36b86b6e489797d8e52f1ba48efe
17depends_build       bin:python2.1:python2.1
18depends_run         path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
19extract.post_args   | gnutar -xf -
20configure           { }
21
22set python          /usr/bin/env\ python2.1
23build.cmd           ${python}
24build.target        w_pcgi.py
25build.env           ZDIR=${prefix}/www/Zope
26
27# Default Zope User and Password.  The password is changed from what is
28# printed durring the build, as the user will not see that by default.
29set defuser         admin
30set defpasswd       mypass
31
32set zopebase        ${destroot}${prefix}/www/Zope
33set zopeuser        zope
34
35pre-destroot {
36    # Set the default user's password
37    system          "cd ${worksrcpath} && ${python} zpasswd.py \
38                    -u ${defuser} -p ${defpasswd} inituser"
39
40    # Clean up before install
41    system          "cd ${worksrcpath}/pcgi/Test && rm -rf *.o"
42    system          "cd ${worksrcpath}/pcgi && rm -rf *.o"
43    system          "cd ${worksrcpath}/lib/python && rm -rf build"
44
45    # Add a 'zope' user
46    adduser ${zopeuser} gid=[existsgroup www] realname=Zope\ Server
47}
48
49destroot {
50    #set zopebase    ${destroot}${prefix}/www/Zope
51    #set zopeuser    zope
52    system          "install -d ${destroot}${prefix}/bin"
53    system          "install -d ${destroot}${prefix}/etc/rc.d"
54    system          "install -d ${destroot}${prefix}/www/cgi-bin"
55    system          "install -d ${destroot}${prefix}/share/doc/Zope"
56    system          "install -d ${zopebase}"
57
58    # Copy the Zope tree
59    system          "cd ${worksrcpath}; cp -Rp * ${zopebase}"
60    reinplace       "s|${worksrcpath}|${prefix}/www/Zope|g" ${zopebase}/stop
61    system          "chown -R zope ${zopebase}"
62    system          "chgrp -R www ${zopebase}"
63    system          "cd ${zopebase} && chmod 1755 var"
64    system          "cd ${zopebase} && chown zope var/*"
65    system          "cd ${zopebase} && chmod 700 z2.py"
66    system          "cd ${zopebase} && chown root var"
67    system          "touch ${zopebase}/var/error.log"
68
69    # Copy the pcgi stuff
70    system          "cd ${zopebase} && mv Zope.cgi Zope.cgi.orig;
71                    echo '#! ${prefix}/www/cgi-bin/pcgi-wrapper' > Zope.cgi;
72                    cat Zope.cgi.orig >> Zope.cgi; rm -f Zope.cgi.orig"
73    system          "install -m 555 -c ${zopebase}/Zope.cgi \
74                    ${destroot}${prefix}/www/cgi-bin"
75    system          "install -m 555 -c ${zopebase}/pcgi/pcgi-wrapper \
76                    ${destroot}${prefix}/www/cgi-bin"
77    system          "install -m 755 -c ${filespath}/Apache-Zope.txt \
78                    ${destroot}${prefix}/www"
79
80    # Copy the zopectl and zope startup script
81    system          "install -m 755 -c ${filespath}/zopectl \
82                    ${destroot}${prefix}/bin/zopectl"
83    reinplace       "s|%%ZOPEBASE%%|${prefix}/www/Zope|g" \
84                    ${destroot}${prefix}/bin/zopectl
85    reinplace       "s|%%ZOPEUSER%%|${zopeuser}|g" \
86                    ${destroot}${prefix}/bin/zopectl
87    reinplace       "s|%%CGIBINDIR%%|${prefix}/www/cgi-bin|g" \
88                    ${destroot}${prefix}/bin/zopectl
89    system          "install -m 755 -c ${destroot}${prefix}/bin/zopectl \
90                    ${destroot}${prefix}/etc/rc.d/zope.sh"
91
92    # Copy Docs
93    system          "cp -R ${worksrcpath}/doc/* \
94                    ${destroot}${prefix}/share/doc/Zope"
95
96    # Tell the user how to configure with Apache and what admin's pw is
97    ui_msg          "${UI_PREFIX} To configure Apache to use Zope.cgi, see\
98                    ${prefix}/www/Apache-Zope.txt"
99    ui_msg                  "${UI_PREFIX} The '${defuser}' user's password has been\
100                    set to '${defpasswd}'.  Please change it."
101}
102
103long_description \
104Zope is a leading open source application server, specializing in content \
105management, portals, and custom applications.
106