]> err.no Git - scalable-opengroupware.org/commitdiff
First shot at implementing dbconfig-common support
authorTollef Fog Heen <tfheen@err.no>
Fri, 2 May 2008 14:07:20 +0000 (16:07 +0200)
committerTollef Fog Heen <tfheen@err.no>
Fri, 2 May 2008 14:07:20 +0000 (16:07 +0200)
debian/control
debian/gnustepdefaults.template [new file with mode: 0644]
debian/rules
debian/scalable-opengroupware.org.config [new file with mode: 0644]
debian/scalable-opengroupware.org.dirs
debian/scalable-opengroupware.org.postinst
debian/scalable-opengroupware.org.postrm [new file with mode: 0644]

index e61c4bab5d9066453e65f1427b40f9773fbbb671..8ed852c821770a2ea2b6d18be9bafb4cac59b533 100644 (file)
@@ -7,7 +7,8 @@ Standards-Version: 3.7.2
 
 Package: scalable-opengroupware.org
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, dbconfig-common
+Recommends: slapd, postgresql-8.1
 Description: <insert up to 60 chars description>
  <insert long description, indented with spaces>
 
diff --git a/debian/gnustepdefaults.template b/debian/gnustepdefaults.template
new file mode 100644 (file)
index 0000000..2d1687d
--- /dev/null
@@ -0,0 +1,30 @@
+{
+    NSGlobalDomain = {
+        LDAPDebugEnabled = YES;
+    };
+    sogod-0.9 = {
+        OCSFolderInfoURL = "postgresql://_DBC_DBUSER_:_DBC_DBPASS_@_DBC_DBSERVER_:_DBC_DBPORT_/_DBC_DBNAME_/sogo_folder_info";
+        AgenorProfileURL = "postgresql://_DBC_DBUSER_:_DBC_DBPASS_@_DBC_DBSERVER_:_DBC_DBPORT_/_DBC_DBNAME_/sogo_user_profile";
+        WOMessageUseUTF8 = YES;
+        WOParsersUseUTF8 = YES;
+        WOPort = 20000;
+        SOGoDefaultMailDomain = "sogo.linpro.no";
+        SOGoFallbackIMAP4Server = "localhost";
+        SOGoAuthentificationMethod = "LDAP";
+        SOGoLDAPSources =
+        (
+          {
+                CNFieldName = "displayName";
+                IDFieldName = "uid";
+                UIDFieldName = "uid";
+                baseDN = "dc=sogo,dc=linpro,dc=no";
+                bindDN = "cn=admin,dc=sogo,dc=linpro,dc=no";
+                bindPassword = "abcd";
+                hostname = "localhost";
+                port = 389;
+                canAuthenticate = YES;
+                id = "userdb";
+          }
+        );
+    };
+}
index 2ec84728b8c35f76f1faa0bffaafd558bf10f589..3beb5fdd48106f876c93d2ee7d5a5140c56eb428 100755 (executable)
@@ -91,6 +91,7 @@ binary-arch: build install
        dh_installexamples
        dh_install --list-missing --sourcedir=debian/tmp
        dh_installdirs
+       cp debian/gnustepdefaults.template debian/scalable-opengroupware.org/var/lib/scalable-opengroupware.org/
 #      dh_installmenu
 #      dh_installdebconf       
 #      dh_installlogrotate
diff --git a/debian/scalable-opengroupware.org.config b/debian/scalable-opengroupware.org.config
new file mode 100644 (file)
index 0000000..6795f9b
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+# source debconf stuff
+. /usr/share/debconf/confmodule
+# source dbconfig-common shell library, and call the hook function
+if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
+    . /usr/share/dbconfig-common/dpkg/config.pgsql
+    dbc_dbuser=sogo
+    dbc_dbname=sogo
+    
+    dbc_go scalable-opengroupware.org "$@"
+fi
index 36dca78c4349104d991dabee958ede925de3b2fe..e2b7e00716a83da830a3d93c74c2aa4a7d5bc313 100644 (file)
@@ -1,3 +1,5 @@
 /var/run/sogo
 /var/spool/sogo
 /var/log/sogo
+/etc/scalable-opengroupware.org
+/var/lib/scalable-opengroupware.org
index 2215e8f9673ada031cc2ae728720bebd0b5cf3ff..9e1b9a8dec6f34a0fdcf433f39fe1c8fda0da388 100644 (file)
@@ -1,10 +1,27 @@
 #! /bin/sh -e
 
+. /usr/share/debconf/confmodule
+
 if [ -z "$2" ]; then
-       adduser --system sogo
+    SOGOHOME=/var/lib/scalable-opengroupware.org
+    adduser --system sogo --home $SOGOHOME --shell /bin/bash
+    
+    install -d -o sogo /var/spool/sogo
+    install -d -o sogo /var/log/sogo
+    install -d -o sogo $SOGOHOME/GNUstep/Defaults
+
+    dbc_generate_include=template:/etc/scalable-opengroupware.org/config
+    dbc_generate_include_owner=sogo
+    dbc_generate_include_perms=0600
+    dbc_pgsql_createdb_encoding=UTF8
+    dbc_authmethod_user=password
+    dbc_generate_include_args="-f template"
 
-       install -d -o sogo /var/spool/sogo
-       install -d -o sogo /var/log/sogo
+    if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
+       . /usr/share/dbconfig-common/dpkg/postinst.pgsql
+       dbc_go scalable-opengroupware.org "$@"
+    fi
+    ln -s /etc/scalable-opengroupware.org/config $SOGOHOME/GNUstep/Defaults/.GNUstepDefaults
 fi
 
 #DEBHELPER#
diff --git a/debian/scalable-opengroupware.org.postrm b/debian/scalable-opengroupware.org.postrm
new file mode 100644 (file)
index 0000000..d0ddaa2
--- /dev/null
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+if [ "$1" = "purge" ]; then
+    if which deluser > /dev/null 2>&1; then
+       deluser --remove-home sogo
+    fi
+
+    rm -f /etc/scalable-opengroupware.org/config $SOGOHOME/GNUstep/Defaults/.GNUstepDefaults
+    if which ucf >/dev/null 2>&1; then
+        ucf --purge /etc/scalable-opengroupware.org/config
+    fi
+fi
+
+#DEBHELPER#