Ticket #474: Portfile.2

File Portfile.2, 4.2 KB (added by wb@…, 21 years ago)

New Zope 2.6.1 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}/
14distname            Zope-${version}-src
15distfiles           Zope-${version}-src.tgz
16checksums           md5 a17f36b86b6e489797d8e52f1ba48efe
17depends_lib         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
32pre-install {
33    # Set the default user's password
34    system          "cd ${worksrcpath} && ${python} zpasswd.py \
35                    -u ${defuser} -p ${defpasswd} inituser"
36
37    # Clean up before install
38    system          "cd ${worksrcpath}/pcgi/Test && rm -rf *.o"
39    system          "cd ${worksrcpath}/pcgi && rm -rf *.o"
40    system          "cd ${worksrcpath}/lib/python && rm -rf build"
41}
42
43install {
44    set zopebase    ${destroot}${prefix}/www/Zope
45    set zopeuser    zope
46    system          "install -d ${destroot}${prefix}/bin"
47    system          "install -d ${destroot}${prefix}/etc/rc.d"
48    system          "install -d ${destroot}${prefix}/www/cgi-bin"
49    system          "install -d ${destroot}${prefix}/share/doc/Zope"
50    system          "install -d ${zopebase}"
51
52    # Add a 'zope' user
53    adduser ${zopeuser}
54
55    # Copy the Zope tree
56    system          "cd ${worksrcpath}; cp -Rp * ${zopebase}"
57    reinplace       "s|${worksrcpath}|${prefix}/www/Zope|g" ${zopebase}/stop
58    system          "chown -R zope ${zopebase}"
59    system          "cd ${zopebase} && chmod 1755 var"
60    system          "cd ${zopebase} && chown zope var/*"
61    system          "cd ${zopebase} && chmod 700 z2.py"
62    system          "touch ${zopebase}/var/error.log"
63    system          "cd ${zopebase} && chown root var"
64
65    # Copy the pcgi stuff
66    system          "cd ${zopebase} && mv Zope.cgi Zope.cgi.orig;
67                    echo '#! ${prefix}/www/cgi-bin/pcgi-wrapper' > Zope.cgi;
68                    cat Zope.cgi.orig >> Zope.cgi; rm -f Zope.cgi.orig"
69    system          "install -m 555 -c ${zopebase}/Zope.cgi \
70                    ${destroot}${prefix}/www/cgi-bin"
71    system          "install -m 555 -c ${zopebase}/pcgi/pcgi-wrapper \
72                    ${destroot}${prefix}/www/cgi-bin"
73    system          "install -m 755 -c ${filespath}/Apache-Zope.txt \
74                    ${destroot}${prefix}/www"
75
76    # Copy the zopectl and zope startup script
77    system          "install -m 755 -c ${filespath}/zopectl \
78                    ${destroot}${prefix}/bin/zopectl"
79    reinplace       "s|%%ZOPEBASE%%|${prefix}/www/Zope|g" \
80                    ${destroot}${prefix}/bin/zopectl
81    reinplace       "s|%%ZOPEUSER%%|${zopeuser}|g" \
82                    ${destroot}${prefix}/bin/zopectl
83    reinplace       "s|%%CGIBINDIR%%|${prefix}/www/cgi-bin|g" \
84                    ${destroot}${prefix}/bin/zopectl
85    system          "install -m 755 -c ${destroot}${prefix}/bin/zopectl \
86                    ${destroot}${prefix}/etc/rc.d/zope.sh"
87
88    # Copy Docs
89    system          "cp -R ${worksrcpath}/doc/* \
90                    ${destroot}${prefix}/share/doc/Zope"
91
92    # Tell the user how to configure with Apache and what admin's pw is
93    ui_msg          "${UI_PREFIX} To configure Apache to use Zope.cgi, see\
94                    ${prefix}/www/Apache-Zope.txt"
95    ui_msg                  "${UI_PREFIX} The '${defuser}' user's password has been\
96                    set to '${defpasswd}'.  Please change it."
97}
98
99long_description \
100Zope is a leading open source application server, specializing in content \
101management, portals, and custom applications.
102