Index: /main/waeup.sirp/trunk/README.txt
===================================================================
--- /main/waeup.sirp/trunk/README.txt	(revision 5494)
+++ /main/waeup.sirp/trunk/README.txt	(revision 5495)
@@ -77,5 +77,9 @@
 You can start Zope with the with the following command:
 
-    $ bin/zopectl fg
+    $ bin/sirpctl fg
+
+Alternatively you can do:
+
+    $ bin/paster serve parts/etc/deploy.ini
 
 If you now connect to port 8080 and log in with username 'grok',
Index: /main/waeup.sirp/trunk/buildout.cfg
===================================================================
--- /main/waeup.sirp/trunk/buildout.cfg	(revision 5494)
+++ /main/waeup.sirp/trunk/buildout.cfg	(revision 5495)
@@ -1,10 +1,31 @@
 [buildout]
 develop = .
-parts = app data zopectl i18n test waeupdocs coverage-detect coverage-report
-#find-links = http://download.zope.org/distribution/
-#newest = false
-#extends= http://grok.zope.org/releaseinfo/grok-1.0.cfg
+parts =
+    eggbasket
+    app
+    i18n
+    test
+    mkdirs
+    zpasswd
+    zope_conf
+    site_zcml
+    zdaemon_conf
+    deploy_ini
+    debug_ini
+    waeupdocs
+    coverage-detect
+    coverage-report
+# For backward compatibility, telling buildout not to throw away
+# the data and log subdirectories from the parts directory.
+    data
+    log
+newest = false
+
+#extends = versions.cfg
 extends= http://grok.zope.org/releaseinfo/grok-1.1.cfg
-#extends = http://svn.zope.org/*checkout*/groktoolkit/trunk/grok.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
 versions = versions
 
@@ -21,62 +42,94 @@
 lovely.recipe = 1.0.0    # Pinned to prevent buildout svn-error.
 
+
 [app]
-recipe = zc.zope3recipes>=0.5.3:application
+recipe = zc.recipe.egg
 eggs = waeup.sirp
-site.zcml = <include package="waeup.sirp" />
-            <include package="zope.app.twisted" />
-            <configure i18n_domain="waeup.sirp">
-              <unauthenticatedPrincipal id="zope.anybody"
-                                        title="Unauthenticated User" />
-              <unauthenticatedGroup id="zope.Anybody"
-                                    title="Unauthenticated Users" />
-              <authenticatedGroup id="zope.Authenticated"
-                                title="Authenticated Users" />
-              <everybodyGroup id="zope.Everybody"
-                              title="All Users" />
-              <principal id="zope.manager"
-                         title="Manager"
-                         login="grok"
-                         password_manager="Plain Text"
-                         password="grok"
-                         />
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
 
-	      <grant permission="zope.View"
-                     principal="zope.Authenticated" />
-	      <grant permission="zope.app.dublincore.view"
-                     principal="zope.Authenticated" />
+[mkdirs]
+recipe = z3c.recipe.mkdir
+paths =
+    ${zope_conf:filestorage}
+    ${zope_conf:logfiles}
+    ${zope_conf:blobstorage}
 
-              <!-- Replace the following directive if you don't want
-                   public access -->
-              <grant permission="zope.View"
-                     principal="zope.Anybody" />
-              <grant permission="zope.app.dublincore.view"
-                     principal="zope.Anybody" />
+[test]
+recipe = zc.recipe.testrunner
+eggs = waeup.sirp
+defaults = ['--tests-pattern', '^f?tests$', '-v']
 
-	      <grant permission="waeup.Public"
-                     principal="zope.Everybody" />
-          <grant permission="waeup.Anonymous"
-                     principal="zope.Anybody" />
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = waeup.sirp
+eggs = waeup.sirp
+domain = waeup.sirp
+output = src/waeup/sirp/locales
+zcml =
 
-              <role id="zope.Manager" title="Site Manager" />
-              <role id="zope.Member" title="Site Member" />
-              <grantAll role="zope.Manager" />
-              <grant role="zope.Manager"
-                     principal="zope.manager" />
-           </configure>
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = waeup.sirp
+module = zope.app.server.zpasswd
+method = main
 
+[zope_conf]
+recipe = collective.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+filestorage = ${buildout:directory}/var/filestorage
+blobstorage = ${buildout:directory}/var/blobstorage
+logfiles = ${buildout:directory}/var/log
+extra =
+# extra = <grokwarnings>True</grokwarnings>
+# 'extra' is copied verbatim. Use it for product config sections and so.
+
+# The [data] and [log] parts are still in here to instruct buildout to not
+# unintentionally throw away the parts/data and parts/log subdirectories
+# that contain the Data.fs and the log files. These files should be
+# copied to the new locations. See the upgrade notes for more information.
 [data]
 recipe = zc.recipe.filestorage
 
-# this section named so that the start/stop script is called bin/zopectl
-[zopectl]
-recipe = zc.zope3recipes:instance
-application = app
-zope.conf = ${data:zconfig}
+[log]
+recipe = zc.recipe.filestorage
 
-[test]
-recipe = zc.recipe.testrunner
-eggs = waeup.sirp [test]
-defaults = ['--tests-pattern', '^f?tests$', '-v']
+[site_zcml]
+recipe = collective.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = collective.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = collective.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = collective.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.1.tgz
+
+[waeupdocs]
+recipe = collective.recipe.sphinxbuilder
+eggs = waeup.sirp
+source = ${buildout:directory}/docs/source
+build = ${buildout:directory}/docs/build
 
 # Collect test coverage data.
@@ -94,18 +147,2 @@
 scripts = coveragereport
 arguments = ('${buildout:parts-directory}/coverage-detect/coverage', '${buildout:directory}/coverage-report')
-
-
-
-# this section named so that the i18n scripts are called bin/i18n...
-[i18n]
-recipe = lovely.recipe:i18n
-package = waeup.sirp
-domain = waeup.sirp
-location = src/waeup/sirp
-output = locales
-
-[waeupdocs]
-recipe = collective.recipe.sphinxbuilder
-eggs = waeup.sirp
-source = ${buildout:directory}/docs/source
-build = ${buildout:directory}/docs/build
Index: /main/waeup.sirp/trunk/etc/README.txt
===================================================================
--- /main/waeup.sirp/trunk/etc/README.txt	(revision 5495)
+++ /main/waeup.sirp/trunk/etc/README.txt	(revision 5495)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini
Index: /main/waeup.sirp/trunk/etc/debug.ini.in
===================================================================
--- /main/waeup.sirp/trunk/etc/debug.ini.in	(revision 5495)
+++ /main/waeup.sirp/trunk/etc/debug.ini.in	(revision 5495)
@@ -0,0 +1,67 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:waeup.sirp#debug
+filter-with = translogger
+exempt-exceptions = zope.security.interfaces.IUnauthorized
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
Index: /main/waeup.sirp/trunk/etc/deploy.ini.in
===================================================================
--- /main/waeup.sirp/trunk/etc/deploy.ini.in	(revision 5495)
+++ /main/waeup.sirp/trunk/etc/deploy.ini.in	(revision 5495)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:waeup.sirp
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
Index: /main/waeup.sirp/trunk/etc/site.zcml.in
===================================================================
--- /main/waeup.sirp/trunk/etc/site.zcml.in	(revision 5495)
+++ /main/waeup.sirp/trunk/etc/site.zcml.in	(revision 5495)
@@ -0,0 +1,40 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="waeup.sirp">
+
+  <include package="waeup.sirp" />
+
+    <configure i18n_domain="waeup.sirp">
+
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="321b9cd3739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+      <grant permission="waeup.Public"
+	     principal="zope.Everybody" />
+      <grant permission="waeup.Anonymous"
+	     principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>
Index: /main/waeup.sirp/trunk/etc/zdaemon.conf.in
===================================================================
--- /main/waeup.sirp/trunk/etc/zdaemon.conf.in	(revision 5495)
+++ /main/waeup.sirp/trunk/etc/zdaemon.conf.in	(revision 5495)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${zope_conf:logfiles}/zdaemon.log
+  socket-name ${zope_conf:logfiles}/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>
Index: /main/waeup.sirp/trunk/etc/zope.conf.in
===================================================================
--- /main/waeup.sirp/trunk/etc/zope.conf.in	(revision 5495)
+++ /main/waeup.sirp/trunk/etc/zope.conf.in	(revision 5495)
@@ -0,0 +1,55 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard blob storage
+  <blobstorage>
+    blob-dir ${zope_conf:blobstorage}
+    <filestorage>
+      path ${zope_conf:filestorage}/Data.fs
+    </filestorage>
+  </blobstorage>
+
+# Uncomment this if you want a blob-less standard file storage instead:
+#  <filestorage>
+#       path ${zope_conf:filestorage}
+#  </filestorage>
+
+# Uncomment this if you want to connect to a ZEO server instead:
+#  <zeoclient>
+#    server localhost:8100
+#    storage 1
+#    # ZEO client cache, in bytes
+#    cache-size 20MB
+#    # Uncomment to have a persistent disk cache
+#    #client zeo1
+#  </zeoclient>
+
+</zodb>
+
+<eventlog>
+  # This sets up logging to a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${zope_conf:logfiles}/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
+
+# Extra configuration lines can be added to zope_conf's extra option. Put for 
+# instance productconf sections in here.
+${zope_conf:extra}
Index: /main/waeup.sirp/trunk/setup.py
===================================================================
--- /main/waeup.sirp/trunk/setup.py	(revision 5494)
+++ /main/waeup.sirp/trunk/setup.py	(revision 5495)
@@ -7,4 +7,5 @@
     'setuptools',
     'grok',
+    'grokcore.startup',
     'grokui.admin',
     'hurry.query',
@@ -81,4 +82,11 @@
       entry_points="""
       # Add entry points here
+      [console_scripts]
+      sirp-debug = grokcore.startup:interactive_debug_prompt
+      sirpctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
+      debug = grokcore.startup:debug_application_factory
+
       """,
       )
