Import package vendor original specs for necessary manipulations.

Mon, 22 Nov 2010 12:39:58 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 22 Nov 2010 12:39:58 +0100
changeset 290
731574048d85
parent 289
1ff6f25dc4d9
child 291
52571005077f

Import package vendor original specs for necessary manipulations.

davical/davical-apache.conf file | annotate | diff | comparison | revisions
davical/davical-config.php file | annotate | diff | comparison | revisions
davical/davical-setup.sh file | annotate | diff | comparison | revisions
davical/davical.patch file | annotate | diff | comparison | revisions
davical/davical.spec file | annotate | diff | comparison | revisions
davical/rc.davical file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/davical/davical-apache.conf	Mon Nov 22 12:39:58 2010 +0100
     1.3 @@ -0,0 +1,98 @@
     1.4 +##
     1.5 +##  davical-apache.conf -- DAViCal Apache Custom Configuration
     1.6 +##
     1.7 +
     1.8 +ServerRoot             @l_prefix@
     1.9 +ServerAdmin            root@@l_hostname@.@l_domainname@
    1.10 +ServerName             @l_hostname@.@l_domainname@
    1.11 +ServerTokens           Prod
    1.12 +User                   @l_rusr@
    1.13 +Group                  @l_rgrp@
    1.14 +<IfDefine !SSL>
    1.15 +Listen                 127.0.0.1:8080
    1.16 +</IfDefine>
    1.17 +<IfDefine SSL>
    1.18 +Listen                 127.0.0.1:8443
    1.19 +</IfDefine>
    1.20 +
    1.21 +#   runtime files
    1.22 +PidFile                @l_prefix@/var/davical/run/apache.pid
    1.23 +ScoreBoardFile         @l_prefix@/var/davical/run/apache.sb
    1.24 +LockFile               @l_prefix@/var/davical/run/apache.lck
    1.25 +
    1.26 +#   include apache-php
    1.27 +Include                @l_prefix@/etc/apache/apache.d/apache-php.conf
    1.28 +
    1.29 +#  server behaviour
    1.30 +Timeout                300
    1.31 +KeepAlive              on
    1.32 +MaxKeepAliveRequests   100
    1.33 +KeepAliveTimeout       15
    1.34 +MinSpareServers        5
    1.35 +MaxSpareServers        10
    1.36 +StartServers           5
    1.37 +MaxClients             15
    1.38 +MaxRequestsPerChild    500
    1.39 +HostnameLookups        off
    1.40 +UseCanonicalName       on
    1.41 +
    1.42 +#   access logging
    1.43 +LogFormat              "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    1.44 +LogFormat              "%h %l %u %t \"%r\" %>s %b" common
    1.45 +LogFormat              "%{Referer}i -> %U" referer
    1.46 +LogFormat              "%{User-agent}i" agent
    1.47 +CustomLog              @l_prefix@/var/davical/log/apache.access.log common
    1.48 +
    1.49 +#   error logging
    1.50 +LogLevel               warn
    1.51 +ErrorLog               @l_prefix@/var/davical/log/apache.error.log
    1.52 +ServerSignature        on
    1.53 +
    1.54 +#   SSL/TLS support
    1.55 +<IfDefine SSL>
    1.56 +SSLEngine              on
    1.57 +SSLRandomSeed          startup builtin
    1.58 +SSLRandomSeed          connect builtin
    1.59 +SSLMutex               sem
    1.60 +SSLCADNRequestFile     @l_prefix@/etc/x509/example-ca.crt.pem
    1.61 +SSLCACertificateFile   @l_prefix@/etc/x509/example-ca.crt.pem
    1.62 +SSLCertificateFile     @l_prefix@/etc/x509/example-server.crt.pem
    1.63 +SSLCertificateKeyFile  @l_prefix@/etc/x509/example-server.key.pem
    1.64 +SSLSessionCache        shm:@l_prefix@/var/davical/run/apache.ssl_scache(512000)
    1.65 +SSLSessionCacheTimeout 300
    1.66 +SSLCipherSuite         ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    1.67 +SetEnvIf               User-Agent ".*MSIE.*" \
    1.68 +                       nokeepalive ssl-unclean-shutdown \
    1.69 +                       downgrade-1.0 force-response-1.0
    1.70 +</IfDefine>
    1.71 +
    1.72 +#   secure root directory
    1.73 +<Directory />
    1.74 +    Options FollowSymLinks
    1.75 +    AllowOverride None
    1.76 +</Directory>
    1.77 +
    1.78 +#   configure PHP
    1.79 +AddType           application/x-httpd-php .php
    1.80 +php_admin_flag    magic_quotes_gpc        on
    1.81 +php_admin_flag    register_globals        on
    1.82 +php_admin_flag    register_argc_argv      off
    1.83 +
    1.84 +#   configure DAViCal
    1.85 +php_value         include_path            @l_prefix@/lib/davical/davical/inc:@l_prefix@/lib/davical/awl/inc
    1.86 +php_value         error_reporting         "E_ALL & ~E_NOTICE"
    1.87 +php_value         default_charset         "utf-8"
    1.88 +RewriteEngine     on
    1.89 +RewriteRule       ^/caldav/(.*)$          /caldav.php/$1 [PT]
    1.90 +DocumentRoot      @l_prefix@/lib/davical/davical/htdocs
    1.91 +DirectoryIndex    index.php
    1.92 +<Directory        @l_prefix@/lib/davical/davical/htdocs>
    1.93 +    <IfDefine SSL>
    1.94 +        SSLOptions +StdEnvVars
    1.95 +    </IfDefine>
    1.96 +    Options       None
    1.97 +    AllowOverride None
    1.98 +    Order         allow,deny
    1.99 +    Allow         from all
   1.100 +</Directory>
   1.101 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/davical/davical-config.php	Mon Nov 22 12:39:58 2010 +0100
     2.3 @@ -0,0 +1,20 @@
     2.4 +<?php
     2.5 +##
     2.6 +##  davical.php -- DAViCal server configuration
     2.7 +##
     2.8 +
     2.9 +$c->system_name                 = "DAViCal CalDAV Server";
    2.10 +$c->domain_name                 = "calendar.example.com";
    2.11 +$c->admin_email                 = 'hostmaster@example.com';
    2.12 +
    2.13 +$c->pg_connect[]                = "dbname=davical user=davical password=davical";
    2.14 +
    2.15 +$c->home_calendar_name          = 'home';
    2.16 +$c->hide_TODO                   = true;
    2.17 +$c->readonly_webdav_collections = true;
    2.18 +$c->enable_row_linking          = true;
    2.19 +$c->collections_always_exist    = true;
    2.20 +$c->default_relationships       = array();
    2.21 +$c->default_locale              = 'en_US.UTF-8';
    2.22 +$c->allow_get_email_visibility  = false;
    2.23 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/davical/davical-setup.sh	Mon Nov 22 12:39:58 2010 +0100
     3.3 @@ -0,0 +1,86 @@
     3.4 +#!/bin/sh
     3.5 +##
     3.6 +##  davical-setup
     3.7 +##
     3.8 +
     3.9 +#   command line argument sanity check
    3.10 +prg="$0"
    3.11 +if [ $# -eq 0 ]; then
    3.12 +    echo "$prg:ERROR: invalid command line" 1>&2
    3.13 +    echo "$prg:USAGE: $prg install [<admin-password>]" 1>&2
    3.14 +    echo "$prg:USAGE: $prg uninstall" 1>&2
    3.15 +    echo "$prg:USAGE: $prg edit" 1>&2
    3.16 +    exit 1
    3.17 +fi
    3.18 +
    3.19 +#   database configuration
    3.20 +db_dir="@l_prefix@/var/davical/db"
    3.21 +db_name="davical"
    3.22 +db_user="davical"
    3.23 +db_pass="davical"
    3.24 +db_sname=`grep "^superuser_database" @l_prefix@/var/postgresql/db/pg_superuser.conf |\
    3.25 +          sed -e 's;^ *superuser_database="\(.*\)".*;\1;'`
    3.26 +db_suser=`grep "^superuser_username" @l_prefix@/var/postgresql/db/pg_superuser.conf |\
    3.27 +          sed -e 's;^ *superuser_username="\(.*\)".*;\1;'`
    3.28 +db_spass=`grep "^superuser_password" @l_prefix@/var/postgresql/db/pg_superuser.conf |\
    3.29 +          sed -e 's;^ *superuser_password="\(.*\)".*;\1;'`
    3.30 +
    3.31 +#   dispatch operation
    3.32 +cmd="${1:-"install"}"
    3.33 +shift
    3.34 +case "$cmd" in
    3.35 +    install )
    3.36 +        #   determine admin password
    3.37 +        admin_password="$1"
    3.38 +        if [ ".$admin_password" = . ]; then
    3.39 +            admin_password="`@l_prefix@/bin/apg -Mncl -a1 -m12 -n1`"
    3.40 +            echo "ATTENTION: using generated \"admin\" password: \"$admin_password\"" 1>&2
    3.41 +        fi
    3.42 +
    3.43 +        #   create database
    3.44 +        ( echo "CREATE ROLE $db_user LOGIN ENCRYPTED PASSWORD '$db_pass' NOCREATEDB NOCREATEUSER;"
    3.45 +          echo "CREATE TABLESPACE $db_name OWNER $db_user LOCATION '$db_dir';"
    3.46 +          echo "CREATE DATABASE $db_name OWNER $db_user TABLESPACE $db_name ENCODING 'UTF8';"
    3.47 +        ) | PGPASSWORD="$db_spass" @l_prefix@/bin/psql -q -U "$db_suser" -d "$db_sname" -f-
    3.48 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" \
    3.49 +            -c "CREATE LANGUAGE plpgsql;"
    3.50 +
    3.51 +        #   create schema 1/2 (from original "create_database" script)
    3.52 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" -A -t \
    3.53 +            -f "@l_prefix@/lib/davical/awl/dba/awl-tables.sql" 2>&1 | grep -v NOTICE
    3.54 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" -A -t \
    3.55 +            -f "@l_prefix@/lib/davical/awl/dba/schema-management.sql" 2>&1 | grep -v NOTICE
    3.56 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" -A -t \
    3.57 +            -f "@l_prefix@/lib/davical/davical/dba/davical.sql" 2>&1 | grep -v NOTICE
    3.58 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" -A -t \
    3.59 +            -f "@l_prefix@/lib/davical/davical/dba/base-data.sql" 2>&1 | grep -v NOTICE
    3.60 +
    3.61 +        #   create schema 2/2 (from original "update-davical-database" script)
    3.62 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" -A -t \
    3.63 +            -f "@l_prefix@/lib/davical/davical/dba/supported_locales.sql" 2>&1 | grep -v NOTICE
    3.64 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" -A -t \
    3.65 +            -f "@l_prefix@/lib/davical/davical/dba/caldav_functions.sql" 2>&1 | egrep -v '(NOTICE|ERROR)'
    3.66 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" -A -t \
    3.67 +            -f "@l_prefix@/lib/davical/davical/dba/rrule_functions.sql" 2>&1 | egrep -v '(NOTICE|ERROR)'
    3.68 +        PGPASSWORD="$db_spass" @l_prefix@/bin/psql -q -U "$db_suser" -d "$db_name" -A -t \
    3.69 +            -f "@l_prefix@/lib/davical/davical/dba/appuser_permissions.txt" 2>&1 | grep -v NOTICE
    3.70 +
    3.71 +        #   set admin password
    3.72 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" \
    3.73 +            -c "UPDATE usr SET password = '**$admin_password' WHERE user_no = 1;"
    3.74 +        ;;
    3.75 +
    3.76 +    uninstall )
    3.77 +        PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d "$db_name" \
    3.78 +            -c "DROP LANGUAGE plpgsql CASCADE;" 2>&1 | grep -v NOTICE
    3.79 +        ( echo "DROP DATABASE $db_name;"
    3.80 +          echo "DROP TABLESPACE $db_name;"
    3.81 +          echo "DROP ROLE $db_user;"
    3.82 +        ) | PGPASSWORD="$db_spass" @l_prefix@/bin/psql -q -U "$db_suser" -d "$db_sname" -f-
    3.83 +        ;;
    3.84 +
    3.85 +    edit )
    3.86 +        PGPASSWORD="$db_spass" @l_prefix@/bin/psql -U "$db_suser" -d "$db_name"
    3.87 +        ;;
    3.88 +esac
    3.89 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/davical/davical.patch	Mon Nov 22 12:39:58 2010 +0100
     4.3 @@ -0,0 +1,121 @@
     4.4 +Index: davical-0.9.9.3/dba/appuser_permissions.txt
     4.5 +--- davical-0.9.9.3/dba/appuser_permissions.txt.orig	2010-04-19 02:32:58.000000000 +0200
     4.6 ++++ davical-0.9.9.3/dba/appuser_permissions.txt	2010-09-21 17:32:46.000000000 +0200
     4.7 +@@ -17,49 +17,53 @@
     4.8 + #
     4.9 + 
    4.10 + GRANT SELECT,INSERT,UPDATE,DELETE
    4.11 +-  ON collection
    4.12 +-  ON caldav_data
    4.13 +-  ON calendar_item
    4.14 +-  ON relationship
    4.15 +-  ON locks
    4.16 +-  ON property
    4.17 +-  ON freebusy_ticket
    4.18 +-  ON usr
    4.19 +-  ON usr_setting
    4.20 +-  ON roles
    4.21 +-  ON role_member
    4.22 +-  ON session
    4.23 +-  ON tmp_password
    4.24 +-  ON group_member
    4.25 +-  ON principal
    4.26 +-  ON relationship_type
    4.27 +-  ON sync_tokens
    4.28 +-  ON sync_changes
    4.29 +-  ON grants
    4.30 +-  ON dav_principal
    4.31 +-  ON access_ticket
    4.32 +-  ON dav_binding
    4.33 +-  ON calendar_alarm
    4.34 +-  ON calendar_attendee
    4.35 +-  ON addressbook_resource
    4.36 +-  ON addressbook_address_adr
    4.37 +-  ON addressbook_address_tel
    4.38 +-  ON addressbook_address_email
    4.39 ++  ON collection,
    4.40 ++     caldav_data,
    4.41 ++     calendar_item,
    4.42 ++     relationship,
    4.43 ++     locks,
    4.44 ++     property,
    4.45 ++     freebusy_ticket,
    4.46 ++     usr,
    4.47 ++     usr_setting,
    4.48 ++     roles,
    4.49 ++     role_member,
    4.50 ++     session,
    4.51 ++     tmp_password,
    4.52 ++     group_member,
    4.53 ++     principal,
    4.54 ++     relationship_type,
    4.55 ++     sync_tokens,
    4.56 ++     sync_changes,
    4.57 ++     grants,
    4.58 ++     dav_principal,
    4.59 ++     access_ticket,
    4.60 ++     dav_binding,
    4.61 ++     calendar_alarm,
    4.62 ++     calendar_attendee,
    4.63 ++     addressbook_resource,
    4.64 ++     addressbook_address_adr,
    4.65 ++     addressbook_address_tel,
    4.66 ++     addressbook_address_email
    4.67 ++  TO davical;
    4.68 + 
    4.69 + GRANT SELECT,UPDATE
    4.70 +-  ON relationship_type_rt_id_seq
    4.71 +-  ON dav_id_seq
    4.72 +-  ON usr_user_no_seq
    4.73 +-  ON roles_role_no_seq
    4.74 +-  ON session_session_id_seq
    4.75 +-  ON principal_type_principal_type_id_seq
    4.76 +-  ON sync_tokens_sync_token_seq
    4.77 ++  ON relationship_type_rt_id_seq,
    4.78 ++     dav_id_seq,
    4.79 ++     usr_user_no_seq,
    4.80 ++     roles_role_no_seq,
    4.81 ++     session_session_id_seq,
    4.82 ++     principal_type_principal_type_id_seq,
    4.83 ++     sync_tokens_sync_token_seq
    4.84 ++  TO davical;
    4.85 + 
    4.86 + GRANT SELECT,INSERT
    4.87 +   ON time_zone
    4.88 ++  TO davical;
    4.89 + 
    4.90 + GRANT SELECT
    4.91 +-  ON supported_locales
    4.92 +-  ON awl_db_revision
    4.93 +-  ON principal_type
    4.94 ++  ON supported_locales,
    4.95 ++     awl_db_revision,
    4.96 ++     principal_type
    4.97 ++  TO davical;
    4.98 + 
    4.99 +Index: davical-0.9.9.3/inc/always.php.in
   4.100 +--- davical-0.9.9.3/inc/always.php.in.orig	2010-09-21 03:40:44.000000000 +0200
   4.101 ++++ davical-0.9.9.3/inc/always.php.in	2010-09-21 18:20:41.000000000 +0200
   4.102 +@@ -117,20 +117,8 @@
   4.103 + * too early.
   4.104 + */
   4.105 + ob_start( );
   4.106 +-if ( @file_exists('/etc/davical/'.$_SERVER['SERVER_NAME'].'-conf.php') ) {
   4.107 +-  include('/etc/davical/'.$_SERVER['SERVER_NAME'].'-conf.php');
   4.108 +-}
   4.109 +-else if ( @file_exists('/etc/davical/config.php') ) {
   4.110 +-  include('/etc/davical/config.php');
   4.111 +-}
   4.112 +-else if ( @file_exists('/usr/local/etc/davical/'.$_SERVER['SERVER_NAME'].'-conf.php') ) {
   4.113 +-  include('/usr/local/etc/davical/'.$_SERVER['SERVER_NAME'].'-conf.php');
   4.114 +-}
   4.115 +-else if ( @file_exists('/usr/local/etc/davical/config.php') ) {
   4.116 +-  include('/usr/local/etc/davical/config.php');
   4.117 +-}
   4.118 +-else if ( @file_exists('../config/config.php') ) {
   4.119 +-  include('../config/config.php');
   4.120 ++if ( @file_exists("@l_prefix@/etc/davical/davical-config.php") ) {
   4.121 ++  include_once("@l_prefix@/etc/davical/davical-config.php");
   4.122 + }
   4.123 + else if ( @file_exists('config/config.php') ) {
   4.124 +   include('config/config.php');
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/davical/davical.spec	Mon Nov 22 12:39:58 2010 +0100
     5.3 @@ -0,0 +1,204 @@
     5.4 +##
     5.5 +##  davical.spec -- OpenPKG RPM Package Specification
     5.6 +##  Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
     5.7 +##
     5.8 +##  Permission to use, copy, modify, and distribute this software for
     5.9 +##  any purpose with or without fee is hereby granted, provided that
    5.10 +##  the above copyright notice and this permission notice appear in all
    5.11 +##  copies.
    5.12 +##
    5.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    5.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    5.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    5.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    5.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    5.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    5.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    5.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    5.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    5.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    5.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    5.24 +##  SUCH DAMAGE.
    5.25 +##
    5.26 +
    5.27 +#   package version
    5.28 +%define       V_opkg    0.9.9.3
    5.29 +%define       V_davical 0.9.9.3
    5.30 +%define       V_awl     0.37
    5.31 +
    5.32 +#   package information
    5.33 +Name:         davical
    5.34 +Summary:      CalDAV Server
    5.35 +URL:          http://rscds.sourceforge.net/
    5.36 +Vendor:       Andrew McMillan
    5.37 +Packager:     OpenPKG Foundation e.V.
    5.38 +Distribution: OpenPKG Community
    5.39 +Class:        EVAL
    5.40 +Group:        Network
    5.41 +License:      GPL
    5.42 +Version:      %{V_opkg}
    5.43 +Release:      20100926
    5.44 +
    5.45 +#   package options
    5.46 +%define       with_ssl  no
    5.47 +
    5.48 +#   list of sources
    5.49 +Source0:      http://debian.mcmillan.net.nz/packages/davical/davical-%{V_davical}.tar.gz
    5.50 +Source1:      http://debian.mcmillan.net.nz/packages/awl/awl_%{V_awl}.tar.gz
    5.51 +Source2:      davical-config.php
    5.52 +Source3:      davical-apache.conf
    5.53 +Source4:      davical-setup.sh
    5.54 +Source5:      rc.davical
    5.55 +Patch0:       davical.patch
    5.56 +
    5.57 +#   build information
    5.58 +BuildPreReq:  OpenPKG, openpkg >= 20100101
    5.59 +PreReq:       OpenPKG, openpkg >= 20100101
    5.60 +PreReq:       pcre, pcre::with_utf8
    5.61 +PreReq:       apache
    5.62 +%if "%{with_ssl}" == "yes"
    5.63 +PreReq:       apache::with_mod_ssl = yes, x509
    5.64 +%endif
    5.65 +PreReq:       apache-php
    5.66 +PreReq:       apache-php::with_pgsql = yes
    5.67 +PreReq:       apache-php::with_gettext = yes
    5.68 +PreReq:       postgresql
    5.69 +
    5.70 +%description
    5.71 +    The DAViCal CalDAV Server is a repository for calendar, schedule,
    5.72 +    todo and journal entries which may be accessed with CalDAV capable
    5.73 +    client software.
    5.74 +
    5.75 +%track
    5.76 +    prog davical:davical = {
    5.77 +        version   = %{V_davical}
    5.78 +        url       = http://debian.mcmillan.net.nz/packages/davical/
    5.79 +        regex     = davical-(__VER__)\.tar\.gz
    5.80 +    }
    5.81 +    prog davical:awl = {
    5.82 +        version   = %{V_awl}
    5.83 +        url       = http://debian.mcmillan.net.nz/packages/awl/
    5.84 +        regex     = awl_(__VER__)\.tar\.gz
    5.85 +    }
    5.86 +
    5.87 +%prep
    5.88 +    %setup -q -c
    5.89 +    %setup -q -T -D -a 1
    5.90 +    %patch -p0
    5.91 +
    5.92 +%build
    5.93 +
    5.94 +%install
    5.95 +    #   create installation hierarchy
    5.96 +    %{l_shtool} mkdir -f -p -m 755 \
    5.97 +        $RPM_BUILD_ROOT%{l_prefix}/sbin \
    5.98 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
    5.99 +        $RPM_BUILD_ROOT%{l_prefix}/etc/davical \
   5.100 +        $RPM_BUILD_ROOT%{l_prefix}/lib/davical/davical \
   5.101 +        $RPM_BUILD_ROOT%{l_prefix}/lib/davical/awl \
   5.102 +        $RPM_BUILD_ROOT%{l_prefix}/var/davical/db \
   5.103 +        $RPM_BUILD_ROOT%{l_prefix}/var/davical/run \
   5.104 +        $RPM_BUILD_ROOT%{l_prefix}/var/davical/log
   5.105 +
   5.106 +    #   install program components
   5.107 +    find . -name "*.orig" -print | xargs rm -f
   5.108 +    cp -r \
   5.109 +        awl-%{V_awl}/dba \
   5.110 +        awl-%{V_awl}/inc \
   5.111 +        $RPM_BUILD_ROOT%{l_prefix}/lib/davical/awl/
   5.112 +    rm -f davical-%{V_davical}/inc/always.php.in
   5.113 +    %{l_shtool} subst %{l_value -s -a} \
   5.114 +        davical-%{V_davical}/inc/always.php
   5.115 +    cp -r \
   5.116 +        davical-%{V_davical}/dba \
   5.117 +        davical-%{V_davical}/inc \
   5.118 +        davical-%{V_davical}/htdocs \
   5.119 +        $RPM_BUILD_ROOT%{l_prefix}/lib/davical/davical/
   5.120 +
   5.121 +    #   install DAViCal application configuration file
   5.122 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   5.123 +        %{SOURCE davical-config.php} \
   5.124 +        $RPM_BUILD_ROOT%{l_prefix}/etc/davical/
   5.125 +
   5.126 +    #   install DAViCal Apache configuration file
   5.127 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   5.128 +        %{SOURCE davical-apache.conf} \
   5.129 +        $RPM_BUILD_ROOT%{l_prefix}/etc/davical/
   5.130 +
   5.131 +    #   install run-command script
   5.132 +%if "%{with_ssl}" == "yes"
   5.133 +    with_ssl="-DSSL"
   5.134 +%else
   5.135 +    with_ssl=""
   5.136 +%endif
   5.137 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   5.138 +        -e "s;@with_ssl@;$with_ssl;" \
   5.139 +        %{SOURCE rc.davical} \
   5.140 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   5.141 +
   5.142 +    #   install RDBMS setup script
   5.143 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   5.144 +        %{SOURCE davical-setup.sh} \
   5.145 +        $RPM_BUILD_ROOT%{l_prefix}/sbin/davical-setup
   5.146 +
   5.147 +    #   determine installation files
   5.148 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   5.149 +        %{l_files_std} \
   5.150 +        '%config %{l_prefix}/etc/davical/*' \
   5.151 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/davical' \
   5.152 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/davical/*'
   5.153 +
   5.154 +%files -f files
   5.155 +
   5.156 +%clean
   5.157 +
   5.158 +%post
   5.159 +    if [ $1 -eq 1 ]; then
   5.160 +        #   display final hints on initial installation
   5.161 +        ( echo "1. To complete this installation of Drupal please start PostgreSQL"
   5.162 +          echo "   and initialize the DAViCal database like this:"
   5.163 +          echo "     \$ $RPM_INSTALL_PREFIX/bin/openpkg rc postgresql start"
   5.164 +          echo "     \$ $RPM_INSTALL_PREFIX/sbin/davical-setup install"
   5.165 +          echo ""
   5.166 +          echo "2. By default, DAViCal runs its own SSL/TLS based Apache server"
   5.167 +          echo "   under 127.0.0.1, TCP port 8443. Please change this by editing"
   5.168 +          echo "   the \"Listen 127.0.0.1:8443\" directive in:"
   5.169 +          echo "     $RPM_INSTALL_PREFIX/etc/davical/davical-apache.conf"
   5.170 +          echo ""
   5.171 +          echo "3. Now start DAViCal by running the command"
   5.172 +          echo "     \$ $RPM_INSTALL_PREFIX/bin/openpkg rc davical start"
   5.173 +          echo "   and connect with a browser to the URL"
   5.174 +%if "%{with_ssl}" == "yes"
   5.175 +          echo "     https://127.0.0.1:8443/"
   5.176 +%else
   5.177 +          echo "     https://127.0.0.1:8080/"
   5.178 +%endif
   5.179 +          echo "   and create user accounts."
   5.180 +          echo ""
   5.181 +          echo "4. Now you are able to subscribe to user \"example\"'s \"home\""
   5.182 +          echo "   calendar with a CalDAV client through the URL"
   5.183 +%if "%{with_ssl}" == "yes"
   5.184 +          echo "     https://127.0.0.1:8443/caldav/example/home"
   5.185 +%else
   5.186 +          echo "     http://127.0.0.1:8080/caldav/example/home"
   5.187 +%endif
   5.188 +        ) | %{l_rpmtool} msg -b -t notice
   5.189 +    fi
   5.190 +    if [ $1 -eq 2 ]; then
   5.191 +        #   after upgrade, restart service
   5.192 +        eval `%{l_rc} davical status 2>/dev/null`
   5.193 +        [ ".$davical_active" = .yes ] && %{l_rc} davical restart
   5.194 +    fi
   5.195 +    exit 0
   5.196 +
   5.197 +%preun
   5.198 +    if [ $1 -eq 0 ]; then
   5.199 +        #   before erase, stop service and remove log files
   5.200 +        %{l_rc} davical stop 2>/dev/null
   5.201 +        $RPM_INSTALL_PREFIX/sbin/davical-setup uninstall >/dev/null 2>&1 || true
   5.202 +        rm -f $RPM_INSTALL_PREFIX/var/davical/log/*   >/dev/null 2>&1 || true
   5.203 +        rm -f $RPM_INSTALL_PREFIX/var/davical/run/*   >/dev/null 2>&1 || true
   5.204 +        rm -f $RPM_INSTALL_PREFIX/var/davical/db/*    >/dev/null 2>&1 || true
   5.205 +    fi
   5.206 +    exit 0
   5.207 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/davical/rc.davical	Mon Nov 22 12:39:58 2010 +0100
     6.3 @@ -0,0 +1,39 @@
     6.4 +#!@l_prefix@/bin/openpkg rc
     6.5 +##
     6.6 +##  rc.davical -- Run-Commands
     6.7 +##
     6.8 +
     6.9 +%config
    6.10 +    davical_enable="$openpkg_rc_def"
    6.11 +
    6.12 +%status -u @l_susr@ -o
    6.13 +    davical_usable="no"
    6.14 +    davical_active="no"
    6.15 +    @l_prefix@/sbin/apache -t \
    6.16 +        -f @l_prefix@/etc/davical/davical-apache.conf 2>/dev/null && \
    6.17 +        davical_usable="yes"
    6.18 +    [ -f @l_prefix@/var/davical/run/apache.pid ] && \
    6.19 +        kill -0 `cat @l_prefix@/var/davical/run/apache.pid` && \
    6.20 +        davical_active="yes"
    6.21 +    echo "davical_enable=\"$davical_enable\""
    6.22 +    echo "davical_usable=\"$davical_usable\""
    6.23 +    echo "davical_active=\"$davical_active\""
    6.24 +
    6.25 +%start -u @l_susr@
    6.26 +    rcService davical enable yes || exit 0
    6.27 +    rcService davical active yes && exit 0
    6.28 +    @l_prefix@/sbin/apache @with_ssl@ \
    6.29 +        -f @l_prefix@/etc/davical/davical-apache.conf
    6.30 +
    6.31 +%stop -u @l_susr@
    6.32 +    rcService davical enable yes || exit 0
    6.33 +    rcService davical active no  && exit 0
    6.34 +    [ -f @l_prefix@/var/davical/run/apache.pid ] && \
    6.35 +        kill -TERM `cat @l_prefix@/var/davical/run/apache.pid`
    6.36 +    sleep 2
    6.37 +
    6.38 +%restart -u @l_susr@
    6.39 +    rcService davical enable yes || exit 0
    6.40 +    rcService davical active no  && exit 0
    6.41 +    rc davical stop start
    6.42 +

mercurial