# Zope Portfile ############################################################### # $Id: Portfile,v 1.3 2003/09/19 12:06:40 wbb4 Exp $ PortSystem 1.0 name zope version 2.6.2 revision 1 categories www python zope maintainers wbb4@opendarwin.org description Object-Oriented Python Web Application Server long_description \ Zope is a leading open source application server, specializing in content \ management, portals, and custom applications. platforms darwin homepage http://www.zope.org master_sites http://www.zope.org/Products/Zope/${version}/${version} distname Zope-${version}-src distfiles Zope-${version}-src.tgz checksums md5 a0e873d54994231d7c03640f7092a4fb depends_build bin:python2.1:python21 depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup extract.post_args | gnutar -xf - configure { } set python /usr/bin/env\ python2.1 build.cmd ${python} build.target w_pcgi.py build.env ZDIR=${prefix}/www/Zope # Default Zope User and Password. The password is changed from what is # printed durring the build, as the user will not see that by default. set defuser admin set defpasswd mypass # Location to install Zope and the Zope user set zopebase ${destroot}${prefix}/www/Zope set zopeuser zope pre-destroot { # Set the default user's password system "cd ${worksrcpath} && ${python} zpasswd.py \ -u ${defuser} -p ${defpasswd} inituser" # Clean up before install system "cd ${worksrcpath}/pcgi/Test && rm -rf *.o" system "cd ${worksrcpath}/pcgi && rm -rf *.o" system "cd ${worksrcpath}/lib/python && rm -rf build" # Add a 'zope' user adduser ${zopeuser} gid=[existsgroup www] realname=Zope\ Server } destroot { system "install -d ${destroot}${prefix}/bin" system "install -d ${destroot}${prefix}/etc/rc.d" system "install -d ${destroot}${prefix}/www/cgi-bin" system "install -d ${destroot}${prefix}/share/doc/Zope" system "install -d ${zopebase}" # Copy the Zope tree system "cd ${worksrcpath}; cp -Rp * ${zopebase}" reinplace "s|${worksrcpath}|${prefix}/www/Zope|g" ${zopebase}/stop system "chown -R zope ${zopebase}" system "chgrp -R www ${zopebase}" system "cd ${zopebase} && chmod 1755 var" system "cd ${zopebase} && chown zope var/*" system "cd ${zopebase} && chmod 700 z2.py" system "cd ${zopebase} && chown root var" system "touch ${zopebase}/var/error.log" # Copy the pcgi stuff system "cd ${zopebase} && mv Zope.cgi Zope.cgi.orig; echo '#! ${prefix}/www/cgi-bin/pcgi-wrapper' > Zope.cgi; cat Zope.cgi.orig >> Zope.cgi; rm -f Zope.cgi.orig" system "install -m 555 -c ${zopebase}/Zope.cgi \ ${destroot}${prefix}/www/cgi-bin" system "install -m 555 -c ${zopebase}/pcgi/pcgi-wrapper \ ${destroot}${prefix}/www/cgi-bin" system "install -m 755 -c ${filespath}/Apache-Zope.txt \ ${destroot}${prefix}/www" # Copy the zopectl and zope startup script system "install -m 755 -c ${filespath}/zopectl \ ${destroot}${prefix}/bin/zopectl" reinplace "s|%%ZOPEBASE%%|${prefix}/www/Zope|g" \ ${destroot}${prefix}/bin/zopectl reinplace "s|%%ZOPEUSER%%|${zopeuser}|g" \ ${destroot}${prefix}/bin/zopectl reinplace "s|%%CGIBINDIR%%|${prefix}/www/cgi-bin|g" \ ${destroot}${prefix}/bin/zopectl system "install -m 755 -c ${destroot}${prefix}/bin/zopectl \ ${destroot}${prefix}/etc/rc.d/zope.sh" # Copy Docs system "cp -R ${worksrcpath}/doc/* \ ${destroot}${prefix}/share/doc/Zope" } post-install { # Tell the user how to configure with Apache and what admin's pw is ui_msg "${UI_PREFIX} To configure Apache to use Zope.cgi, see\ ${prefix}/www/Apache-Zope.txt" ui_msg "${UI_PREFIX} The '${defuser}' user's password has been\ set to '${defpasswd}'. Please change it." }