sogo: install additional database schema update scripts, and stop patching
some (but not all) of them to use ksh instead of bash. also adjust nginx sample config in pkg-readme. problems reported by landry@. based on a diff from giovanni@, ok giovanni@ sebastia@
This commit is contained in:
parent
2e17e6301d
commit
a6a1c54db6
|
@ -1,7 +1,7 @@
|
|||
COMMENT = web based groupware server
|
||||
|
||||
VERSION = 5.7.1
|
||||
REVISION = 1
|
||||
REVISION = 2
|
||||
DISTNAME = SOGo-${VERSION}
|
||||
PKGNAME = sogo-${VERSION}
|
||||
|
||||
|
@ -35,7 +35,8 @@ LIB_DEPENDS += archivers/libzip \
|
|||
security/oath-toolkit \
|
||||
www/sope>=${VERSION}
|
||||
RUN_DEPENDS += sope-postgres-*|sope-mysql-*:www/sope,-postgres \
|
||||
archivers/zip
|
||||
archivers/zip \
|
||||
shells/bash
|
||||
|
||||
CONFIGURE_STYLE = simple dest
|
||||
CONFIGURE_ARGS += --gsmake=`gnustep-config --variable=GNUSTEP_MAKEFILES` \
|
||||
|
@ -49,17 +50,14 @@ MAKE_FLAGS += libGDLContentStore_INTERFACE_VERSION=${LIBGDLContentStore_VERSION
|
|||
SOGOLIBDIR = lib/GNUstep/Frameworks/SOGo.framework/Versions/${LIBSOGo_VERSION}
|
||||
SUBST_VARS += SOGOLIBDIR VARBASE
|
||||
|
||||
SCRIPTS = cas-proxy-validate.py sql-update-2.2.17_to_2.3.0.sh \
|
||||
sql-update-3.2.10_to_4.0.0.sh sql-update-2.2.17_to_2.3.0-mysql.sh \
|
||||
sql-update-3.2.10_to_4.0.0-mysql.sh sql-update-3.0.0-to-combined.sh \
|
||||
sql-update-3.0.0-to-combined-mysql.sh updates.php
|
||||
|
||||
post-install:
|
||||
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/sogo
|
||||
.for _s in ${SCRIPTS}
|
||||
${INSTALL_SCRIPT} -c -o ${SHAREOWN} -g ${SHAREGRP} \
|
||||
${WRKSRC}/Scripts/${_s} ${PREFIX}/share/doc/sogo/${_s}
|
||||
.endfor
|
||||
cd ${WRKSRC}/Scripts; ${INSTALL_SCRIPT} \
|
||||
-c -o ${SHAREOWN} -g ${SHAREGRP} \
|
||||
cas-proxy-validate.py updates.php sql-update*.sh \
|
||||
${PREFIX}/share/doc/sogo/
|
||||
sed -i 's,#!/bin/bash,#!${LOCALBASE}/bin/bash,' \
|
||||
${PREFIX}/share/doc/sogo/sql-update*.sh
|
||||
|
||||
do-test:
|
||||
cd ${WRKSRC}/Tests/Integration && ${MAKE_PROGRAM} && ./teststrings.sh
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
--- Scripts/sql-update-2.2.17_to_2.3.0-mysql.sh.orig Wed Sep 16 20:41:29 2015
|
||||
+++ Scripts/sql-update-2.2.17_to_2.3.0-mysql.sh Fri Oct 23 09:40:35 2015
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/bash
|
||||
+#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
@@ -11,15 +11,19 @@ set -e
|
||||
defaultusername=$USER
|
||||
defaulthostname=127.0.0.1
|
||||
defaultdatabase=$USER
|
||||
-indextable=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+if [ -f /etc/sogo/sogo.conf ];then
|
||||
+ indextable=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+else
|
||||
+ indextable=$(sogo-tool dump-defaults | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+fi
|
||||
if [ -z "$indextable" ]; then
|
||||
echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
-read -p "Username ($defaultusername): " username
|
||||
-read -p "Hostname ($defaulthostname): " hostname
|
||||
-read -p "Database ($defaultdatabase): " database
|
||||
+read username?"Username ($defaultusername): "
|
||||
+read hostname?"Hostname ($defaulthostname): "
|
||||
+read database?"Database ($defaultdatabase): "
|
||||
|
||||
if [ -z "$username" ]
|
||||
then
|
||||
@@ -38,7 +42,7 @@ then
|
||||
|
||||
sqlscript=""
|
||||
|
||||
-function adjustSchema() {
|
||||
+adjustSchema() {
|
||||
oldIFS="$IFS"
|
||||
IFS=" "
|
||||
part1="`echo -e \"ALTER TABLE $table MODIFY c_partstates mediumtext;\\n\"`";
|
|
@ -1,41 +0,0 @@
|
|||
--- Scripts/sql-update-2.2.17_to_2.3.0.sh.orig Wed Sep 16 20:41:29 2015
|
||||
+++ Scripts/sql-update-2.2.17_to_2.3.0.sh Fri Oct 23 09:40:24 2015
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/bash
|
||||
+#!/bin/sh
|
||||
|
||||
set -e
|
||||
# This script only works with PostgreSQL
|
||||
@@ -11,15 +11,19 @@ defaultusername=$USER
|
||||
defaulthostname=localhost
|
||||
defaultdatabase=$USER
|
||||
#indextable=sogo_folder_info
|
||||
-indextable=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+if [ -f /etc/sogo/sogo.conf ];then
|
||||
+ indextable=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+else
|
||||
+ indextable=$(sogo-tool dump-defaults | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+fi
|
||||
if [ -z "$indextable" ]; then
|
||||
echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
-read -p "Username ($defaultusername): " username
|
||||
-read -p "Hostname ($defaulthostname): " hostname
|
||||
-read -p "Database ($defaultdatabase): " database
|
||||
+read username?"Username ($defaultusername): "
|
||||
+read hostname?"Hostname ($defaulthostname): "
|
||||
+read database?"Database ($defaultdatabase): "
|
||||
|
||||
if [ -z "$username" ]
|
||||
then
|
||||
@@ -36,7 +40,7 @@ fi
|
||||
|
||||
sqlscript=""
|
||||
|
||||
-function adjustSchema() {
|
||||
+adjustSchema() {
|
||||
oldIFS="$IFS"
|
||||
IFS=" "
|
||||
part1="`echo -e \"ALTER TABLE $table ALTER COLUMN c_partstates TYPE TEXT;\\n\"`";
|
|
@ -1,66 +0,0 @@
|
|||
Index: Scripts/sql-update-3.2.10_to_4.0.0-mysql.sh
|
||||
--- Scripts/sql-update-3.2.10_to_4.0.0-mysql.sh.orig
|
||||
+++ Scripts/sql-update-3.2.10_to_4.0.0-mysql.sh
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/bash
|
||||
+#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
@@ -12,16 +12,24 @@ set -e
|
||||
defaultusername=$USER
|
||||
defaulthostname=127.0.0.1
|
||||
defaultdatabase=sogo
|
||||
-indextable=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+if [ -f /etc/sogo/sogo.conf ];then
|
||||
+ indextable=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+else
|
||||
+ indextable=$(sogo-tool dump-defaults | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+fi
|
||||
if [ -z "$indextable" ]; then
|
||||
echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
-storeurl=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+if [ -f /etc/sogo/sogo.conf ];then
|
||||
+ storeurl=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+else
|
||||
+ storeurl=$(sogo-tool dump-defaults | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+fi
|
||||
|
||||
-read -p "Username ($defaultusername): " username
|
||||
-read -p "Hostname ($defaulthostname): " hostname
|
||||
-read -p "Database ($defaultdatabase): " database
|
||||
+read username?"Username ($defaultusername): "
|
||||
+read hostname?"Hostname ($defaulthostname): "
|
||||
+read database?"Database ($defaultdatabase): "
|
||||
|
||||
if [ -z "$username" ]
|
||||
then
|
||||
@@ -40,7 +48,7 @@ fi
|
||||
|
||||
sqlscript=""
|
||||
|
||||
-function growUserProfile() {
|
||||
+growUserProfile() {
|
||||
oldIFS="$IFS"
|
||||
IFS=" "
|
||||
part="`echo -e \"ALTER TABLE sogo_user_profile MODIFY c_defaults LONGTEXT;\\n\"`";
|
||||
@@ -50,7 +58,7 @@ function growUserProfile() {
|
||||
IFS="$oldIFS"
|
||||
}
|
||||
|
||||
-function growMailInContactsQuick() {
|
||||
+growMailInContactsQuick() {
|
||||
oldIFS="$IFS"
|
||||
IFS=" "
|
||||
part="`echo -e \"ALTER TABLE $table MODIFY c_mail text;\\n\"`";
|
||||
@@ -58,7 +66,7 @@ function growMailInContactsQuick() {
|
||||
IFS="$oldIFS"
|
||||
}
|
||||
|
||||
-function addCertificateInContactsQuick() {
|
||||
+addCertificateInContactsQuick() {
|
||||
oldIFS="$IFS"
|
||||
IFS=" "
|
||||
part="`echo -e \"ALTER TABLE $table ADD c_hascertificate INT4 DEFAULT 0;\\n\"`";
|
|
@ -1,57 +0,0 @@
|
|||
Index: Scripts/sql-update-3.2.10_to_4.0.0.sh
|
||||
--- Scripts/sql-update-3.2.10_to_4.0.0.sh.orig
|
||||
+++ Scripts/sql-update-3.2.10_to_4.0.0.sh
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/bash
|
||||
+#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
@@ -10,16 +10,24 @@ set -e
|
||||
defaultusername=$USER
|
||||
defaulthostname=localhost
|
||||
defaultdatabase=sogo
|
||||
-indextable=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+if [ -f /etc/sogo/sogo.conf ];then
|
||||
+ indextable=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+else
|
||||
+ indextable=$(sogo-tool dump-defaults | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+fi
|
||||
if [ -z "$indextable" ]; then
|
||||
echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
-storeurl=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+if [ -f /etc/sogo/sogo.conf ];then
|
||||
+ storeurl=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+else
|
||||
+ storeurl=$(sogo-tool dump-defaults | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
+fi
|
||||
|
||||
-read -p "Username ($defaultusername): " username
|
||||
-read -p "Hostname ($defaulthostname): " hostname
|
||||
-read -p "Database ($defaultdatabase): " database
|
||||
+read username?"Username ($defaultusername): "
|
||||
+read hostname?"Hostname ($defaulthostname): "
|
||||
+read database?"Database ($defaultdatabase): "
|
||||
|
||||
if [ -z "$username" ]
|
||||
then
|
||||
@@ -36,7 +44,7 @@ fi
|
||||
|
||||
sqlscript=""
|
||||
|
||||
-function growMailInContactsQuick() {
|
||||
+growMailInContactsQuick() {
|
||||
oldIFS="$IFS"
|
||||
IFS=" "
|
||||
part="`echo -e \"ALTER TABLE $table ALTER COLUMN c_mail TYPE TEXT;\\n\"`";
|
||||
@@ -44,7 +52,7 @@ function growMailInContactsQuick() {
|
||||
IFS="$oldIFS"
|
||||
}
|
||||
|
||||
-function addCertificateInContactsQuick() {
|
||||
+addCertificateInContactsQuick() {
|
||||
oldIFS="$IFS"
|
||||
IFS=" "
|
||||
part="`echo -e \"ALTER TABLE $table ADD c_hascertificate INT4 DEFAULT 0;\\n\"`";
|
|
@ -2869,12 +2869,26 @@ lib/sogo/
|
|||
share/doc/pkg-readmes/${PKGSTEM}
|
||||
share/doc/sogo/
|
||||
share/doc/sogo/cas-proxy-validate.py
|
||||
share/doc/sogo/sql-update-1.2.2_to_1.3.0-mysql.sh
|
||||
share/doc/sogo/sql-update-1.2.2_to_1.3.0.sh
|
||||
share/doc/sogo/sql-update-1.3.11_to_1.3.12-mysql.sh
|
||||
share/doc/sogo/sql-update-1.3.11_to_1.3.12.sh
|
||||
share/doc/sogo/sql-update-1.3.16_to_1.3.17-mysql.sh
|
||||
share/doc/sogo/sql-update-1.3.16_to_1.3.17.sh
|
||||
share/doc/sogo/sql-update-1.3.3_to_1.3.4-mysql.sh
|
||||
share/doc/sogo/sql-update-1.3.3_to_1.3.4.sh
|
||||
share/doc/sogo/sql-update-101_to_102.sh
|
||||
share/doc/sogo/sql-update-2.0.4b_to_2.0.5-mysql.sh
|
||||
share/doc/sogo/sql-update-2.2.17_to_2.3.0-mysql.sh
|
||||
share/doc/sogo/sql-update-2.2.17_to_2.3.0.sh
|
||||
share/doc/sogo/sql-update-20070724.sh
|
||||
share/doc/sogo/sql-update-20070822.sh
|
||||
share/doc/sogo/sql-update-20080303.sh
|
||||
share/doc/sogo/sql-update-3.0.0-to-combined-mysql.sh
|
||||
share/doc/sogo/sql-update-3.0.0-to-combined.sh
|
||||
share/doc/sogo/sql-update-3.2.10_to_4.0.0-mysql.sh
|
||||
share/doc/sogo/sql-update-3.2.10_to_4.0.0.sh
|
||||
share/doc/sogo/sql-update-5.5.1_to_5.6.0.sh
|
||||
share/doc/sogo/updates.php
|
||||
share/examples/login.conf.d/sogod
|
||||
@sample ${SYSCONFDIR}/login.conf.d/sogod
|
||||
|
|
|
@ -109,8 +109,8 @@ server {
|
|||
proxy_connect_timeout 90;
|
||||
proxy_send_timeout 90;
|
||||
proxy_read_timeout 90;
|
||||
proxy_buffer_size 4k;
|
||||
proxy_buffers 4 32k;
|
||||
proxy_buffer_size 64k;
|
||||
proxy_buffers 8 64k;
|
||||
proxy_busy_buffers_size 64k;
|
||||
proxy_temp_file_write_size 64k;
|
||||
client_max_body_size 50m;
|
||||
|
@ -221,8 +221,9 @@ Upgrade SOGo from < 2.3.0
|
|||
==========================
|
||||
With version 2.3.0, the database schema needs to be extended.
|
||||
|
||||
Run one of the following scripts as the SOGo system user _sogo. Choose the
|
||||
script based on your database backend. The scripts will ask you for the database credentials.
|
||||
Run one of the following scripts as the SOGo system user _sogo.
|
||||
Choose the script based on your database backend.
|
||||
The scripts will ask you for the database credentials.
|
||||
|
||||
# su _sogo "${TRUEPREFIX}/share/doc/sogo/sql-update-2.2.17_to_2.3.0.sh"
|
||||
# su _sogo "${TRUEPREFIX}/share/doc/sogo/sql-update-2.2.17_to_2.3.0-mysql.sh"
|
||||
|
@ -232,19 +233,19 @@ Upgrade SOGo from < 3.0.0
|
|||
With version 3.X you can update the database schema to the optional
|
||||
9-table model. The conversion is not required, and you should only do it
|
||||
when you are sure you know what you are doing.
|
||||
The scripts require you have configured sogo via /etc/sogo/sogo.conf,
|
||||
as well as they have to run with bash. You might install bash manually.
|
||||
The scripts require you have configured sogo via /etc/sogo/sogo.conf.
|
||||
Use at your own risk.
|
||||
|
||||
# su _sogo "${TRUEPREFIX}/bin/bash ${TRUEPREFIX}/share/doc/sogo/sql-update-3.0.0-to-combined.sh"
|
||||
# su _sogo "${TRUEPREFIX}/bin/bash ${TRUEPREFIX}/share/doc/sogo/sql-update-3.0.0-to-combined-mysql.sh"
|
||||
# su _sogo "${TRUEPREFIX}/share/doc/sogo/sql-update-3.0.0-to-combined.sh"
|
||||
# su _sogo "${TRUEPREFIX}/share/doc/sogo/sql-update-3.0.0-to-combined-mysql.sh"
|
||||
|
||||
Upgrade SOGo from < 4.0.0
|
||||
=========================
|
||||
Updating SOGo from version 3.X to 4.X requires an update of the database schema.
|
||||
|
||||
Run one of the following scripts as the SOGo system user _sogo. Choose the
|
||||
based on your database backend. The scripts will ask you for the database credentials.
|
||||
Run one of the following scripts as the SOGo system user _sogo.
|
||||
Choose the script based on your database backend.
|
||||
The scripts will ask you for the database credentials.
|
||||
|
||||
# su _sogo "${TRUEPREFIX}/share/doc/sogo/sql-update-3.2.10_to_4.0.0.sh"
|
||||
# su _sogo "${TRUEPREFIX}/share/doc/sogo/sql-update-3.2.10_to_4.0.0-mysql.sh"
|
||||
|
|
Loading…
Reference in New Issue