Scarab commit: svn commit: r10333 - trunk/build: . scripts

[email protected]
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: ptillemans
Date: 2006-11-07 07:55:42-0800
New Revision: 10333

Added:
   trunk/build/README.Debian.template
   trunk/build/changelog.template
   trunk/build/conffiles.template
   trunk/build/control.template
   trunk/build/copyright.template
   trunk/build/default.template
   trunk/build/maintenance.template
   trunk/build/policy.template
   trunk/build/scripts/

Log:
SCB2123: support for debian packages

Added: trunk/build/README.Debian.template
Url: http://scarab.tigris.org/source/browse/scarab/trunk/build/README.Debian.template?view=auto&rev=10333
==============================================================================
--- (empty file)
+++ trunk/build/README.Debian.template	2006-11-07 07:55:42-0800
@@ -0,0 +1,63 @@
+==================
+Installation Notes
+==================
+
+The debian package has support for 
+
+ * Deploying the scarab instance war into the tomcat **webapps** folder
+
+ * daily backups of the database and attachment folders
+
+ * configurable through **/etc/default/scarab-@CONTEXT@**
+
+ * running the tomcat server using a security manager.
+
+
+Generating the debian package
+=============================
+
+Contrary to the *normal* install instructions these assume that multiple 
+scarab instances will be deployed on the same server. The package name is 
+defined to be **scarab-<context>**, the version is generated from the upstream
+release and the timestamp of the time of build.
+
+The context is defined in the **build.properties** file:: 
+
+  scarab.context=@CONTEXT@
+  maven.war.final.name=${scarab.context}.war
+
+Note : It is needed to define the *maven.war.final.name* to reflect the 
+context name, as tomcat will use the name of the war file as context.
+
+Support for different debian distributions
+==========================================
+
+The only relevant difference between the debian distributions is the version number of tomcat
+provided in the apt reporsitories. (e.g. debian sarge uses tomcat4 and ubuntu edgy has tomcat5).
+This is handled by this parameter ::
+
+  debian.tomcat.version=tomcat5
+
+Enabling LDAP support
+=====================
+
+To use LDAP under debian deployed scarab instances add the following properties and adjust for the local circumstances ::
+
+  scarab.login.ldap.synchronizeOnStartUp=true
+  scarab.login.ldap.providerFactory=com.sun.jndi.ldap.LdapCtxFactory 
+  scarab.login.ldap.providerUrl=ldap://ldap1.tess.elex.be/
+  scarab.login.ldap.ldapQuery=(objectClass=elexPerson)
+  scarab.login.ldap.baseDn=dc=elex
+
+Now we must tell tomcat to use the provided jaas.conf file. I would recommend to copy this file to the tomcat conf directory ::
+
+  sudo cp /var/lib/tomcat5/webapps/@CONTEXT@/WEB-INF/conf/jaas.conf /etc/tomcat5/
+  sudo vi /etc/default/tomcat5
+
+Then uncomment the **CATALINA_OPTS** variable and add the system property to point to the jaas.conf file.
+
+  CATALINA_OPTS="-Djava.security.auth.login.config=/etc/tomcat5/jaas.conf -Djava.awt.headless=true -Xmx128M -server"
+
+
+Peter Tillemans <[email protected]>   October 20th, 2006
+

Added: trunk/build/changelog.template
Url: http://scarab.tigris.org/source/browse/scarab/trunk/build/changelog.template?view=auto&rev=10333
==============================================================================
--- (empty file)
+++ trunk/build/changelog.template	2006-11-07 07:55:42-0800
@@ -0,0 +1,7 @@
+scarab-@CONTEXT@ (@VERSION@) unstable contrib; urgency=low
+
+ * automatically created debian package for scarab
+ This is the initial attempt to generate debian packages for scarab instances
+
+ -- Peter Tillemans <[email protected]> October 20, 2006
+

Added: trunk/build/conffiles.template
Url: http://scarab.tigris.org/source/browse/scarab/trunk/build/conffiles.template?view=auto&rev=10333
==============================================================================
--- (empty file)
+++ trunk/build/conffiles.template	2006-11-07 07:55:42-0800
@@ -0,0 +1,3 @@
+/etc/default/scarab-@CONTEXT@
+/etc/cron.daily/scarab-@[email protected]
+/etc/@TOMCAT@/policy.d/@[email protected]

Added: trunk/build/control.template
Url: http://scarab.tigris.org/source/browse/scarab/trunk/build/control.template?view=auto&rev=10333
==============================================================================
--- (empty file)
+++ trunk/build/control.template	2006-11-07 07:55:42-0800
@@ -0,0 +1,16 @@
+Package: scarab-@CONTEXT@
+Version: @VERSION@
+Section: admin
+Priority: optional
+Architecture: all
+Depends: @TOMCAT@
+Recommends:
+Suggests:
+Conflicts:
+Replaces:
+Provides:
+Installed-Size: 47408K
+Maintainer: Peter Tillemans <[email protected]>
+Description: Scarab instance @CONTEXT@ issuetracker
+ This is a customized version of scarab for the @CONTEXT@ issuetracker.
+

