Commit d25dd247 authored by Priscila Manhaes's avatar Priscila Manhaes

Merge branch 'cloudooo' of https://git.erp5.org/repos/slapos into cloudooo

Conflicts:
	component/libreoffice-bin/buildout.cfg
parents 95c511a4 11a428a5
......@@ -3,47 +3,57 @@ parts = apache-php
extends =
../apache/buildout.cfg
../cclient/buildout.cfg
../curl/buildout.cfg
../freetype/buildout.cfg
../gettext/buildout.cfg
../libiconv/buildout.cfg
../libjpeg/buildout.cfg
../libpng/buildout.cfg
../libtool/buildout.cfg
../mariadb/buildout.cfg
../openldap/buildout.cfg
../pkgconfig/buildout.cfg
../zip/buildout.cfg
[apache-php]
# Note: Shall react on each build of apache and reinstall itself
recipe = hexagonit.recipe.cmmi
url = http://fr2.php.net/get/php-5.3.6.tar.bz2/from/this/mirror
md5sum = 2286f5a82a6e8397955a0025c1c2ad98
url = http://fr2.php.net/distributions/php-5.3.8.tar.gz
md5sum = f4ce40d5d156ca66a996dbb8a0e7666a
configure-options =
--with-apxs2=${apache:location}/bin/apxs
--with-libxml-dir=${libxml2:location}
--with-mysql=${mariadb:location}
--with-zlib-dir=${zlib:location}
--with-mcrypt=${libmcrypt:location}
--enable-mbstring
--enable-session
--disable-all
environment =
PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig
PATH=${libxml2:location}/bin:%(PATH)s
LDFLAGS =-L${libtool:location}/lib -Wl,-rpath -Wl,${libtool:location}/lib -L${mariadb:location}/lib -Wl,-rpath -Wl,${mariadb:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -L${libmcrypt:location}/lib -Wl,-rpath -Wl,${libmcrypt:location}/lib
[apache-php-xmlrpc-gd]
# Note: Shall react on each build of apache and reinstall itself
recipe = hexagonit.recipe.cmmi
url = http://fr2.php.net/get/php-5.3.6.tar.bz2/from/this/mirror
md5sum = 2286f5a82a6e8397955a0025c1c2ad98
configure-options =
--with-apxs2=${apache:location}/bin/apxs
--with-libxml-dir=${libxml2:location}
--with-gd
--with-zlib-dir=${zlib:location}
--with-mcrypt=${libmcrypt:location}
--with-xmlrpc=${xml-rpc:location}
--with-jpeg-dir=${libjpeg:location}
--with-png-dir=${libpng:location}
--enable-gd-native-ttf
--with-ttf
--with-freetype-dir=${freetype:location}
--with-pdo-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-curl=${curl:location}
--with-zip-dir=${zip:location}
--with-imap=${cclient:location}
--with-iconv-dir=${libiconv:location}
--with-gettext=${gettext:location}
--with-ldap=${openldap:location}
--with-imap-ssl
--with-openssl=${openssl:location}
--enable-libxml
--enable-mbstring
--enable-session
--disable-all
--enable-exif
--enable-zip
--enable-ftp
environment =
PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig
PATH=${libxml2:location}/bin:%(PATH)s
LDFLAGS =-L${xml-rpc:location}/lib -Wl,-rpath -Wl,${xml-rpc:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -L${libmcrypt:location}/lib -Wl,-rpath -Wl,${libmcrypt:location}/lib
PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig
PATH=${pkgconfig:location}/bin:${libxml2:location}/bin:%(PATH)s
LDFLAGS =-L${libtool:location}/lib -Wl,-rpath -Wl,${libtool:location}/lib -L${mariadb:location}/lib -Wl,-rpath -Wl,${mariadb:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -L${libmcrypt:location}/lib -Wl,-rpath -Wl,${libmcrypt:location}/libblkid
[libmcrypt]
......
......@@ -16,8 +16,8 @@ extends =
[apache-no-ssl]
# inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/
recipe = hexagonit.recipe.cmmi
url = http://mir2.ovh.net/ftp.apache.org/dist//httpd/httpd-2.2.19.tar.bz2
md5sum = 832f96a6ec4b8fc7cf49b9efd4e89060
url = http://mir2.ovh.net/ftp.apache.org/dist//httpd/httpd-2.2.21.tar.bz2
md5sum = 1696ae62cd879ab1d4dd9ff021a470f2
configure-options = --enable-authn-alias
--enable-bucketeer
--enable-cache
......@@ -41,14 +41,15 @@ configure-options = --enable-authn-alias
--enable-proxy-http
--enable-proxy-scgi
--enable-so
--enable-dav
--enable-dav-fs
--disable-ssl
--with-included-apr
--with-z=${zlib:location}
--with-expat=${libexpat:location}
--with-pcre=${pcre:location}
--with-sqlite3=${sqlite3:location}
--with-dbm=gdbm
--with-gdm=${gdbm:location}
--with-gdbm=${gdbm:location}
--without-ssl
--without-lber
--without-ldap
......@@ -65,8 +66,8 @@ configure-options = --enable-authn-alias
[apache]
# inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/
recipe = hexagonit.recipe.cmmi
url = http://mir2.ovh.net/ftp.apache.org/dist//httpd/httpd-2.2.19.tar.bz2
md5sum = 832f96a6ec4b8fc7cf49b9efd4e89060
url = http://mir2.ovh.net/ftp.apache.org/dist//httpd/httpd-2.2.21.tar.bz2
md5sum = 1696ae62cd879ab1d4dd9ff021a470f2
configure-options = --disable-static
--enable-authn-alias
--enable-bucketeer
......@@ -90,6 +91,8 @@ configure-options = --disable-static
--enable-proxy-ftp
--enable-proxy-http
--enable-proxy-scgi
--enable-dav
--enable-dav-fs
--enable-so
--enable-ssl
--with-included-apr
......@@ -98,8 +101,7 @@ configure-options = --disable-static
--with-expat=${libexpat:location}
--with-pcre=${pcre:location}
--with-sqlite3=${sqlite3:location}
--with-dbm=gdbm
--with-gdm=${gdbm:location}
--with-gdbm=${gdbm:location}
--without-lber
--without-ldap
--without-ndbm
......
[buildout]
parts =
bash
[bash]
recipe = hexagonit.recipe.cmmi
url = ftp://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz
md5sum = 3fb927c7c33022f1c327f14a81c0d4b0
# libc-client - UW IMAP server
# ftp://ftp.cac.washington.edu/imap/
[buildout]
extends =
../openssl/buildout.cfg
parts =
cclient-patch
cclient
[cclient-patch]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/imap-2007f.patch
#md5sum = Student may put here md5sum of this file, this is good idea
download-only = True
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = imap-2007f.patch
[cclient]
recipe = hexagonit.recipe.cmmi
url = ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
configure-command = true
keep-compile-dir = true
# cclient does not support parallel compilation
make-options =
slx
SSLTYPE=unix
SSLDIR=${openssl:location}
SSLCRYPTO=-lcrypto
IP=6
SSLLIB=${openssl:location}/lib
EXTRACFLAGS=-fPIC
CCLIENT=${buildout:parts-directory}
-j1
patches =
${cclient-patch:location}/${cclient-patch:filename}
patch-options = -p1
--- old/Makefile 2011-09-22 13:19:53.000000000 +0100
+++ new/Makefile 2011-09-23 11:29:12.405271442 +0100
@@ -580,7 +580,6 @@
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo
@echo Do you want to continue this build anyway? Type y or n please:
- @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make nounenc;exit 1);; esac'
nounenc:
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -639,7 +638,7 @@
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo
@echo Do you want to build with IPv6 anyway? Type y or n please:
- @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make noip6;exit 1);; esac'
+ #@$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make noip6;exit 1);; esac'
@echo OK, I will remember that you really want to build with IPv6.
@echo You will not see this message again.
@$(TOUCH) ip6
@@ -731,6 +730,12 @@
$(SH) -c '$(RM) an ua OSTYPE SPECIALS c-client mtest imapd ipopd mailutil mlock dmail tmail || true'
$(CD) tools;$(MAKE) clean
+install:
+ install -v -d $(CCLIENT)/cclient/include
+ ln -svf $(CCLIENT)/cclient__compile__/imap-2007f/c-client $(CCLIENT)/cclient/include
+ install -v -d $(CCLIENT)/cclient/lib
+ ln -svf $(CCLIENT)/cclient__compile__/imap-2007f/c-client/c-client.a $(CCLIENT)/cclient/lib/libc-client.a
+
# A monument to a hack of long ago and far away...
love:
########################################################
# Dropbear - a secure shell client and server for *nix #
# #
# http://matt.ucc.asn.au/dropbear/dropbear.html #
########################################################
[buildout]
extends =
../zlib/buildout.cfg
parts =
dropbear
[dropbear-userspace-patch]
recipe = hexagonit.recipe.download
md5sum = 89f575b9a9586b04ef9073c9c3af13ae
url = ${:_profile_base_location_}/${:filename}
filename = userspace.patch
download-only = true
[dropbear-ipv6-patch]
recipe = hexagonit.recipe.download
md5sum = b30dd58d68829a80eee69188134382ef
url = ${:_profile_base_location_}/${:filename}
filename = ipv6-support.patch
download-only = true
[dropbear]
recipe = hexagonit.recipe.cmmi
md5sum = 0284ea239083f04c8b874e08e1aca243
url = http://matt.ucc.asn.au/dropbear/dropbear-0.53.1.tar.bz2
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--with-zlib=${zlib:location}
CFLAGS="-DENABLE_SINGLEUSER "
environment =
CPPFLAGS =-I${zlib:location}/include
LDFLAGS =-Wl,-rpath=${zlib:location}/lib -L${zlib:location}/lib
patches=
${dropbear-userspace-patch:location}/${dropbear-userspace-patch:filename}
${dropbear-ipv6-patch:location}/${dropbear-ipv6-patch:filename}
patch-options=
-p1
@@ -0,0 +1,56 @@
--- dropbear-0.52.orig/svr-runopts.c Wed May 13 20:56:03 2009
+++ dropbear-0.52/svr-runopts.c Wed May 13 22:20:22 2009
@@ -311,27 +311,39 @@
static void addportandaddress(char* spec) {
char *myspec = NULL;
+ char *p = NULL;
if (svr_opts.portcount < DROPBEAR_MAX_PORTS) {
/* We don't free it, it becomes part of the runopt state */
myspec = m_strdup(spec);
- /* search for ':', that separates address and port */
- svr_opts.ports[svr_opts.portcount] = strchr(myspec, ':');
-
- if (svr_opts.ports[svr_opts.portcount] == NULL) {
- /* no ':' -> the whole string specifies just a port */
- svr_opts.ports[svr_opts.portcount] = myspec;
- } else {
- /* Split the address/port */
- svr_opts.ports[svr_opts.portcount][0] = '\0';
- svr_opts.ports[svr_opts.portcount]++;
+ /* [ipv6]:port */
+ if (myspec[0] == '[' && (p = strchr(myspec, ']')) != NULL && *(p+1) == ':') {
+ *p = '\0';
+ p+=2;
+ myspec++;
+ svr_opts.ports[svr_opts.portcount] = p;
svr_opts.addresses[svr_opts.portcount] = myspec;
- }
-
- if (svr_opts.addresses[svr_opts.portcount] == NULL) {
- /* no address given -> fill in the default address */
+ } else if ((p = strchr(myspec, '.')) != NULL) {
+ if ((p = strchr(p, ':')) == NULL) {
+ /* ipv4 */
+ svr_opts.ports[svr_opts.portcount] = m_strdup(DROPBEAR_DEFPORT);
+ svr_opts.addresses[svr_opts.portcount] = myspec;
+ } else {
+ /* ipv4:port */
+ *p = '\0';
+ p++;
+ svr_opts.ports[svr_opts.portcount] = p;
+ svr_opts.addresses[svr_opts.portcount] = myspec;
+ }
+ } else if ((p = strchr(myspec, ':')) != NULL && (p = strchr(p, ':')) != NULL) {
+ /* ipv6 */
+ svr_opts.ports[svr_opts.portcount] = m_strdup(DROPBEAR_DEFPORT);
+ svr_opts.addresses[svr_opts.portcount] = myspec;
+ } else {
+ /* port */
+ svr_opts.ports[svr_opts.portcount] = myspec;
svr_opts.addresses[svr_opts.portcount] = m_strdup(DROPBEAR_DEFADDRESS);
}
diff --git a/options.h b/options.h
index d309ab4..63048e1 100644
--- a/options.h
+++ b/options.h
@@ -287,6 +287,12 @@ be overridden at runtime with -I. 0 disables idle timeouts */
/* The default path. This will often get replaced by the shell */
#define DEFAULT_PATH "/usr/bin:/bin"
+/* The prefix of dropbear environment variable overriding. */
+#define DROPBEAR_OVERRIDE_PREFIX "DROPBEAR_OVERRIDE_"
+#define DROPBEAR_OVERRIDE_PASSWORD DROPBEAR_OVERRIDE_PREFIX "PASSWORD"
+#define DROPBEAR_OVERRIDE_HOME DROPBEAR_OVERRIDE_PREFIX "HOME"
+#define DROPBEAR_OVERRIDE_SHELL DROPBEAR_OVERRIDE_PREFIX "SHELL"
+
/* Some other defines (that mostly should be left alone) are defined
* in sysoptions.h */
#include "sysoptions.h"
diff --git a/runopts.h b/runopts.h
index 83b5861..f8999b9 100644
--- a/runopts.h
+++ b/runopts.h
@@ -86,6 +86,15 @@ typedef struct svr_runopts {
int noauthpass;
int norootpass;
+#ifdef ENABLE_SINGLEUSER
+ int singleuser;
+ struct {
+ char *password;
+ char *home;
+ char *shell;
+ } singleuserenv;
+#endif /* ifdef ENABLE_SINGLEUSER */
+
#ifdef ENABLE_SVR_REMOTETCPFWD
int noremotetcp;
#endif
diff --git a/svr-auth.c b/svr-auth.c
index 87e3c5e..adb2e8b 100644
--- a/svr-auth.c
+++ b/svr-auth.c
@@ -126,6 +126,14 @@ void recv_msg_userauth_request() {
username = buf_getstring(ses.payload, &userlen);
+#ifdef ENABLE_SINGLEUSER
+ /* If userspace enabled, ignore username */
+ if (svr_opts.singleuser) {
+ m_free(username);
+ /* Get the current login of the user running dropbear */
+ username = m_strdup(getlogin());
+ }
+#endif /* ifdef ENABLE_SINGLEUSER */
servicename = buf_getstring(ses.payload, &servicelen);
methodname = buf_getstring(ses.payload, &methodlen);
@@ -228,6 +236,18 @@ static int checkusername(unsigned char *username, unsigned int userlen) {
}
authclear();
fill_passwd(username);
+#ifdef ENABLE_SINGLEUSER
+ if (svr_opts.singleuser) {
+ if (svr_opts.singleuserenv.home != NULL) {
+ m_free(ses.authstate.pw_dir);
+ ses.authstate.pw_dir = m_strdup(svr_opts.singleuserenv.home);
+ }
+ if (svr_opts.singleuserenv.shell != NULL) {
+ m_free(ses.authstate.pw_shell);
+ ses.authstate.pw_shell = m_strdup(svr_opts.singleuserenv.shell);
+ }
+ }
+#endif /* ifdef ENABLE_SINGLEUSER */
ses.authstate.username = m_strdup(username);
}
diff --git a/svr-runopts.c b/svr-runopts.c
index 2e836d2..1c21d7c 100644
--- a/svr-runopts.c
+++ b/svr-runopts.c
@@ -83,6 +83,9 @@ static void printhelp(const char * progname) {
"-W <receive_window_buffer> (default %d, larger may be faster, max 1MB)\n"
"-K <keepalive> (0 is never, default %d)\n"
"-I <idle_timeout> (0 is never, default %d)\n"
+#ifdef ENABLE_SINGLEUSER
+ "-n Enable the single user mode.\n"
+#endif /* ifdef ENABLE_SINGLEUSER */
#ifdef DEBUG_TRACE
"-v verbose (compiled with DEBUG_TRACE)\n"
#endif
@@ -128,6 +131,12 @@ void svr_getopts(int argc, char ** argv) {
#ifndef DISABLE_ZLIB
opts.enable_compress = 1;
#endif
+#ifdef ENABLE_SINGLEUSER
+ svr_opts.singleuser = 0;
+ svr_opts.singleuserenv.password = NULL;
+ svr_opts.singleuserenv.home = NULL;
+ svr_opts.singleuserenv.shell = NULL;
+#endif /* ifdef ENABLE_SINGLEUSER */
/* not yet
opts.ipv4 = 1;
opts.ipv6 = 1;
@@ -242,6 +251,17 @@ void svr_getopts(int argc, char ** argv) {
case 'u':
/* backwards compatibility with old urandom option */
break;
+#ifdef ENABLE_SINGLEUSER
+ case 'n':
+#ifndef ENABLE_SINGLEUSER_ROOT
+ /* If current user is root */
+ if (getuid() == 0) {
+ dropbear_log(LOG_ERR, "Can't enable singleuser mode as root.");
+ }
+#endif /* ifndef ENABLE_SINGLEUSER_ROOT */
+ svr_opts.singleuser = 1;
+ break;
+#endif /* ifdef ENABLE_SINGLEUSER */
#ifdef DEBUG_TRACE
case 'v':
debug_trace = 1;
@@ -313,6 +333,20 @@ void svr_getopts(int argc, char ** argv) {
}
opts.idle_timeout_secs = val;
}
+#ifdef ENABLE_SINGLEUSER
+ if (svr_opts.singleuser) {
+ dropbear_log(LOG_INFO, "Starting dropbear as single user mode.");
+ svr_opts.singleuserenv.password = getenv(DROPBEAR_OVERRIDE_PASSWORD);
+ svr_opts.singleuserenv.home = getenv(DROPBEAR_OVERRIDE_HOME);
+ if (svr_opts.singleuserenv.home != NULL) {
+ dropbear_log(LOG_INFO, "Single user home is '%s'", svr_opts.singleuserenv.home);
+ }
+ svr_opts.singleuserenv.shell = getenv(DROPBEAR_OVERRIDE_SHELL);
+ if (svr_opts.singleuserenv.shell != NULL) {
+ dropbear_log(LOG_INFO, "Single user shell is '%s'", svr_opts.singleuserenv.shell);
+ }
+ }
+#endif /* ifdef ENABLE_SINGLEUSER */
}
static void addportandaddress(char* spec) {
[buildout]
extends =
../librsync/buildout.cfg
../patch/buildout.cfg
parts =
duplicity
[duplicity]
recipe = slapos.recipe.build
url = http://code.launchpad.net/duplicity/0.6-series/0.6.15/+download/duplicity-0.6.15.tar.gz
md5sum = 88f3c990f41fde86cd7d5af5a1bc7b81
patch = ${:_profile_base_location_}/duplicity-ipv6.patch 32c44816a9a59401e233ef622bf50223
script =
import os
import tempfile
import sys
workingdir = guessworkdir(self.extract(self.download(%(url)r, %(md5sum)r)))
os.chdir(workingdir)
self.applyPatchList('${:patch}', patch_binary='${patch:location}/bin/patch', patch_options='-p0', cwd=workingdir)
call([sys.executable, os.path.join(workingdir, 'setup.py'),
'build_ext',
'--include-dirs', os.path.join('${librsync:location}', 'include'),
'--library-dirs', os.path.join('${librsync:location}', 'lib'),
'--rpath', os.path.join('${librsync:location}', 'lib')])
call([sys.executable, os.path.join(workingdir, 'setup.py'),
'install',
'--prefix', %(location)r])
os.chdir(os.path.join(%(location)r, 'bin'))
paths = [os.path.join(%(location)r, 'lib', 'python%%s.%%s' %% sys.version_info[:2], 'site-packages')]
from zc.buildout.easy_install import scripts
scripts([('duplicity', '__builtin__', 'execfile')], [], sys.executable, '${buildout:bin-directory}', arguments='%%r' %% os.path.abspath('duplicity'), extra_paths=paths)
scripts([('rdiffdir', '__builtin__', 'execfile')], [], sys.executable, '${buildout:bin-directory}', arguments='%%r' %% os.path.abspath('rdiffdir'), extra_paths=paths)
=== modified file 'src/urlparse_2_5.py'
--- src/urlparse_2_5.py 2011-03-06 15:12:33 +0000
+++ src/urlparse_2_5.py 2011-08-31 14:21:06 +0000
@@ -109,18 +109,19 @@
password = property(get_password)
def get_hostname(self):
- netloc = self.netloc
- if "@" in netloc:
- netloc = _rsplit(netloc, "@", 1)[1]
- if ":" in netloc:
- netloc = netloc.split(":", 1)[0]
- return netloc.lower() or None
+ netloc = self.netloc.split('@')[-1]
+ if '[' in netloc and ']' in netloc:
+ return netloc.split(']')[0][1:].lower()
+ elif ':' in netloc:
+ return netloc.split(':')[0].lower()
+ elif netloc == '':
+ return None
+ else:
+ return netloc.lower()
hostname = property(get_hostname)
def get_port(self):
- netloc = self.netloc
- if "@" in netloc:
- netloc = _rsplit(netloc, "@", 1)[1]
+ netloc = self.netloc.split('@')[-1].split(']')[-1]
if ":" in netloc:
port = netloc.split(":", 1)[1]
return int(port, 10)
......@@ -12,8 +12,8 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
[liberation-fonts]
recipe = hexagonit.recipe.download
strip-top-level-dir = true
url = https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-ttf-1.06.0.20100721.tar.gz
md5sum = ca4870d899fd7e943ffc310a5421ad4d
url = https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-ttf-1.07.0.tar.gz
md5sum = 8150db1c6e27cacdfd524b563b85b69e
destination = ${fonts:location}/${:_buildout_section_name_}
# IPAex Font - Japanese fonts provided by IPA
......
......@@ -10,8 +10,8 @@ parts =
[freetype]
recipe = hexagonit.recipe.cmmi
url = http://download.savannah.gnu.org/releases/freetype/freetype-2.4.5.tar.bz2
md5sum = 90428a6d8ec4876cd1eb94858c2a59b0
url = http://download.savannah.gnu.org/releases/freetype/freetype-2.4.6.tar.bz2
md5sum = 5e6510613f612809d2d7862592b92ab7
configure-options =
--disable-static
environment =
......
......@@ -3,22 +3,11 @@
[buildout]
extends =
../m4/buildout.cfg
../gmp/buildout.cfg
../zip/buildout.cfg
parts =
gcc-java
[gmp]
recipe = hexagonit.recipe.cmmi
url = ftp://ftp.gmplib.org/pub/gmp-5.0.2/gmp-5.0.2.tar.bz2
md5sum = 0bbaedc82fb30315b06b1588b9077cd3
# GMP does not correctly detect achitecture so it have to be given
# as hexagonit.recipe.cmmi is using shell expansion in subproceses
# backticks are working
configure-options =
--build=`uname -m`-linux
environment =
PATH=${m4:location}/bin:%(PATH)s
gcc
[mpfr]
recipe = hexagonit.recipe.cmmi
......@@ -26,9 +15,9 @@ url = http://www.mpfr.org/mpfr-3.0.1/mpfr-3.0.1.tar.bz2
md5sum = bfbecb2eacb6d48432ead5cfc3f7390a
configure-options =
--with-gmp=${gmp:location}
--disable-static
environment =
CPPFLAGS =-I${gmp:location}/include
LDFLAGS =-L${gmp:location}/lib -Wl,-rpath=${gmp:location}/lib
LDFLAGS=-Wl,-rpath=${gmp:location}/lib
[mpc]
recipe = hexagonit.recipe.cmmi
......@@ -37,9 +26,34 @@ md5sum = 0d6acab8d214bd7d1fbbc593e83dd00d
configure-options =
--with-gmp=${gmp:location}
--with-mpfr=${mpfr:location}
--disable-static
environment =
CPPFLAGS =-I${mpfr:location}/include -I${gmp:location}/include
LDFLAGS =-L${mpfr:location}/lib -Wl,-rpath=${mpfr:location}/lib -L${gmp:location}/lib -Wl,-rpath=${gmp:location}/lib
LDFLAGS=-Wl,-rpath=${mpfr:location}/lib -Wl,-rpath=${gmp:location}/lib
[ppl]
recipe = hexagonit.recipe.cmmi
# we should use version 0.10.x for gcc-4.5
url = http://www.cs.unipr.it/ppl/Download/ftp/releases/0.10.2/ppl-0.10.2.tar.bz2
md5sum = 5667111f53150618b0fa522ffc53fc3e
configure-options =
--with-libgmp-prefix=${gmp:location}
--with-libgmpxx-prefix=${gmp:location}
--disable-static
environment =
PATH=${m4:location}/bin:%(PATH)s
LDFLAGS=-Wl,-rpath=${gmp:location}/lib
[cloog-ppl]
recipe = hexagonit.recipe.cmmi
url = ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-ppl-0.15.9.tar.gz
md5sum = 806e001d1b1a6b130069ff6274900af5
configure-options =
--with-gmp=${gmp:location}
--with-ppl=${ppl:location}
--disable-static
environment =
PATH=${m4:location}/bin:%(PATH)s
LDFLAGS=-Wl,-rpath=${gmp:location}/lib -Wl,-rpath=${ppl:location}/lib
[ecj]
recipe = hexagonit.recipe.download
......@@ -53,33 +67,42 @@ recipe = hexagonit.recipe.download
url = http://www.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.5.3/gcc-4.5.3.tar.bz2
md5sum = 8e0b5c12212e185f3e4383106bfa9cc6
strip-top-level-dir = True
destination = ${gcc-java-source:location}
destination = ${gcc-source:location}
[gcc-java-download]
recipe = hexagonit.recipe.download
url = http://www.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.5.3/gcc-java-4.5.3.tar.bz2
md5sum = 08e045fdbdc22ac9af3aec3b8d16dbab
strip-top-level-dir = True
destination = ${gcc-java-source:location}
destination = ${gcc-source:location}
ignore-existing = true
[gcc-java-source]
[gcc-source]
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[gcc-java]
[gcc-multiarch.patch]
recipe = hexagonit.recipe.download
md5sum = 819e6735270c8a432b0512b49f40219f
url = ${:_profile_base_location_}/${:filename}
filename = ${:_buildout_section_name_}
download-only = true
[gcc-java-minimal]
depends =
${gcc-download:location}
${gcc-java-download:location}
recipe = hexagonit.recipe.cmmi
path = ${gcc-java-source:location}
path = ${gcc-source:location}
md5sum = bb3265edf0fa7543e50cedb93e04e427
patches =
${gcc-multiarch.patch:location}/${gcc-multiarch.patch:filename}
patch-options = -p2
configure-command = make clean \\; make distclean \\; ./configure
# GMP does not correctly detect achitecture so it have to be given
# as hexagonit.recipe.cmmi is using shell expansion in subproceses
# backticks are working
configure-options =
--disable-bootstrap
--build=`uname -m`-linux
--enable-languages=java
--disable-multilib
--with-gmp=${gmp:location}
......@@ -87,6 +110,8 @@ configure-options =
--with-mpc=${mpc:location}
--with-ecj-jar=${ecj:location}/${ecj:filename}
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--without-ppl
--without-cloog
environment =
CPPFLAGS =-I${mpfr:location}/include -I${gmp:location}/include -I${mpc:location}/include
......@@ -94,3 +119,35 @@ environment =
PATH=${zip:location}/bin:%(PATH)s
# make install does not work when several core are used
make-targets = install -j1
[gcc]
depends =
${gcc-download:location}
${gcc-java-download:location}
recipe = hexagonit.recipe.cmmi
path = ${gcc-source:location}
md5sum = bb3265edf0fa7543e50cedb93e04e427
patches =
${gcc-multiarch.patch:location}/${gcc-multiarch.patch:filename}
patch-options = -p2
configure-command = make clean \\; make distclean \\; ./configure
# GMP does not correctly detect achitecture so it have to be given
# as hexagonit.recipe.cmmi is using shell expansion in subproceses
# backticks are working
configure-options =
--disable-bootstrap
--enable-languages="c,c++,java"
--disable-multilib
--with-gmp=${gmp:location}
--with-mpfr=${mpfr:location}
--with-mpc=${mpc:location}
--with-ppl=${ppl:location}
--with-cloog=${cloog-ppl:location}
--with-ecj-jar=${ecj:location}/${ecj:filename}
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
environment =
LDFLAGS=-Wl,-rpath=${mpfr:location}/lib -Wl,-rpath=${gmp:location}/lib -Wl,-rpath=${mpc:location}/lib -Wl,-rpath=${ppl:location}/lib -Wl,-rpath=${cloog-ppl:location}/lib
PATH=${zip:location}/bin:%(PATH)s
# make install does not work when several core are used
make-targets = install -j1
This diff is collapsed.
......@@ -13,7 +13,9 @@ parts =
[git]
recipe = hexagonit.recipe.cmmi
url = http://kernel.org/pub/software/scm/git/git-1.7.4.5.tar.bz2
# url = http://kernel.org/pub/software/scm/git/git-1.7.4.5.tar.bz2
# Circumvent kernel.org downtime
url = http://ftp.free.fr/mirrors/ftp.kernel.org/software/scm/git/git-1.7.4.5.tar.bz2
md5sum = 2fa6c4c847ed87523cf55de54af457eb
configure-options =
--with-curl=${curl:location}
......
[buildout]
extends =
../m4/buildout.cfg
parts =
gmp
[gmp]
recipe = hexagonit.recipe.cmmi
# we should use version 4.x for ppl-0.10
url = ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2
md5sum = dd60683d7057917e34630b4a787932e8
# GMP does not correctly detect achitecture so it have to be given
# as hexagonit.recipe.cmmi is using shell expansion in subproceses
# backticks are working
configure-options =
--build=`uname -m`-linux
--enable-cxx
--disable-static
environment =
PATH=${m4:location}/bin:%(PATH)s
# mroonga - a MySQL storage engine using full-text search engine groonga
# http://mroonga.github.com/
# http://groonga.org/
[buildout]
parts =
groonga
[groonga]
recipe = hexagonit.recipe.cmmi
url = http://packages.groonga.org/source/groonga/groonga-1.2.5.tar.gz
md5sum = 7e608406677b7a3f91e287acc0c718c0
configure-options =
--disable-static
--disable-glibtest
--without-mecab
diff -ur groonga-storage-engine-0.4.orig/configure groonga-storage-engine-0.4/configure
--- groonga-storage-engine-0.4.orig/configure 2010-11-24 06:23:50.000000000 +0100
+++ groonga-storage-engine-0.4/configure 2011-01-01 16:01:07.000000000 +0100
@@ -13925,8 +13925,8 @@
as_fn_error "failed to run \"$ac_mysql_config\": $plugindir" "$LINENO" 5
fi
MYSQL_INC="$MYSQL_INC $($ac_mysql_config --include)"
- ac_mysql_major_version="`$ac_mysql_config --version | cut -b 1-3`"
- if test "$ac_mysql_major_version" = "5.1"; then
+ ac_mysql_major_version="`$ac_mysql_config --version | cut -b 1,3`"
+ if test $ac_mysql_major_version -lt 55; then
MYSQL51="-DMYSQL51"
fi
......@@ -3,8 +3,8 @@ parts = haproxy
[haproxy]
recipe = hexagonit.recipe.cmmi
url = http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.15.tar.gz
md5sum = c1b4fc6028c6d8e23dde8c91ff47eabe
url = http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.18.tar.gz
md5sum = 4ac88bb1a76c4b84ed4f6131183bedbe
configure-command = true
# If the system is running on Linux 2.6, we use "linux26" as the TARGET,
# otherwise use "generic".
......
......@@ -35,8 +35,8 @@ filename = imagemagick-6.6.7-4-without-lzma.patch
[imagemagick]
recipe = hexagonit.recipe.cmmi
url = ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.6.9-10.tar.bz2
md5sum = 985bd453c3e502f2771af5329c1cc384
url = ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.7.2-10.tar.bz2
md5sum = 073ec5d7f2a22db96a0e87e4322b75f9
configure-options =
--disable-static
--without-x
......
[buildout]
parts =
java
[jdk-6u27-no-user-interaction-patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
download-only = true
filename = jdk-6u27-no-user-interaction.patch
md5sum = 4c4303240647a114d07f3c411b2e6b5b
[java]
<= java-re
[java-re]
<= java-re-1.6.0
[java-sdk]
<= java-sdk-1.6.0
[java-re-1.6.0]
recipe = slapos.recipe.build
slapos_promisee =
directory:bin
directory:lib
directory:man
directory:plugin
directory:javaws
file:lib/rt.jar
file:bin/java
x86 = http://javadl.sun.com/webapps/download/AutoDL?BundleId=52240 0bd27d325c5ce11ce863d982ad052f7f
x86-64 = http://javadl.sun.com/webapps/download/AutoDL?BundleId=52242 a4d929bc4d6511290c07c3745477b77b
script =
if not self.options.get('url'): self.options['url'], self.options['md5sum'] = self.options[guessPlatform()].split(' ')
download_file = self.download(self.options['url'], self.options.get('md5sum'))
extract_dir = tempfile.mkdtemp(self.name)
os.chdir(extract_dir)
(download_dir, filename) = os.path.split(download_file)
auto_extract_bin = os.path.join(extract_dir, filename)
shutil.move(download_file, auto_extract_bin)
os.chmod(auto_extract_bin, 0777)
subprocess.call([auto_extract_bin])
self.cleanup_dir_list.append(extract_dir)
workdir = guessworkdir(extract_dir)
self.copyTree(os.path.join(workdir, "jre1.6.0_27"), "%(location)s")
[java-sdk-1.6.0]
recipe = slapos.recipe.build
slapos_promisee =
directory:bin
directory:lib
directory:man
directory:plugin
directory:javaws
file:jre/lib/rt.jar
file:bin/java
x86 = http://download.oracle.com/otn-pub/java/jdk/6u27-b07/jdk-6u27-linux-i586.bin bdb5f05bd20c6aa9a4729726191bf6fd
x86-64 = http://download.oracle.com/otn-pub/java/jdk/6u27-b07/jdk-6u27-linux-x64.bin 94f93a3ff03f824a238ecd79ad90433e
script =
if not self.options.get('url'): self.options['url'], self.options['md5sum'] = self.options[guessPlatform()].split(' ')
download_file = self.download(self.options['url'], self.options.get('md5sum'))
extract_dir = tempfile.mkdtemp(self.name)
os.chdir(extract_dir)
(download_dir, filename) = os.path.split(download_file)
auto_extract_bin = os.path.join(extract_dir, filename)
shutil.move(download_file, auto_extract_bin)
os.chmod(auto_extract_bin, 0777)
subprocess.call(["patch", auto_extract_bin, "-i", "${jdk-6u27-no-user-interaction-patch:location}/${jdk-6u27-no-user-interaction-patch:filename}"])
subprocess.call([auto_extract_bin])
self.cleanup_dir_list.append(extract_dir)
workdir = guessworkdir(extract_dir)
self.copyTree(os.path.join(workdir, "jdk1.6.0_27"), "%(location)s")
[java-sdk-1.7.0]
recipe = slapos.recipe.build
slapos_promisee =
directory:bin
directory:lib
directory:man
directory:jre
file:jre/lib/rt.jar
file:bin/java
file:bin/javac
x86 = http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz f97244a104f03731e5ff69f0dd5a9927
x86-64 = http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz b3c1ef5faea7b180469c129a49762b64
script =
if not self.options.get('url'): self.options['url'], self.options['md5sum'] = self.options[guessPlatform()].split(' ')
extract_dir = self.extract(self.download(self.options['url'], self.options.get('md5sum')))
workdir = guessworkdir(extract_dir)
self.copyTree(workdir, "%(location)s")
--- jdk-6u27-linux-x64.bin.orig 2011-09-27 11:02:14.000000000 +0200
+++ jdk-6u27-linux-x64.bin 2011-09-27 10:38:01.000000000 +0200
@@ -81,7 +81,7 @@
trap 'rm -f $outname; exit 1' HUP INT QUIT TERM
echo "Unpacking..."
tail ${tail_args} +189 "$0" > $outname
-if [ -x /usr/bin/sum ]; then
+if [ -x /usr/bin/null ]; then
echo "Checksumming..."
sum=`/usr/bin/sum $outname`
@@ -169,7 +169,7 @@
fi
# Service Tag support and JDK product registration
- register_JDK "$javahome" "${BINARY_NAME}" "$1"
+ # register_JDK "$javahome" "${BINARY_NAME}" "$1"
else
if [ "$1" = "-x" ]; then
[buildout]
parts =
libiconv
[libiconv]
recipe = hexagonit.recipe.cmmi
url = http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
md5sum = e34509b1623cec449dfeb73d7ce9c6c6
......@@ -9,7 +9,9 @@ parts =
[libtiff]
recipe = hexagonit.recipe.cmmi
url = http://download.osgeo.org/libtiff/tiff-3.9.5.tar.gz
#url = http://download.osgeo.org/libtiff/tiff-3.9.5.tar.gz
# server is down - circumvent
url = http://www.imagemagick.org/download/delegates/tiff-3.9.5.tar.gz
md5sum = 8fc7ce3b4e1d0cc8a319336967815084
configure-options =
--disable-static
......
......@@ -4,7 +4,7 @@ parts =
[libuuid]
recipe = hexagonit.recipe.cmmi
url = http://ftp.kernel.org/pub/linux/utils/util-linux/v2.18/util-linux-ng-2.18.tar.bz2
url = http://mirror.be.gbxs.net/pub/linux/utils/util-linux-ng/v2.18/util-linux-ng-2.18.tar.bz2
md5sum = 2f5f71e6af969d041d73ab778c141a77
configure-options =
--disable-static
......
......@@ -14,17 +14,6 @@ PATH = ${libxslt:location}/bin:%(PATH)s
recipe = zc.recipe.egg:custom
egg = lxml
# Note: Workaround lxml.de issues blocking buildout runs
# Empty index makes setuptools NOT trying to find any meta information about
# lxml...
index =
# ...so it is wise to tell where lxml can be found
find-links =
http://pypi.python.org/pypi/lxml/2.2.8
http://pypi.python.org/pypi/lxml/2.3
# Note: Whenever someone is going to remove it, one shall check, that buildout
# can run in newest mode, without any locally downloaded cache
rpath =
${libxml2:location}/lib/
${libxslt:location}/lib/
......
......@@ -4,7 +4,9 @@
[buildout]
extends =
../zlib/buildout.cfg
../groonga/buildout.cfg
../ncurses/buildout.cfg
../pkgconfig/buildout.cfg
../readline/buildout.cfg
parts =
......@@ -12,15 +14,16 @@ parts =
[mariadb]
recipe = hexagonit.recipe.cmmi
version = 5.2.7
url = http://www.percona.com/downloads/MariaDB/mariadb-${:version}/kvm-tarbake-jaunty-x86/mariadb-${:version}.tar.gz
md5sum = 06b9b102946a3606b38348c0ebf18367
version = 5.3.1-beta
url = http://downloads.askmonty.org/f/mariadb-${:version}/kvm-tarbake-jaunty-x86/mariadb-${:version}.tar.gz/from/http://mirror.layerjet.com/mariadb
md5sum = 5b3a94de1c1fcaa193edbbc8d7f8ffe4
# compile directory is required to build mysql plugins.
keep-compile-dir = true
# configure: how to avoid searching for my.cnf?
# - like in mysql part in http://svn.zope.org/zodbshootout/trunk/buildout.cfg?view=markup
# we use embeded yassl instead of openssl to avoid compilation errors on sphinx search engine.
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--disable-static
--enable-thread-safe-client
--enable-local-infile
......@@ -36,3 +39,16 @@ configure-options =
environment =
CPPFLAGS =-I${ncurses:location}/include -I${readline:location}/include
LDFLAGS =-L${readline:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${ncurses:location}/lib -Wl,-rpath=${readline:location}/lib
[groonga-storage-engine-mariadb]
recipe = hexagonit.recipe.cmmi
url = http://github.com/downloads/mroonga/mroonga/groonga-storage-engine-0.5.tar.gz
md5sum = 52fed75d97a91f239750a1011ea9e468
configure-options =
--with-mysql-source=${mariadb:location}__compile__/mariadb-${mariadb:version}
--with-mysql-config=${mariadb:location}/bin/mysql_config
environment =
PATH=${groonga:location}/bin:${pkgconfig:location}/bin:%(PATH)s
CPPFLAGS=-I${groonga:location}/include/groonga
LDFLAGS=-L${groonga:location}/lib
PKG_CONFIG_PATH=${groonga:location}/lib/pkgconfig
......@@ -27,27 +27,37 @@ download-only = true
md5sum = 3418477f64500cd2a8dce046f5d72fec
[memcached]
<= memcached-1.4.5
<= memcached-1.4.6
[memcached-1.4.6]
<= memcached-common
url = http://memcached.googlecode.com/files/memcached-1.4.6.tar.gz
md5sum = 243e5d82de27e6e45caf0ebfd400e41a
patches =
${memcached-fix-array-subscript-is-above-array-bounds:location}/${memcached-fix-array-subscript-is-above-array-bounds:filename}
[memcached-1.4.5]
<= memcached-common
url = http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
md5sum = 583441a25f937360624024f2881e5ea8
patches =
${memcached-strict-aliasing-patch:location}/${memcached-strict-aliasing-patch:filename}
${memcached-fix-array-subscript-is-above-array-bounds:location}/${memcached-fix-array-subscript-is-above-array-bounds:filename}
${memcached-gcc4.6.patch:location}/${memcached-gcc4.6.patch:filename}
[memcached-1.4.4]
<= memcached-common
url = http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz
md5sum = 5ca5b24de347e97ac1f48f3785b4178a
patches =
${memcached-strict-aliasing-patch:location}/${memcached-strict-aliasing-patch:filename}
${memcached-fix-array-subscript-is-above-array-bounds:location}/${memcached-fix-array-subscript-is-above-array-bounds:filename}
${memcached-gcc4.6.patch:location}/${memcached-gcc4.6.patch:filename}
[memcached-common]
recipe = hexagonit.recipe.cmmi
configure-options =
--with-libevent=${libevent:location}
patches =
${memcached-strict-aliasing-patch:location}/${memcached-strict-aliasing-patch:filename}
${memcached-fix-array-subscript-is-above-array-bounds:location}/${memcached-fix-array-subscript-is-above-array-bounds:filename}
${memcached-gcc4.6.patch:location}/${memcached-gcc4.6.patch:filename}
patch-options = -p1
environment =
LDFLAGS =-Wl,-rpath=${libevent:location}/lib
......@@ -5,8 +5,10 @@ extends =
../zlib/buildout.cfg
../bison/buildout.cfg
../flex/buildout.cfg
../groonga/buildout.cfg
../libtool/buildout.cfg
../ncurses/buildout.cfg
../pkgconfig/buildout.cfg
../readline/buildout.cfg
parts =
......@@ -15,15 +17,15 @@ parts =
[mysql-5.1-sphinx-patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = 6580393ca93ecf564cad0552b91a563e
filename = mysql-5.1.49-sphinx-1.10.diff
md5sum = eefcd08c400c58d3e89542ab482a8429
filename = mysql-5.1-sphinx-2.0.1-beta.diff
download-only = true
[mysql-5.1]
recipe = hexagonit.recipe.cmmi
version = 5.1.57
version = 5.1.58
url = http://mysql.he.net/Downloads/MySQL-5.1/mysql-${:version}.tar.gz
md5sum = 8d6998ef0f2e2d1dac2a761348c71c21
md5sum = ae5aef506088e521e4b1cc4f668e96d2
# compile directory is required to build mysql plugins.
keep-compile-dir = true
# configure: how to avoid searching for my.cnf?
......@@ -39,6 +41,7 @@ configure-command =
# we use embeded yassl instead of openssl to avoid compilation errors on sphinx search engine.
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--disable-static
--enable-thread-safe-client
--enable-local-infile
--enable-assembler
......@@ -54,10 +57,23 @@ configure-options =
make-options =
LIBTOOL=libtool
patch-options = -p1
patch-options = -p0
patches =
${mysql-5.1-sphinx-patch:location}/${mysql-5.1-sphinx-patch:filename}
environment =
PATH =${autoconf:location}/bin:${automake-1.11:location}/bin:${libtool:location}/bin:${bison:location}/bin:${flex:location}/bin:%(PATH)s
CPPFLAGS =-I${ncurses:location}/include -I${readline:location}/include
LDFLAGS =-L${readline:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${ncurses:location}/lib -Wl,-rpath=${readline:location}/lib
[groonga-storage-engine-mysql-5.1]
recipe = hexagonit.recipe.cmmi
url = http://github.com/downloads/mroonga/mroonga/groonga-storage-engine-0.9.tar.gz
md5sum = 78fe07122dc376796a5aede476f50cfd
configure-options =
--with-mysql-source=${mysql-5.1:location}__compile__/mysql-${mysql-5.1:version}
--with-mysql-config=${mysql-5.1:location}/bin/mysql_config
environment =
PATH=${groonga:location}/bin:${pkgconfig:location}/bin:%(PATH)s
CPPFLAGS=-I${groonga:location}/include/groonga
LDFLAGS=-L${groonga:location}/lib
PKG_CONFIG_PATH=${groonga:location}/lib/pkgconfig
This diff is collapsed.
......@@ -11,11 +11,14 @@ configure-options =
--with-shared
--without-normal
--without-debug
--without-gpm
--enable-rpath
# tricky way to rerun with --enable-widec
make-targets =
install && (for i in curses unctrl eti form menu panel term; do ln -sf ncurses/$i.h ${buildout:parts-directory}/${:_buildout_section_name_}/include/$i.h; done) && ./configure ${:configure-options} --enable-widec && make install
# pass dummy LDCONFIG to skip needless calling of ldconfig by non-root user
environment =
LDFLAGS =-Wl,--as-needed
LDCONFIG=/bin/echo
make-options =
-j1
################################################################
# OpenSSH Portable - a secure shell client and server for *nix #
# #
# http://www.openssh.com/ #
################################################################
[buildout]
extends =
../openssl/buildout.cfg
parts =
openssh
[openssh]
recipe = hexagonit.recipe.cmmi
md5sum = 0541579adf9d55abb15ef927048d372e
url = http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.8p2.tar.gz
configure-option =
-I${zlib:location}/include
-L${zlib:location}/lib
-I${openssl:location}/include
-L${openssl:location}/lib
--with-ssl-dir=${openssl:location}/lib
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--libdir=lib
......@@ -12,8 +12,8 @@ parts =
[openssl]
recipe = hexagonit.recipe.cmmi
url = https://www.openssl.org/source/openssl-1.0.0d.tar.gz
md5sum = 40b6ea380cc8a5bf9734c2f8bf7e701e
url = https://www.openssl.org/source/openssl-1.0.0e.tar.gz
md5sum = 7040b89c4c58c7a1016c0dfa6e821c86
configure-command = ./config
configure-options =
-I${zlib:location}/include
......
......@@ -39,6 +39,6 @@ make-options =
pre-make-hook = ${pdftk-hooks-download:location}/${pdftk-hooks-download:filename}:pre_make_hook
environment =
PATH=${gcc-java:location}/bin:${fastjar:location}/bin:%(PATH)s
LDFLAGS=-L${gcc-java:location}/lib -Wl,-rpath=${gcc-java:location}/lib -L${gcc-java:location}/lib64 -Wl,-rpath=${gcc-java:location}/lib64
LD_LIBRARY_PATH=${gcc-java:location}/lib:${gcc-java:location}/lib64
PATH=${gcc-java-minimal:location}/bin:${fastjar:location}/bin:%(PATH)s
LDFLAGS=-L${gcc-java-minimal:location}/lib -Wl,-rpath=${gcc-java-minimal:location}/lib -L${gcc-java-minimal:location}/lib64 -Wl,-rpath=${gcc-java-minimal:location}/lib64
LD_LIBRARY_PATH=${gcc-java-minimal:location}/lib:${gcc-java-minimal:location}/lib64
......@@ -15,8 +15,8 @@ extends =
[poppler-0.17.1]
recipe = hexagonit.recipe.cmmi
md5sum = 8d7276d1943078c76aabe9f2ec52d50b
url = http://poppler.freedesktop.org/poppler-0.17.1.tar.gz
md5sum = b566d1fbaa29b9257bf0ecc130e7b2ca
url = http://poppler.freedesktop.org/poppler-0.17.2.tar.gz
configure-options =
--disable-cairo-output
--disable-cms
......@@ -26,6 +26,7 @@ configure-options =
--disable-poppler-cpp
--disable-poppler-glib
--disable-poppler-qt4
--disable-static
--enable-zlib
environment =
PATH=${pkgconfig:location}/bin:%(PATH)s
......
[buildout]
extends =
../gmp/buildout.cfg
parts =
pycrypto-python
versions = versions
[pycrypto-python]
recipe = zc.recipe.egg:custom
egg = pycrypto
include-dirs =
${gmp:location}/include
library-dirs =
${gmp:location}/lib
rpath =
${gmp:location}/lib
[versions]
# pycrypto 2.4 does not work with setuptools/buildout
pycrypto = 2.3
[buildout]
parts =
rpm2cpio
[rpm2cpio]
recipe = slapos.recipe.build:download
url = http://ruda.googlecode.com/hg/rpm/rpm2cpio.py
md5sum = 06001f57616581312f9599e104f2473a
[buildout]
extends =
../../stack/shacache-client.cfg
../bison/buildout.cfg
../bzip2/buildout.cfg
../gdbm/buildout.cfg
../gettext/buildout.cfg
../glib/buildout.cfg
../libxml2/buildout.cfg
../libxslt/buildout.cfg
../lxml-python/buildout.cfg
../m4/buildout.cfg
../ncurses/buildout.cfg
../openssl/buildout.cfg
../pkgconfig/buildout.cfg
../popt/buildout.cfg
../python-2.7/buildout.cfg
../readline/buildout.cfg
../sqlite3/buildout.cfg
../swig/buildout.cfg
../zlib/buildout.cfg
parts =
slapos
cfg-environment
sh-environment
find-links =
http://www.nexedi.org/static/packages/source/slapos.buildout/
......@@ -26,6 +44,42 @@ include-site-packages = false
exec-sitecustomize = false
allowed-eggs-from-site-packages =
[environment]
# Note: For now original PATH is appeneded to the end, as not all tools are
# provided by SlapOS
PATH=${bison:location}/bin:${bzip2:location}/bin:${gettext:location}/bin:${glib:location}/bin:${libxml2:location}/bin:${libxslt:location}/bin:${m4:location}/bin:${ncurses:location}/bin:${openssl:location}/bin:${pkgconfig:location}/bin:${python2.7:location}/bin:${readline:location}/bin:${sqlite3:location}/bin:${swig:location}/bin:${buildout:bin-directory}:$PATH
CFLAGS=-I${bzip2:location}/include -I${gdbm:location}/include -I${gettext:location}/include -I${glib:location}/include -I${libxml2:location}/include -I${libxslt:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${popt:location}/include -I${readline:location}/include -I${sqlite3:location}/include -I${zlib:location}/include
CPPFLAGS=${:CFLAGS}
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${libxslt:location}/lib -Wl,-rpath=${libxslt:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${popt:location}/lib -Wl,-rpath=${popt:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${libxml2:location}/lib/pkgconfig:${libxslt:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${popt:location}/lib/pkgconfig:${python2.7:location}/lib/pkconfig:${sqlite3:location}/lib/pkconfig
LD_LIBRARY_PATH=${bzip2:location}/lib:${gdbm:location}/lib:${gettext:location}/lib:${glib:location}/lib:${libxml2:location}/lib:${libxslt:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${popt:location}/lib:${readline:location}/lib:${sqlite3:location}/lib:${zlib:location}/lib
[cfg-environment]
# Section exposes SlapOS default environment as configuration file.
recipe = collective.recipe.template
input = inline:
[environment]
PATH=${environment:PATH}
CFLAGS=${environment:CFLAGS}
CPPFLAGS=${environment:CPPFLAGS}
LDFLAGS=${environment:LDFLAGS}
PKG_CONFIG_PATH=${environment:PKG_CONFIG_PATH}
LD_LIBRARY_PATH=${environment:LD_LIBRARY_PATH}
output = ${buildout:directory}/environment.cfg
[sh-environment]
# Section exposes SlapOS default environment as sh file.
recipe = collective.recipe.template
input = inline:
export PATH="${environment:PATH}"
export CFLAGS="${environment:CFLAGS}"
export CPPFLAGS="${environment:CPPFLAGS}"
export LDFLAGS="${environment:LDFLAGS}"
export PKG_CONFIG_PATH="${environment:PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH="${environment:LD_LIBRARY_PATH}"
export PS1="[SlapOS env Active] $PS1"
output = ${buildout:directory}/environment.sh
[lxml-python]
python = python2.7
......@@ -38,38 +92,58 @@ eggs =
${lxml-python:egg}
slapos.core
initialization =
import os
os.environ['PATH'] = os.path.expandvars('${environment:PATH}')
# control scripts generation in order to avoid reinstalling bin/buildout
scripts =
bang = slapos.bang:main
generate-signature-key = slapos.signature:run
slapconsole = slapos.console:run
slapos-request = slapos.console:request
slapformat = slapos.format:main
slapgrid = slapos.grid.slapgrid:run
slapgrid-cp = slapos.grid.slapgrid:runComputerPartition
slapgrid-sr = slapos.grid.slapgrid:runSoftwareRelease
slapgrid-ur = slapos.grid.slapgrid:runUsageReport
slapgrid-supervisorctl = slapos.grid.svcbackend:supervisorctl
slapgrid-supervisord = slapos.grid.svcbackend:supervisord
slapproxy = slapos.proxy:main
[versions]
zc.buildout = 1.5.3-dev-SlapOS-005
Jinja2 = 2.5.5
Werkzeug = 0.6.2
zc.buildout = 1.6.0-dev-SlapOS-002
Jinja2 = 2.6
Werkzeug = 0.8.1
collective.recipe.template = 1.9
hexagonit.recipe.cmmi = 1.5.0
lxml = 2.3
ipython = 0.11
lxml = 2.3.1
meld3 = 0.6.7
netaddr = 0.7.5
netaddr = 0.7.6
setuptools = 0.6c12dev-r88846
slapos.core = 0.12
slapos.libnetworkcache = 0.2
slapos.core = 0.19
slapos.libnetworkcache = 0.10
xml-marshaller = 0.9.7
z3c.recipe.scripts = 1.0.1
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.12
Flask = 0.7.2
# slapos.core==0.19
Flask = 0.8
# Required by:
# hexagonit.recipe.cmmi==1.5.0
hexagonit.recipe.download = 1.5.0
# Required by:
# slapos.core==0.12
netifaces = 0.5
# slapos.core==0.19
netifaces = 0.6
# Required by:
# slapos.core==0.12
# slapos.core==0.19
supervisor = 3.0a10
# Required by:
# slapos.core==0.12
zope.interface = 3.6.4
# slapos.core==0.19
zope.interface = 3.8.0
......@@ -5,8 +5,8 @@ parts =
[sqlite3]
recipe = hexagonit.recipe.cmmi
url = http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
md5sum = 554026fe7fac47b1cf61c18d5fe43419
url = http://www.sqlite.org/sqlite-autoconf-3070800.tar.gz
md5sum = 6bfb46d73caaa1bbbcd2b52184b6c542
configure-options =
--disable-static
--enable-readline
......
......@@ -17,8 +17,8 @@ filename = stunnel-4-hooks.py
[stunnel-4]
recipe = hexagonit.recipe.cmmi
url = ftp://ftp.stunnel.org/stunnel/stunnel-4.39.tar.gz
md5sum = 853739119a8364daea750154af6d7e79
url = http://mirror.bit.nl/stunnel/stunnel-4.46.tar.gz
md5sum = 978030ff42f087ec26eb8a095ab69994
pre-configure-hook = ${stunnel-4-hook-download:location}/${stunnel-4-hook-download:filename}:pre_configure_hook
configure-options =
--enable-ipv6
......
......@@ -9,11 +9,6 @@ extends =
parts =
w3m
versions = versions
find-links =
http://www.nexedi.org/static/packages/source/slapos.buildout/
[w3m-w3m.gcc.forward.compat.patch]
recipe = hexagonit.recipe.download
url =${:_profile_base_location_}/${:filename}
......@@ -50,7 +45,3 @@ environment =
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
CPPFLAGS=-I${ncurses:location}/include/ -I${zlib:location}/include/
LDFLAGS=-Wl,--as-needed -L${garbage-collector:location}/lib -Wl,-rpath=${garbage-collector:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-005
From 700c7896b832d6e4fb0185f0d5382b01f94e7141 Mon Sep 17 00:00:00 2001
From: Alan Hourihane <alanh@vmware.com>
Date: Fri, 25 Feb 2011 11:05:27 +0000
Subject: Add _X_HIDDEN to xgeExtRegister to fix build problems on 64bit
---
diff --git a/src/Xge.c b/src/Xge.c
index 0655e00..d28a4f0 100644
--- a/src/Xge.c
+++ b/src/Xge.c
@@ -292,7 +292,7 @@ _xgeEventToWire(Display* dpy, XEvent* re, xEvent* event)
* Extensions need to register callbacks for their events.
*/
Bool
-xgeExtRegister(Display* dpy, int offset, XExtensionHooks* callbacks)
+_X_HIDDEN xgeExtRegister(Display* dpy, int offset, XExtensionHooks* callbacks)
{
XGEExtNode* newExt;
XGEData* xge_data;
--
cgit v0.8.3-6-g21f6
......@@ -2,6 +2,7 @@
[buildout]
extends =
../freetype/buildout.cfg
../libuuid/buildout.cfg
../libxml2/buildout.cfg
../libxslt/buildout.cfg
../pkgconfig/buildout.cfg
......@@ -11,7 +12,8 @@ parts =
libXdmcp
libXext
libXau
libX11
libXinerama
libSM
[xorg-aclocal]
ACLOCAL=${xorg-util-macros:location}/share/aclocal
......@@ -56,8 +58,6 @@ configure-options =
--disable-static
environment =
PKG_CONFIG_PATH=${xproto:location}/lib/pkgconfig
LD_LIBRARY_PATH=${xproto:location}/lib
LD_RUN_PATH=${xproto:location}/lib
PATH=${pkgconfig:location}/bin:%(PATH)s
[xcbproto]
......@@ -82,8 +82,6 @@ configure-options =
--disable-build-docs
environment =
PKG_CONFIG_PATH=${xcbproto:location}/lib/pkgconfig:${libXau:location}/lib/pkgconfig:${xproto:location}/lib/pkgconfig:${xorg-libpthread-stubs:location}/lib/pkgconfig:${libxslt:location}/lib/pkgconfig
LD_LIBRARY_PATH=${xcbproto:location}/lib:${libXau:location}/lib:${xorg-libpthread-stubs:location}/lib:${libxslt:location}/lib
LD_RUN_PATH=${xcbproto:location}/lib:${libXau:location}/lib:${xorg-libpthread-stubs:location}/lib:${libxslt:location}/lib
PATH=${pkgconfig:location}/bin:${libxslt:location}/bin:%(PATH)s
PYTHON=${buildout:executable}
# Python note: libxcb requires python with ElementTree. In case of appliance
......@@ -97,8 +95,6 @@ url = http://www.x.org/releases/X11R7.6/src/lib/libXext-1.2.0.tar.bz2
md5sum = 9bb236ff0193e9fc1c1fb504dd840331
environment =
PKG_CONFIG_PATH=${xcbproto:location}/lib/pkgconfig:${libXau:location}/lib/pkgconfig:${xproto:location}/lib/pkgconfig:${xorg-libpthread-stubs:location}/lib/pkgconfig:${xextproto:location}/lib/pkgconfig:${libX11:location}/lib/pkgconfig:${libxcb:location}/lib/pkgconfig
LD_LIBRARY_PATH=${xcbproto:location}/lib:${libXau:location}/lib:${xorg-libpthread-stubs:location}/lib:${xextproto:location}/lib:${libX11:location}/lib:${libxcb:location}/lib
LD_RUN_PATH=${xcbproto:location}/lib:${libXau:location}/lib:${xorg-libpthread-stubs:location}/lib:${xextproto:location}/lib:${libX11:location}/lib:${libxcb:location}/lib
PATH=${pkgconfig:location}/bin:%(PATH)s
# Warning: do *not* enable -fPIC CFLAGS for this library. Even if it fails and ld asks you to enable it. This will not solve your problem, and create an unexpected (by build chain) setup (all .o will be position-independant code).
# CFLAGS=-fPIC
......@@ -113,8 +109,9 @@ patch-options = -p1
[libXext-patch-link-error]
# Fixes libXext.la link error
# http://cgit.freedesktop.org/xorg/lib/libXext/patch/?id=700c7896b832d6e4fb0185f0d5382b01f94e7141
recipe = hexagonit.recipe.download
url = http://cgit.freedesktop.org/xorg/lib/libXext/patch/?id=700c7896b832d6e4fb0185f0d5382b01f94e7141
url = ${:_profile_base_location_}/${:filename}
download-only = true
filename = 700c7896b832d6e4fb0185f0d5382b01f94e7141.patch
md5sum = 52635ef694ee6f1acb642a77ee8eb010
......@@ -133,14 +130,9 @@ configure-options =
--disable-specs
--without-xmlto
--without-fop
environment =
PKG_CONFIG_PATH=${xproto:location}/lib/pkgconfig:${xextproto:location}/lib/pkgconfig:${xtrans:location}/share/pkgconfig:${libxcb:location}/lib/pkgconfig:${xorg-libpthread-stubs:location}/lib/pkgconfig:${libXau:location}/lib/pkgconfig
LD_LIBRARY_PATH=${xproto:location}/lib:${xextproto:location}/lib:${libxcb:location}/lib
LD_RUN_PATH=${xproto:location}/lib:${xextproto:location}/lib:${libxcb:location}/lib
PATH=${pkgconfig:location}/bin:%(PATH)s
CFLAGS=-I${xproto:location}/include
CPPFLAGS=-I${xproto:location}/include
[libXdmcp]
recipe = hexagonit.recipe.cmmi
......@@ -148,10 +140,48 @@ url = http://www.x.org/releases/X11R7.6/src/lib/libXdmcp-1.1.0.tar.bz2
md5sum = 762b6bbaff7b7d0831ddb4f072f939a5
environment =
PKG_CONFIG_PATH=${xorg-util-macros:location}/share/pkgconfig:${xproto:location}/lib/pkgconfig
LD_LIBRARY_PATH=${xproto:location}/lib
LD_RUN_PATH=${xproto:location}/lib
PATH=${pkgconfig:location}/bin:%(PATH)s
configure-options =
--disable-static
--without-xmlto
--without-fop
[xineramaproto]
recipe = hexagonit.recipe.cmmi
url = http://www.x.org/releases/X11R7.6/src/proto/xineramaproto-1.2.tar.bz2
md5sum = a8aadcb281b9c11a91303e24cdea45f5
[libXinerama]
recipe = hexagonit.recipe.cmmi
url = http://www.x.org/releases/X11R7.6/src/lib/libXinerama-1.1.1.tar.bz2
md5sum = ecd4839ad01f6f637c6fb5327207f89b
environment =
PKG_CONFIG_PATH=${libX11:location}/lib/pkgconfig:${libXau:location}/lib/pkgconfig:${libXext:location}/lib/pkgconfig:${libxcb:location}/lib/pkgconfig:${xextproto:location}/lib/pkgconfig:${xineramaproto:location}/lib/pkgconfig:${xorg-libpthread-stubs:location}/lib/pkgconfig:${xproto:location}/lib/pkgconfig
PATH=${pkgconfig:location}/bin:%(PATH)s
configure-options =
--disable-static
[libICE]
recipe = hexagonit.recipe.cmmi
url = http://www.x.org/releases/X11R7.6/src/lib/libICE-1.0.7.tar.bz2
md5sum = bb72a732b15e9dc25c3036559387eed5
configure-options =
--disable-static
--without-xmlto
--without-fop
environment =
PKG_CONFIG_PATH=${xproto:location}/lib/pkgconfig:${xtrans:location}/share/pkgconfig
PATH=${pkgconfig:location}/bin:%(PATH)s
[libSM]
recipe = hexagonit.recipe.cmmi
url = http://www.x.org/releases/X11R7.6/src/lib/libSM-1.2.0.tar.bz2
md5sum = e78c447bf1790552b644eca81b542742
configure-options =
--disable-static
--without-xmlto
--without-fop
environment =
PKG_CONFIG_PATH=${libICE:location}/lib/pkgconfig:${libuuid:location}/lib/pkgconfig:${xproto:location}/lib/pkgconfig:${xtrans:location}/share/pkgconfig
PATH=${pkgconfig:location}/bin:%(PATH)s
LIBUUID_CFLAGS=-I${libuuid:location}/include
......@@ -15,17 +15,12 @@ extends =
parts =
xtrabackup
find-links =
http://www.nexedi.org/static/packages/source/slapos.buildout/
versions = versions
[xtrabackup-build-patch-download]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = e018df8bb3ed672891388556b8e91e35
md5sum = 95b2c2ef625f88d85bf8876269a19372
download-only = true
filename = xtrabackup_build.patch
filename = xtrabackup-1.6.2_build.patch
[allow_force_ibbackup.patch]
recipe = hexagonit.recipe.download
......@@ -36,8 +31,8 @@ filename = ${:_buildout_section_name_}
[xtrabackup]
recipe = hexagonit.recipe.cmmi
url = http://www.percona.com/redir/downloads/XtraBackup/XtraBackup-1.6/source/xtrabackup-1.6.tar.gz
md5sum = 7c263723312cba36539df4cd7a119744
url = http://www.percona.com/redir/downloads/XtraBackup/xtrabackup-1.6.2/source/xtrabackup-1.6.2.tar.gz
md5sum = 933243ae362156c98f1211eb87b3b4ea
make-binary = true
patches =
${xtrabackup-build-patch-download:location}/${xtrabackup-build-patch-download:filename}
......@@ -51,7 +46,3 @@ environment =
PATH=${autoconf:location}/bin:${automake-1.11:location}/bin:${libtool:location}/bin:${flex:location}/bin:%(PATH)s:${bison:location}/bin
make-options =
-j1
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-001
diff -ur xtrabackup-1.6.2.orig/Makefile xtrabackup-1.6.2/Makefile
--- xtrabackup-1.6.2.orig/Makefile 2011-07-19 05:16:22.000000000 +0900
+++ xtrabackup-1.6.2/Makefile 2011-07-27 17:58:38.108925111 +0900
@@ -137,5 +137,5 @@
clean:
rm -f *.o xtrabackup_*
install:
- install -m 755 innobackupex-1.5.1 $(BIN_DIR)
+ install -m 755 innobackupex-1.5.1 $(BIN_DIR)/innobackupex
install -m 755 xtrabackup_* $(BIN_DIR)
diff -ur xtrabackup-1.6.2.orig/utils/build.sh xtrabackup-1.6.2/utils/build.sh
--- xtrabackup-1.6.2.orig/utils/build.sh 2011-07-19 05:16:22.000000000 +0900
+++ xtrabackup-1.6.2/utils/build.sh 2011-07-27 18:01:53.809212142 +0900
@@ -21,12 +21,14 @@
{
echo "Build an xtrabackup binary against the specified InnoDB flavor."
echo
- echo "Usage: `basename $0` CODEBASE"
+ echo "Usage: `basename $0` CODEBASE PREFIX LIBTOOL_LOCATION"
echo "where CODEBASE can be one of the following values or aliases:"
echo " innodb51_builtin | 5.1 build against built-in InnoDB in MySQL 5.1"
echo " innodb55 | 5.5 build against InnoDB in MySQL 5.5"
echo " xtradb51 | xtradb build against Percona Server with XtraDB 5.1"
echo " xtradb55 | xtradb55 build against Percona Server with XtraDB 5.5"
+ echo "where PREFIX is abolute path for install location"
+ echo "where LIBTOOL_LOCATION is abolute path of libtool"
exit -1
}
@@ -79,7 +81,12 @@
{
echo "Configuring the server"
cd $server_dir
- BUILD/autorun.sh
+ libtoolize -c -f
+ aclocal -I $libtool_location/share/aclocal -I config/ac-macros
+ autoheader
+ automake -c -a -f
+ autoconf
+ touch sql/sql_yacc.yy
eval $configure_cmd
echo "Building the server"
@@ -92,12 +99,13 @@
echo "Building XtraBackup"
mkdir $build_dir
cp $top_dir/Makefile $top_dir/xtrabackup.c $build_dir
+ cp $top_dir/innobackupex $build_dir/innobackupex-1.5.1
# Read XTRABACKUP_VERSION from the VERSION file
. $top_dir/VERSION
cd $build_dir
- $MAKE_CMD $xtrabackup_target XTRABACKUP_VERSION=$XTRABACKUP_VERSION
+ $MAKE_CMD $xtrabackup_target XTRABACKUP_VERSION=$XTRABACKUP_VERSION PREFIX=$1
cd $top_dir
}
@@ -106,11 +114,36 @@
echo "Building tar4ibd"
unpack_and_patch libtar-1.2.11.tar.gz tar4ibd_libtar-1.2.11.patch
cd libtar-1.2.11
- ./configure
+ ./configure --prefix=$1
$MAKE_CMD
cd $topdir
}
+function install_server()
+{
+ echo "Installing the server"
+ cd $server_dir
+ $MAKE_CMD install
+ cd $top_dir
+}
+
+function install_xtrabackup()
+{
+ echo "Installing XtraBackup"
+ echo $build_dir
+ cd $build_dir
+ $MAKE_CMD PREFIX=$1 install
+ cd $top_dir
+}
+
+function install_tar4ibd()
+{
+ echo "Installing tar4ibd"
+ cd libtar-1.2.11
+ $MAKE_CMD install
+ cd $topdir
+}
+
################################################################################
# Do all steps to build the server, xtrabackup and tar4ibd
# Expects the following variables to be set before calling:
@@ -141,9 +174,15 @@
build_server
- build_xtrabackup
+ build_xtrabackup $1
+
+ build_tar4ibd $1
+
+ install_server
+
+ install_xtrabackup $1
- build_tar4ibd
+ install_tar4ibd
}
if ! test -f xtrabackup.c
@@ -153,6 +192,15 @@
fi
type=$1
+prefix=$2
+if [ "x$prefix" == "x" ] ; then
+ usage
+fi
+libtool_location=$3
+if [ "x$libtool_location" == "x" ] ; then
+ usage
+fi
+
top_dir=`pwd`
case "$type" in
@@ -166,9 +214,10 @@
--with-plugins=innobase \
--with-zlib-dir=bundled \
--enable-shared \
- --with-extra-charsets=all"
+ --with-extra-charsets=all \
+ --prefix=$2"
- build_all
+ build_all $2
;;
"innodb55" | "5.5")
@@ -230,7 +279,7 @@
build_server
- build_xtrabackup
+ build_xtrabackup
build_tar4ibd
;;
lamp
=====
the lamp recipe help you to deploy simply a php based application on slapos. This recipe is
able to setup mariadb, apache and apache-php for your php application, is also capable to
configure your software during installation to ensure a full compatibility.
How to use?
-----------
just add this part in your software.cfg to use the lamp.simple module
[instance-recipe]
egg = slapos.cookbook
module = lamp.simple
you also need to extend lamp.cfg
extends =
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.50:/stack/lamp.cfg
lamp.runner
=====
When you install some software (such as prestashop) you need to remove or rename folder, with slapos you can not
access to the www-data directory. to do this, you need to tell to lamp recipe to remove or/and it when software
will be instantiated. Some software requires more than rename or delete a folder (manualy create database etc...)
in this case you need to write a python script and lamp recipe must run it when installing your software.
How to use?
-----------
CONDITION
--------
the action (move, rename, launch script) only starts when the condition is filled.
in instance.cfg, add
file_token = path_of_file
and the action will begin when path_of_www-data/path_of_file will be created
you can also use database to check condition. add
table_name = name_of_table
constraint = sql_where_condition
name_of_table is the full or partial name(in some cases we can not know the prefix used to create tables) of table
into mariadb databse for example table_name = admin. if you use
name_of_table = **, the action will begin when database is ready.
constraint is the sql_condition to use when search entry into name_of_table for example constraint = `admin_id`=1
you can no use file_token and table_name at the same time, otherwise file_token will be used in priority. attention
to the conditions that will never be satisfied.
ACTION
-------
the action start when condition is true
1- delete file or folder
into instance.cfg, use
delete = file_or_folder1, file_or_folder2, file_or_folder3 ...
for example delete = admin
2- rename file or folder
into instance.cfg, use
rename = old_name1 => new_name1, old_name2 => new_name2, ... you can also use
rename = old_name1, old_name2 => new_name2, ... in this case old_name1 will be rename and the new name will be chose
by joining old_name1 and mysql_user: this should give
rename = old_name1 => old_name1-mysql_user, old_name2 => new_name2, ...
3- launch python script
use script = ${configure-script:location}/${configure-script:filename} into instance.cfg, add part configure-script
into software.cfg
parts = configure-script
[configure-script]
recipe = hexagonit.recipe.download
location = ${buildout:parts-directory}/${:_buildout_section_name_}
url = url_of_script_name.py
filename = script_name.py
download-only = True
the script_name.py should contain a main module, sys.argv is passed to the main. you can write script_name.py like this
....
def setup(args):
base_url, htdocs, renamed, mysql_user, mysql_password, mysql_database, mysql_host = args
.......
if __name__ == '__main__':
setup(sys.argv[1:])
base_url: is the url of php software
htdocs: is the path of www-data directory
mysql_user, mysql_password, mysql_database, mysql_host: is the mariadb parameters
mkdirectory
===========
mkdirectory loops on its options and create the directory joined
.. Note::
Use a slash ``/`` as directory separator. Don't use system dependent separator.
The slash will be parsed and replace by the operating system right separator.
Only use relative directory to the buildout root directory.
The created directory won't be added to path list.
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# 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; either version 3
# of the License, 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 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 hashlib
import ConfigParser
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def setPath(self):
self.ca_dir = self.options['ca-dir']
self.request_directory = self.options['requests-directory']
self.ca_private = self.options['ca-private']
self.ca_certs = self.options['ca-certs']
self.ca_newcerts = self.options['ca-newcerts']
self.ca_crl = self.options['ca-crl']
self.ca_key_ext = '.key'
self.ca_crt_ext = '.crt'
def install(self):
path_list = []
# XXX: We gotta find better a way to get these options
ca_country_code = 'XX'
ca_email = 'xx@example.com'
ca_state = 'State',
ca_city = 'City'
ca_company = 'Company'
# XXX: end
self.setPath()
config = dict(ca_dir=self.ca_dir, request_dir=self.request_directory)
for f in ['crlnumber', 'serial']:
if not os.path.exists(os.path.join(self.ca_dir, f)):
open(os.path.join(self.ca_dir, f), 'w').write('01')
if not os.path.exists(os.path.join(self.ca_dir, 'index.txt')):
open(os.path.join(self.ca_dir, 'index.txt'), 'w').write('')
openssl_configuration = os.path.join(self.ca_dir, 'openssl.cnf')
config.update(
working_directory=self.ca_dir,
country_code=ca_country_code,
state=ca_state,
city=ca_city,
company=ca_company,
email_address=ca_email,
)
self.createFile(openssl_configuration, self.substituteTemplate(
self.getTemplateFilename('openssl.cnf.ca.in'), config))
ca_wrapper = self.createPythonScript(
self.options['wrapper'],
'%s.certificate_authority.runCertificateAuthority' % __name__,
dict(
openssl_configuration=openssl_configuration,
openssl_binary=self.options['openssl-binary'],
certificate=os.path.join(self.ca_dir, 'cacert.pem'),
key=os.path.join(self.ca_private, 'cakey.pem'),
crl=self.ca_crl,
request_dir=self.request_directory
)
)
path_list.append(ca_wrapper)
return path_list
class Request(Recipe):
def _options(self, options):
if 'name' not in options:
options['name'] = self.name
def install(self):
self.setPath()
key_file = self.options['key-file']
cert_file = self.options['cert-file']
name = self.options['name']
hash_ = hashlib.sha512(name).hexdigest()
key = os.path.join(self.ca_private, hash_ + self.ca_key_ext)
certificate = os.path.join(self.ca_certs, hash_ + self.ca_crt_ext)
parser = ConfigParser.RawConfigParser()
parser.add_section('certificate')
parser.set('certificate', 'name', name)
parser.set('certificate', 'key_file', key)
parser.set('certificate', 'certificate_file', certificate)
parser.write(open(os.path.join(self.request_directory, hash_), 'w'))
for link in [key_file, cert_file]:
if os.path.islink(link):
os.unlink(link)
elif os.path.exists(link):
raise OSError("%r file should be a symbolic link.")
os.symlink(key, key_file)
os.symlink(certificate, cert_file)
wrapper = self.createPythonScript(
self.options['wrapper'],
'slapos.recipe.librecipe.execute.execute_wait',
[ [self.options['executable']],
[certificate, key] ],
)
return [key_file, cert_file, wrapper]
import os
import subprocess
import time
import ConfigParser
def popenCommunicate(command_list, input=None):
subprocess_kw = dict(stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if input is not None:
subprocess_kw.update(stdin=subprocess.PIPE)
popen = subprocess.Popen(command_list, **subprocess_kw)
result = popen.communicate(input)[0]
if popen.returncode is None:
popen.kill()
if popen.returncode != 0:
raise ValueError('Issue during calling %r, result was:\n%s' % (
command_list, result))
return result
class CertificateAuthority:
def __init__(self, key, certificate, openssl_binary,
openssl_configuration, request_dir):
self.key = key
self.certificate = certificate
self.openssl_binary = openssl_binary
self.openssl_configuration = openssl_configuration
self.request_dir = request_dir
def checkAuthority(self):
file_list = [ self.key, self.certificate ]
ca_ready = True
for f in file_list:
if not os.path.exists(f):
ca_ready = False
break
if ca_ready:
return
for f in file_list:
if os.path.exists(f):
os.unlink(f)
try:
# no CA, let us create new one
popenCommunicate([self.openssl_binary, 'req', '-nodes', '-config',
self.openssl_configuration, '-new', '-x509', '-extensions',
'v3_ca', '-keyout', self.key, '-out', self.certificate,
'-days', '10950'], 'Automatic Certificate Authority\n')
except:
try:
for f in file_list:
if os.path.exists(f):
os.unlink(f)
except:
# do not raise during cleanup
pass
raise
def _checkCertificate(self, common_name, key, certificate):
file_list = [key, certificate]
ready = True
for f in file_list:
if not os.path.exists(f):
ready = False
break
if ready:
return False
for f in file_list:
if os.path.exists(f):
os.unlink(f)
csr = certificate + '.csr'
try:
popenCommunicate([self.openssl_binary, 'req', '-config',
self.openssl_configuration, '-nodes', '-new', '-keyout',
key, '-out', csr, '-days', '3650'],
common_name + '\n')
try:
popenCommunicate([self.openssl_binary, 'ca', '-batch', '-config',
self.openssl_configuration, '-out', certificate,
'-infiles', csr])
finally:
if os.path.exists(csr):
os.unlink(csr)
except:
try:
for f in file_list:
if os.path.exists(f):
os.unlink(f)
except:
# do not raise during cleanup
pass
raise
else:
return True
def checkRequestDir(self):
for request_file in os.listdir(self.request_dir):
parser = ConfigParser.RawConfigParser()
parser.readfp(open(os.path.join(self.request_dir, request_file), 'r'))
if self._checkCertificate(parser.get('certificate', 'name'),
parser.get('certificate', 'key_file'), parser.get('certificate',
'certificate_file')):
print 'Created certificate %r' % parser.get('certificate', 'name')
def runCertificateAuthority(ca_conf):
ca = CertificateAuthority(ca_conf['key'], ca_conf['certificate'],
ca_conf['openssl_binary'], ca_conf['openssl_configuration'],
ca_conf['request_dir'])
while True:
ca.checkAuthority()
ca.checkRequestDir()
# XXX
# Antoine: I really don't like that at all. It wastes useful CPU time.
# I think it would be a greater idea to use pyinotify
# <http://pyinotify.sourceforge.net/>
# Or we could use select() with socket as well.
time.sleep(60)
# end XXX
This diff is collapsed.
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# 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; either version 3
# of the License, 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 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.
#
##############################################################################
from slapos.recipe.librecipe import BaseSlapRecipe
import os
import subprocess
import pkg_resources
import zc.buildout
import zc.recipe.egg
import sys
class Recipe(BaseSlapRecipe):
def getTemplateFilename(self, template_name):
return pkg_resources.resource_filename(__name__,
'template/%s' % template_name)
def _install(self):
self.path_list = []
self.requirements, self.ws = self.egg.working_set()
document_root = self.createDataDirectory('www')
apache_config = self.installApache(document_root)
self.setConnectionUrl(scheme='webdavs',
host=apache_config['ip'],
port=apache_config['port'],
auth=(apache_config['user'],
apache_config['password']))
return self.path_list
def installApache(self, document_root, ip=None, port=None):
if ip is None:
ip=self.getGlobalIPv6Address()
if port is None:
port = '9080'
htpasswd_config = self.createHtpasswd()
ssl_config = self.createCertificate(size=2048)
apache_config = dict(
pid_file=os.path.join(self.run_directory, 'httpd.pid'),
lock_file=os.path.join(self.run_directory, 'httpd.lock'),
davlock_db=os.path.join(self.run_directory, 'davdb.lock'),
ip=ip,
port=port,
error_log=os.path.join(self.log_directory, 'httpd-error.log'),
access_log=os.path.join(self.log_directory, 'httpd-access.log'),
document_root=document_root,
modules_dir=self.options['apache_modules_dir'],
mime_types=self.options['apache_mime_file'],
server_root=self.work_directory,
email_address='admin@vifib.net',
htpasswd_file=htpasswd_config['htpasswd_file'],
ssl_certificate=ssl_config['certificate'],
ssl_key=ssl_config['key'],
)
httpd_config_file = self.createConfigurationFile('httpd.conf',
self.substituteTemplate(self.getTemplateFilename('httpd.conf.in'),
apache_config))
self.path_list.append(httpd_config_file)
apache_runner = zc.buildout.easy_install.scripts(
[('httpd', 'slapos.recipe.librecipe.execute', 'execute')],
self.ws, sys.executable, self.wrapper_directory,
arguments=[self.options['apache_binary'],
'-f', httpd_config_file,
'-DFOREGROUND',
]
)[0]
self.path_list.append(apache_runner)
return dict(ip=apache_config['ip'],
port=apache_config['port'],
user=htpasswd_config['user'],
password=htpasswd_config['password']
)
def createHtpasswd(self):
htpasswd = self.createConfigurationFile('htpasswd', '')
self.path_list.append(htpasswd)
password = self.generatePassword()
user = 'user'
subprocess.check_call([self.options['apache_htpasswd'],
'-bc', htpasswd,
user, password
])
return dict(htpasswd_file=htpasswd,
user=user,
password=password)
def createCertificate(self, size=1024, subject='/C=FR/L=Marcq-en-Baroeul/O=Nexedi'):
key_file = os.path.join(self.etc_directory, 'httpd.key')
self.path_list.append(key_file)
certificate_file = os.path.join(self.etc_directory, 'httpd.crt')
self.path_list.append(certificate_file)
subprocess.check_call([self.options['openssl_binary'],
'req', '-x509', '-nodes',
'-newkey', 'rsa:%s' % size,
'-subj', str(subject),
'-out', certificate_file,
'-keyout', key_file
])
return dict(key=key_file,
certificate=certificate_file)
ServerRoot "%(server_root)s"
Listen [%(ip)s]:%(port)s
# Needed modules
LoadModule authn_file_module "%(modules_dir)s/mod_authn_file.so"
LoadModule authz_host_module "%(modules_dir)s/mod_authz_host.so"
LoadModule authz_user_module "%(modules_dir)s/mod_authz_user.so"
LoadModule auth_basic_module "%(modules_dir)s/mod_auth_basic.so"
LoadModule auth_digest_module "%(modules_dir)s/mod_auth_digest.so"
LoadModule log_config_module "%(modules_dir)s/mod_log_config.so"
LoadModule headers_module "%(modules_dir)s/mod_headers.so"
LoadModule setenvif_module "%(modules_dir)s/mod_setenvif.so"
LoadModule ssl_module "%(modules_dir)s/mod_ssl.so"
LoadModule mime_module "%(modules_dir)s/mod_mime.so"
LoadModule dav_module "%(modules_dir)s/mod_dav.so"
LoadModule dav_fs_module "%(modules_dir)s/mod_dav_fs.so"
LoadModule dir_module "%(modules_dir)s/mod_dir.so"
ServerAdmin %(email_address)s
# Quiet Server header (if not, Apache give its life history)
# It's safer
ServerTokens ProductOnly
DocumentRoot "%(document_root)s"
PidFile "%(pid_file)s"
LockFile "%(lock_file)s"
DavLockDB "%(davlock_db)s"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory %(document_root)s>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
Dav On
# Security Rules to avoid DDoS Attacks
DavDepthInfinity Off
LimitXMLRequestBody 0
# Cross-Origin Resources Sharing
Header always set Access-Control-Max-Age "0"
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "OPTIONS, GET, HEAD, POST, PUT, DELETE, PROPFIND"
Header always set Access-Control-Allow-Headers "Content-Type, X-Requested-With, X-HTTP-Method-Override, Accept, Authorization, Depth"
SetEnvIf Origin "(.+)" ORIGIN=$1
Header always set Access-Control-Allow-Origin %%{ORIGIN}e
AuthType Basic
AuthName "WebDAV Storage"
AuthUserFile "%(htpasswd_file)s"
<LimitExcept OPTIONS>
Require valid-user
</LimitExcept>
</Directory>
ErrorLog "%(error_log)s"
LogLevel warn
LogFormat "%%h %%l %%u %%t \"%%r\" %%>s %%b \"%%{Referer}i\" \"%%{User-Agent}i\"" combined
LogFormat "%%h %%l %%u %%t \"%%r\" %%>s %%b" common
CustomLog "%(access_log)s" common
DefaultType text/plain
TypesConfig "%(mime_types)s"
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLEngine on
SSLCertificateFile "%(ssl_certificate)s"
SSLCertificateKeyFile "%(ssl_key)s"
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# 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; either version 3
# of the License, 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 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
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def install(self):
self.logger.info("Installing dcron...")
path_list = []
cronstamps = self.options['cronstamps']
cron_d = self.options['cron-entries']
crontabs = self.options['crontabs']
catcher = self.options['catcher']
binary = self.options['binary']
script = self.createPythonScript(binary,
'slapos.recipe.librecipe.execute.execute',
[self.options['dcrond-binary'].strip(), '-s', cron_d, '-c', crontabs,
'-t', cronstamps, '-f', '-l', '5', '-M', catcher]
)
path_list.append(script)
self.logger.debug('Main cron executable created at : %r', script)
self.logger.info("dcron successfully installed.")
return path_list
class Part(GenericBaseRecipe):
def _options(self, options):
if 'name' not in options:
options['name'] = self.name
def install(self):
cron_d = self.options['cron-entries']
filename = os.path.join(cron_d, 'name')
with open(filename, 'w') as part:
part.write('%(frequency)s %(command)s\n' % {
'frequency': self.options['frequency'],
'command': self.options['command'],
})
return [filename]
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# 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; either version 3
# of the License, 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 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.
#
##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def install(self):
remote_url = self.options['remote_backup']
backup_directory = self.options['directory']
wrapper = self.createPythonScript(
self.options['wrapper'],
'slapos.recipe.librecipe.execute.execute',
[self.options['duplicity_binary'], '--no-encryption',
backup_directory, remote_url]
)
return [wrapper]
This diff is collapsed.
This diff is collapsed.
......@@ -4,3 +4,4 @@ SSLCertificateKeyFile %(login_key)s
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLProxyEngine On
......@@ -34,9 +34,9 @@ RequestHeader unset REMOTE_USER
# Log configuration
ErrorLog "%(error_log)s"
LogFormat "%%h %%{REMOTE_USER}i %%l %%u %%t \"%%r\" %%>s %%b \"%%{Referer}i\" \"%%{User-Agent}i\"" combined
LogFormat "%%h %%{REMOTE_USER}i %%l %%u %%t \"%%r\" %%>s %%b" common
CustomLog "%(access_log)s" common
# Default apache log format with request time in microsecond at the end
LogFormat "%%h %%l %%u %%t \"%%r\" %%>s %%b \"%%{Referer}i\" \"%%{User-Agent}i\" %%D" combined
CustomLog "%(access_log)s" combined
# Directory protection
<Directory />
......
......@@ -9,10 +9,25 @@ defaults
retries 1
option redispatch
maxconn 2000
timeout server 3000s
timeout queue 5s
timeout connect 10s
timeout client 3600s
# it is useless to have timeout much bigger than the one of apache.
# By default apache use 300s, so we set slightly more in order to
# make sure that apache will first stop the connection.
timeout server 305s
# Stop waiting in queue for a zope to become available.
# If no zope can be reached after one minute, consider the request will
# never succeed.
timeout queue 60s
# The connection should be immediate on LAN,
# so we should not set more than 5 seconds, and it could be already too much
timeout connect 5s
# As requested in haproxy doc, make this "at least equal to timeout server".
timeout client 305s
# Use "option httpclose" to not preserve client & server persistent connections
# while handling every incoming request individually, dispatching them one after
# another to servers, in HTTP close mode. This is really needed when haproxy
# is configured with maxconn to 1, without this options browser are unable
# to render a page
option httpclose
listen %(name)s %(ip)s:%(port)s
cookie SERVERID insert
......
CREATE DATABASE IF NOT EXISTS %(mysql_database)s;
GRANT ALL PRIVILEGES ON %(mysql_database)s.* TO %(mysql_user)s@'%%' IDENTIFIED BY '%(mysql_password)s';
GRANT ALL PRIVILEGES ON %(mysql_database)s.* TO %(mysql_user)s@'localhost' IDENTIFIED BY '%(mysql_password)s';
%(file_list)s {
daily
dateext
rotate 30
rotate 3650
compress
notifempty
sharedscripts
......
This diff is collapsed.
# ZEO configuration file generated by SlapOS
<zeo>
address %(zeo_ip)s:%(zeo_port)s
read-only false
invalidation-queue-size 100
pid-filename %(zeo_pid)s
</zeo>
......@@ -10,6 +8,7 @@
<eventlog>
<logfile>
dateformat
path %(zeo_event_log)s
</logfile>
</eventlog>
<zodb_db %(storage_name)s>
cache-size %(zodb_cache_size)d
mount-point %(mount_point)s
<zeoclient>
cache-size %(zeo_client_cache_size)s
server %(address)s
storage %(storage_name)s
name %(storage_name)s
......
<zodb_db root>
cache-size %(zodb_cache_size)d
<filestorage>
path %(zodb_root_path)s
</filestorage>
......
......@@ -7,10 +7,8 @@ instancehome $INSTANCE
# Used products
%(products)s
# Environment override
<environment>
%(environment)s
</environment>
# Environment is setup in running wrapper script
# Reason: zope.conf is read too late for some componets
# No need to debug
debug-mode off
......@@ -34,11 +32,13 @@ lock-filename %(lock-filename)s
# Logging configuration
<eventlog>
<logfile>
dateformat
path %(event_log)s
</logfile>
</eventlog>
<logger access>
<logfile>
dateformat
path %(z2_log)s
</logfile>
</logger>
......
......@@ -37,6 +37,9 @@ import hashlib
class Recipe(BaseSlapRecipe):
# To avoid magic numbers
VNC_BASE_PORT = 5900
def _install(self):
"""
Set the connection dictionnary for the computer partition and create a list
......@@ -54,15 +57,30 @@ class Recipe(BaseSlapRecipe):
self.ca_conf = self.installCertificateAuthority()
self.key_path, self.certificate_path = self.requestCertificate('noVNC')
# Install the socket_connection_attempt script
catcher = zc.buildout.easy_install.scripts(
[('check_port_listening', __name__ + 'socket_connection_attempt', 'connection_attempt')],
self.ws,
sys.executable,
self.bin_directory,
)
# Save the check_port_listening script path
check_port_listening_script = catcher[0]
# Get the port_listening_promise template path, and save it
self.port_listening_promise_path = pkg_resources.resource_filename(
__name__, 'template/port_listening_promise.in')
self.port_listening_promise_conf = dict(
check_port_listening_script=check_port_listening_script,
)
kvm_conf = self.installKvm(vnc_ip = self.getLocalIPv4Address())
vnc_port = 5900 + kvm_conf['vnc_display']
vnc_port = Recipe.VNC_BASE_PORT + kvm_conf['vnc_display']
noVNC_conf = self.installNoVnc(source_ip = self.getGlobalIPv6Address(),
source_port = 6080,
target_ip = kvm_conf['vnc_ip'],
target_port = vnc_port,
python_path = kvm_conf['python_path'])
target_port = vnc_port)
self.linkBinary()
self.computer_partition.setConnectionDict(dict(
......@@ -137,8 +155,7 @@ class Recipe(BaseSlapRecipe):
# Instanciate KVM
kvm_template_location = pkg_resources.resource_filename(
__name__, os.path.join(
'template', 'kvm_run.in'))
__name__, 'template/kvm_run.in')
kvm_runner_path = self.createRunningWrapper("kvm",
self.substituteTemplate(kvm_template_location,
......@@ -148,9 +165,7 @@ class Recipe(BaseSlapRecipe):
# Instanciate KVM controller
kvm_controller_template_location = pkg_resources.resource_filename(
__name__, os.path.join(
'template',
'kvm_controller_run.in' ))
__name__, 'template/kvm_controller_run.in')
kvm_controller_runner_path = self.createRunningWrapper("kvm_controller",
self.substituteTemplate(kvm_controller_template_location,
......@@ -165,10 +180,20 @@ class Recipe(BaseSlapRecipe):
##slapreport_runner_path = self.instanciate_wrapper("slapreport",
# [database_path, python_path])
# Add VNC promise
self.port_listening_promise_conf.update(
hostname=kvm_conf['vnc_ip'],
port=Recipe.VNC_BASE_PORT + kvm_conf['vnc_display'],
)
self.createPromiseWrapper("vnc_promise",
self.substituteTemplate(self.port_listening_promise_path,
self.port_listening_promise_conf,
)
)
return kvm_conf
def installNoVnc(self, source_ip, source_port, target_ip, target_port,
python_path):
def installNoVnc(self, source_ip, source_port, target_ip, target_port):
"""
Create noVNC configuration dictionnary and instanciate Websockify proxy
......@@ -184,11 +209,17 @@ class Recipe(BaseSlapRecipe):
noVNC_conf['source_ip'] = source_ip
noVNC_conf['source_port'] = source_port
# Install numpy.
# XXX-Cedric : this looks like a hack. Do we have better solution, knowing
# That websockify is not an egg?
numpy = zc.buildout.easy_install.install(['numpy'], self.options['eggs-directory'])
environment = dict(PYTHONPATH='%s' % numpy.entries[0])
# Instanciate Websockify
websockify_runner_path = zc.buildout.easy_install.scripts([('websockify',
'slapos.recipe.librecipe.execute', 'execute_wait')], self.ws,
'slapos.recipe.librecipe.execute', 'executee_wait')], self.ws,
sys.executable, self.wrapper_directory, arguments=[
[python_path.strip(),
[sys.executable.strip(),
self.options['websockify_path'],
'--web',
self.options['noVNC_location'],
......@@ -197,11 +228,22 @@ class Recipe(BaseSlapRecipe):
'--ssl-only',
'%s:%s' % (source_ip, source_port),
'%s:%s' % (target_ip, target_port)],
[self.certificate_path, self.key_path]]
[self.certificate_path, self.key_path],
environment]
)[0]
self.path_list.append(websockify_runner_path)
# Add noVNC promise
self.port_listening_promise_conf.update(hostname=noVNC_conf['source_ip'],
port=noVNC_conf['source_port'],
)
self.createPromiseWrapper("novnc_promise",
self.substituteTemplate(self.port_listening_promise_path,
self.port_listening_promise_conf,
)
)
return noVNC_conf
def linkBinary(self):
......
import socket
import sys
def connection_attempt():
try:
hostname, port = sys.argv[1:3]
except ValueError:
print >> sys.stderr, """Bad command line.
Usage: %s hostname|ip port""" % sys.argv[0]
sys.exit(1)
connection_okay = False
try:
s = socket.create_connection((hostname, port))
connection_okay = True
s.close()
except (socket.error, socket.timeout):
connection_okay = False
if not connection_okay:
print >> sys.stderr, "%(port)s on %(ip)s isn't listening" % {
'port': port, 'ip': hostname
}
sys.exit(127)
#!/usr/bin/env sh
"%(check_port_listening_script)s" "%(hostname)s" "%(port)s"
exit $?
This diff is collapsed.
import os
import sys
import time
def runApache(args):
sleep = 60
conf = args[0]
while True:
ready = True
for f in conf.get('required_path_list', []):
if not os.path.exists(f):
print 'File %r does not exists, sleeping for %s' % (f, sleep)
ready = False
if ready:
break
time.sleep(sleep)
apache_wrapper_list = [conf['binary'], '-f', conf['config'], '-DFOREGROUND']
apache_wrapper_list.extend(sys.argv[1:])
sys.stdout.flush()
sys.stderr.flush()
os.execl(apache_wrapper_list[0], *apache_wrapper_list)
This diff is collapsed.
import sys
import subprocess
def executeRunner(args):
"""Start the instance configure. this may run a python script, move or/and rename
file or directory when dondition is filled. the condition may be when file exist or when an entry
exist into database.
"""
arguments, delete, rename, chmod, data = args
if delete != []:
print "Calling lampconfigure with 'delete' arguments"
result = subprocess.Popen(arguments + delete)
result.wait()
if rename != []:
for parameters in rename:
print "Calling lampconfigure with 'rename' arguments"
result = subprocess.Popen(arguments + parameters)
result.wait()
if chmod != []:
print "Calling lampconfigure with 'chmod' arguments"
result = subprocess.Popen(arguments + chmod)
result.wait()
if data != []:
print "Calling lampconfigure with 'run' arguments"
result = subprocess.Popen(arguments + data)
result.wait()
return
This diff is collapsed.
This diff is collapsed.
CREATE DATABASE IF NOT EXISTS %(database)s;
GRANT ALL PRIVILEGES ON %(database)s.* TO %(user)s@localhost IDENTIFIED BY %(password)r;
GRANT ALL PRIVILEGES ON %(database)s.* TO %(user)s@'%%' IDENTIFIED BY %(password)r;
GRANT SHOW DATABASES ON *.* TO %(user)s@localhost IDENTIFIED BY %(password)r;
GRANT SHOW DATABASES ON *.* TO %(user)s@'%%' IDENTIFIED BY %(password)r;
FLUSH PRIVILEGES;
EXIT
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment