+++ /dev/null
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: @OLDPACKAGE@-plugin-scmbzr
-# Required-Start: $local_fs $remote_fs $network
-# Required-Stop: $local_fs $remote_fs $network
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-### END INIT INFO
-#
-# Init script for @OLDPACKAGE@-plugin-scmbzr Debian package.
-# Based on the script provided by loggerhead.
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DESC="Loggerhead Bazaar Branch Browser for @FORGENAME@"
-NAME=@OLDPACKAGE@-plugin-scmbzr
-PIDFILE=/var/run/$NAME.pid
-SCRIPTNAME=/etc/init.d/$NAME
-
-# Gracefully exit if the package has been removed.
-[ -x /usr/bin/serve-branches ] || exit 0
-
-# Check if configuration file is present
-[ ! -f @CONFIG_PATH@/plugins/scmbzr/serve-branches.conf ] && exit 0
-
-. @CONFIG_PATH@/plugins/scmbzr/serve-branches.conf
-
-#
-# Function that starts the daemon/service.
-#
-d_start() {
- start-stop-daemon -p $PIDFILE -S --startas /usr/bin/serve-branches --chuid loggerhead --make-pidfile --background --chdir $served_branches -- --prefix=$prefix --port=$port --log-folder /var/log/loggerhead 2>/dev/null
-}
-
-#
-# Function that stops the daemon/service.
-#
-d_stop() {
- start-stop-daemon -p $PIDFILE -K
-}
-
-
-case "$1" in
- start)
- echo -n "Starting $DESC: $NAME"
- d_start
- echo "."
- ;;
- stop)
- echo -n "Stopping $DESC: $NAME"
- d_stop
- echo "."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: $NAME"
- d_stop
- sleep 1
- d_start
- echo "."
- ;;
- *)
- echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
--- /dev/null
+<IfModule wsgi_module>
+ WSGIDaemonProcess fusionforge-plugin-scmbzr user=gforge group=gforge processes=4 maximum-requests=1000 display-name=fusionforge-plugin-scmbzr
+</IfModule>
-<Proxy http://127.0.0.1:8081/*>
- Allow from all
-</Proxy>
+Alias {core/url_prefix}/scm/loggerhead/static /usr/share/loggerhead/static
+RewriteEngine On
+RewriteRule ^{core/url_prefix}/scm/loggerhead$ {core/url_prefix}/scm/loggerhead/ [R]
-<Location {core/url_prefix}scm/loggerhead/>
- ProxyPass http://127.0.0.1:8081/
- ProxyPassReverse http://127.0.0.1:8081/
+WSGIScriptAlias {core/url_prefix}/scm/loggerhead /usr/bin/loggerhead.wsgi
+
+<Location {core/url_prefix}/scm/loggerhead>
+ WSGIProcessGroup fusionforge-plugin-scmbzr
+ Order deny,allow
+ Allow from all
</Location>
--- /dev/null
+#! /bin/sh
+#
+# Configure Loggerhead for FusionForge
+# Roland Mas
+
+PATH=/usr/share/gforge/bin:/usr/share/fusionforge/bin:$PATH
+source_path=`forge_get_config source_path`
+log_path=`forge_get_config log_path`
+data_path=`forge_get_config data_path`
+repos_path=$(forge_get_config repos_path scmbzr)
+web_host=$(forge_get_config web_host)
+url_prefix=$(forge_get_config url_prefix)
+
+
+set -e
+
+if [ `id -u` != 0 ] ; then
+ echo "You must be root to run this, please enter passwd"
+ exec su -c "$0 $1"
+fi
+
+configfile=~gforge/.bazaar/bazaar.conf
+cachedir=/var/cache/gforge/loggerhead
+
+case "$1" in
+ configure)
+ if [ ! -e $configfile ] ; then
+ mkdir -p $(dirname $configfile)
+ cat > $configfile <<EOF
+# Directory to serve bzr branches from
+# Non-bzr directories under this path will also be visible in loggerhead
+http_root_dir = '$repos_path'
+
+# The url prefix for the bzr branches.
+http_user_prefix = 'http://$web_host/$url_prefix/scm/loggerhead'
+
+# Directory to put cache files in
+http_sql_dir = '/var/cache/gforge/loggerhead'
+EOF
+ mkdir -p $cachedir
+ chown gforge $cachedir
+ fi
+ ;;
+
+ purge)
+ rm -rf $configfile $cachedir
+ rmdir $(dirname $configfile) || true
+ ;;
+
+ *)
+ echo "Usage: $0 {configure|purge}"
+ exit 1
+esac
Package: @PACKAGE@-plugin-scmbzr
Architecture: all
-Depends: @OLDPACKAGE@-common, @OLDPACKAGE@-db-postgresql | @OLDPACKAGE@-db, @OLDPACKAGE@-web-apache2 | @OLDPACKAGE@-web, @OLDPACKAGE@-shell-postgresql | @OLDPACKAGE@-shell, bzr, php5-cli, ${misc:Depends}
+Depends: @OLDPACKAGE@-common, @OLDPACKAGE@-db-postgresql | @OLDPACKAGE@-db, @OLDPACKAGE@-web-apache2 | @OLDPACKAGE@-web, @OLDPACKAGE@-shell-postgresql | @OLDPACKAGE@-shell, bzr, php5-cli, ${misc:Depends}, libapache2-mod-wsgi, loggerhead (>= 1.19~bzr477~)
Provides: @PACKAGE@-plugin-scm, @OLDPACKAGE@-plugin-scmbzr
Conflicts: @OLDPACKAGE@-plugin-scmbzr
Replaces: @OLDPACKAGE@-plugin-scmbzr
+plugins/scmbzr/bin/* @PLUGIN_PATH@/scmbzr/bin/
plugins/scmbzr/common/* @PLUGIN_PATH@/scmbzr/common/
plugins/scmbzr/etc/plugins/scmbzr/* etc/gforge/plugins/scmbzr/
plugins/scmbzr/etc/*.ini etc/@PACKAGE@/config.ini.d/