Added: trunk/build/copyright.template
Url: http://scarab.tigris.org/source/browse/scarab/trunk/build/copyright.template?view=auto&rev=10333
==============================================================================
--- (empty file)
+++ trunk/build/copyright.template	2006-11-07 07:55:42-0800
@@ -0,0 +1,68 @@
+This package was debianized by Peter Tillemans <pti@xtrion> on
+@DATE@.
+
+It was downloaded from svn://scarab.tigris.org/svn/scarab/trunk
+
+Upstream Author: Scarab Developers <[email protected]> 
+
+Copyright: 2000-2006 CollabNet.  All rights reserved.
+          
+
+License:
+
+
+
+
+/* ================================================================
+ * Copyright (c) 2000-2003 CollabNet.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement: "This product includes
+ * software developed by CollabNet <http://www.Collab.Net/>."
+ * Alternately, this acknowlegement may appear in the software itself, if
+ * and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The hosted project names must not be used to endorse or promote
+ * products derived from this software without prior written
+ * permission. For written permission, please contact [email protected].
+ *
+ * 5. Products derived from this software may not use the "Tigris" or
+ * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without
+ * prior written permission of CollabNet.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of CollabNet.
+ */
+
+The Debian packaging is (C) 2006, Peter Tillemans <[email protected]> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
+

Added: trunk/build/default.template
Url: http://scarab.tigris.org/source/browse/scarab/trunk/build/default.template?view=auto&rev=10333
==============================================================================
--- (empty file)
+++ trunk/build/default.template	2006-11-07 07:55:42-0800
@@ -0,0 +1,26 @@
+#
+# this variable contains the location where the 
+# database and the attachments should be archived
+# for backup purposes
+#
+BACKUP_DIR=/var/backups/scarab
+#
+# This variable will be used as the base name for the database
+# dump and the attachment archive. When 
+#
+# for multiple backups per day use 
+#
+# BASENAME=@CONTEXT@-`date +%Y%m%d%H%M`
+#
+# if only one backup per day is wanted the default is Ok
+#
+BASENAME=@CONTEXT@-`date +%Y%m%d`
+
+#
+# Database connection parameter for backing up the database
+#
+DBNAME=@DBNAME@
+DBTYPE=@DBTYPE@
+DBUSER=@DBUSER@
+DBPASS=@DBPASS@
+

Added: trunk/build/maintenance.template
Url: http://scarab.tigris.org/source/browse/scarab/trunk/build/maintenance.template?view=auto&rev=10333
==============================================================================
--- (empty file)
+++ trunk/build/maintenance.template	2006-11-07 07:55:42-0800
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+. /etc/default/scarab-@CONTEXT@
+
+if [ ! -d ${BACKUP_DIR} ]
+then
+   mkdir -p ${BACKUP_DIR}
+   chmod 1777 ${BACKUP_DIR}
+fi
+
+cd /var/lib/@TOMCAT@/webapps/@CONTEXT@
+
+# if no attachments have been uploaded this directory does not exits yet
+# but then it does not make sense to back them up.
+if [ -d @ATTACHMENTS@ ]
+then
+  tar -czvf ${BACKUP_DIR}/${BASENAME}.tar.gz @ATTACHMENTS@
+fi
+
+
+if [ "${DBTYPE}" == "mysql" ]
+then
+   mysqldump --user=@DBUSER@ --password=@DBPASS@ @DBNAME@ > ${BACKUP_DIR}/${BASENAME}.dmp
+fi
+
+if [ "${DBTYPE}" == "postgres" ]
+then
+   su postres -c "pg_dump -b -Fc -f ${BACKUP_DIR}/${BASENAME}.fc @DBNAME@ > ${BACKUP_DIR}/${BASENAME}.log"
+fi
+
+

Added: trunk/build/policy.template
Url: http://scarab.tigris.org/source/browse/scarab/trunk/build/policy.template?view=auto&rev=10333
==============================================================================
--- (empty file)
+++ trunk/build/policy.template	2006-11-07 07:55:42-0800
@@ -0,0 +1,22 @@
+grant codeBase "file:${catalina.home}/webapps/@CONTEXT@/WEB-INF/-" {
+	permission java.io.FilePermission "${catalina.home}/webapps/@CONTEXT@/logs", "read,write";
+	permission java.io.FilePermission "${catalina.home}/webapps/@CONTEXT@/logs/*", "read,write";
+	permission java.io.FilePermission "${catalina.home}/webapps/@CONTEXT@/WEB-INF/-", "read,write,delete";
+	permission java.io.FilePermission "WEB-INF/-", "read,write,delete";
+	permission java.io.FilePermission "quartz.properties", "read,write,delete";
+        permission java.net.SocketPermission "localhost:12345", "listen";
+        permission java.net.SocketPermission "localhost:3306", "connect";
+        permission java.net.SocketPermission "localhost:5432", "connect";
+        permission java.net.SocketPermission "ldap1.tess.elex.be:389", "connect";
+        permission java.net.SocketPermission "ldap2.tess.elex.be:389", "connect";
+        permission java.net.SocketPermission "*.elex.be:389", "connect";
+	permission java.lang.RuntimePermission "accessDeclaredMembers", "";
+	permission java.lang.RuntimePermission "setContextClassLoader", "";
+	permission java.lang.RuntimePermission "reflectionFactoryAccess", "";
+	permission java.lang.RuntimePermission "accessClassInPackage.sun.misc", "";
+	permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect", "";
+	permission java.lang.reflect.ReflectPermission "suppressAccessChecks", "";
+	permission java.util.PropertyPermission "*", "read,write"; 
+	permission javax.security.auth.AuthPermission "createLoginContext.Scarab", "";
+
+};
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.