2 commits - pykolab/setup pykolab.spec.in

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Fri Jul 27 13:30:16 CEST 2012


 pykolab.spec.in                  |    2 +
 pykolab/setup/setup_syncroton.py |   66 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)

New commits:
commit f7e567af623289d2a2b9372c569633cc8091f826
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Fri Jul 27 11:29:33 2012 +0200

    Add more build requirements, even though redundant, so that a clone of this repository only needs a single yum-builddep for the build to succeed

diff --git a/pykolab.spec.in b/pykolab.spec.in
index 90986cf..cdec4dd 100644
--- a/pykolab.spec.in
+++ b/pykolab.spec.in
@@ -25,6 +25,8 @@ URL:                http://kolab.org/
 Source0:            http://files.kolab.org/releases/%{name}-%{version}.tar.gz
 BuildRoot:          %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildArch:          noarch
+BuildRequires:      gcc
+BuildRequires:      glib2-devel
 BuildRequires:      python-icalendar
 BuildRequires:      python-kolabformat
 BuildRequires:      python-ldap


commit 9f1258853c71bfd8a7ce6819fb8740f381fb397c
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Fri Jul 27 11:29:20 2012 +0200

    Add setup procedure for Syncroton

diff --git a/pykolab/setup/setup_syncroton.py b/pykolab/setup/setup_syncroton.py
new file mode 100644
index 0000000..097fee0
--- /dev/null
+++ b/pykolab/setup/setup_syncroton.py
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+# Copyright 2010-2012 Kolab Systems AG (http://www.kolabsys.com)
+#
+# Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 3 or, at your option, any later version
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+import os
+import sys
+
+import components
+
+import pykolab
+
+from pykolab import utils
+from pykolab.constants import *
+from pykolab.translate import _
+
+log = pykolab.getLogger('pykolab.setup')
+conf = pykolab.getConf()
+
+def __init__():
+    components.register('syncroton', execute, description=description(), after=['mysql','ldap','roundcube'])
+
+def description():
+    return _("Setup Syncroton.")
+
+def execute(*args, **kw):
+    schema_files = []
+    for root, directories, filenames in os.walk('/usr/share/doc/'):
+        for filename in filenames:
+            if filename.startswith('syncroton') and filename.endswith('.sql'):
+                schema_filepath = os.path.join(root,filename)
+                if not schema_filepath in schema_files:
+                    schema_files.append(schema_filepath)
+
+    for schema_file in schema_files:
+        p1 = subprocess.Popen(['cat', schema_file], stdout=subprocess.PIPE)
+        p2 = subprocess.Popen(['mysql', '--defaults-file=/tmp/kolab-setup-my.cnf', 'roundcube'], stdin=p1.stdout)
+        p1.stdout.close()
+        p2.communicate()
+
+    time.sleep(2)
+
+    if os.path.isfile('/bin/systemctl'):
+        subprocess.call(['/bin/systemctl', 'restart', 'httpd.service'])
+        subprocess.call(['/bin/systemctl', 'enable', 'httpd.service'])
+    elif os.path.isfile('/sbin/service'):
+        subprocess.call(['/sbin/service', 'httpd', 'restart'])
+        subprocess.call(['/sbin/chkconfig', 'httpd', 'on'])
+    else:
+        log.error(_("Could not start and configure to start on boot, the " + \
+                "webserver service."))
+





More information about the commits mailing list