1 | # Zope Portfile ############################################################### |
---|
2 | # $Id$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | name zope |
---|
6 | version 2.6.1 |
---|
7 | revision 0 |
---|
8 | categories www python zope |
---|
9 | maintainers wb@willbarton.com |
---|
10 | description Object-Oriented Python Web Application Server |
---|
11 | platforms darwin |
---|
12 | homepage http://www.zope.org |
---|
13 | master_sites http://www.zope.org/Products/Zope/${version}/${version} |
---|
14 | distname Zope-${version}-src |
---|
15 | distfiles Zope-${version}-src.tgz |
---|
16 | checksums md5 a17f36b86b6e489797d8e52f1ba48efe |
---|
17 | depends_lib bin:python2.1:python21 |
---|
18 | depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup |
---|
19 | extract.post_args | gnutar -xf - |
---|
20 | configure { } |
---|
21 | |
---|
22 | set python /usr/bin/env\ python2.1 |
---|
23 | build.cmd ${python} |
---|
24 | build.target w_pcgi.py |
---|
25 | build.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. |
---|
29 | set defuser admin |
---|
30 | set defpasswd mypass |
---|
31 | |
---|
32 | set zopebase ${destroot}${prefix}/www/Zope |
---|
33 | set zopeuser zope |
---|
34 | |
---|
35 | pre-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 | |
---|
49 | destroot { |
---|
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 | |
---|
103 | long_description \ |
---|
104 | Zope is a leading open source application server, specializing in content \ |
---|
105 | management, portals, and custom applications. |
---|
106 | |
---|