From ae0afbfa2e76e27d21332f27be334594cddfc93b Mon Sep 17 00:00:00 2001
From: Alain Takoudjou <talino@tiolive.com>
Date: Tue, 28 May 2013 10:59:44 +0200
Subject: [PATCH] Build the latest stable version of BOINC

---
 component/boinc/buildout.cfg | 21 ++++++++++++++-------
 stack/boinc/buildout.cfg     |  4 ++--
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/component/boinc/buildout.cfg b/component/boinc/buildout.cfg
index 3f42c380c..9bf741ca1 100644
--- a/component/boinc/buildout.cfg
+++ b/component/boinc/buildout.cfg
@@ -26,29 +26,35 @@ keep-compile-dir = false
 [boinc-package]
 recipe = plone.recipe.command
 location = ${buildout:parts-directory}/${:_buildout_section_name_}
+tarball = ${buildout:parts-directory}/boinc.tar.gz
 svnversion = ${subversion:location}/bin/svnversion
 command = ${subversion:location}/bin/svn co http://boinc.berkeley.edu/svn/branches/server_stable ${:location} && \
-  sed -i 's#/usr/bin/svnversion#${:svnversion}#' ${:location}/tools/make_project
+  sed -i 's#/usr/bin/svnversion#${:svnversion}#' ${:location}/tools/make_project && \
+  sed -i "20i\#include <unistd.h>" ${:location}/tools/process_input_template.cpp && \
+  sed -i "25i\#include <unistd.h>" ${:location}/sched/single_job_assimilator.cpp && \
+  sed -i "27i\#include <unistd.h>" ${:location}/tools/create_work.cpp && \
+  sed -i 's#--prefix=$(prefix)#--prefix=/$(prefix)#' ${:location}/py/Makefile.am
+  cd ${:location} && rm -f ${:tarball} && tar -cvzf ${:tarball} .
+update-command = 
 
 # Compile now boinc
 # When installing boinc python module, path /srv/slapgrid/... is strip to srv/slapgrid... It is why
 # we need to set --prefix="/${buildout:parts-directory}/${:_buildout_section_name_}"
 [boinc]
-recipe = hexagonit.recipe.cmmi
-url = ${boinc-package:location}
+recipe = slapos.recipe.cmmi
+url = ${boinc-package:tarball}
 keep-compile-dir = true
 source = ${buildout:parts-directory}/${:_buildout_section_name_}__compile__
-configure-command =
+configure-command =  
   echo 'AC_PROG_OBJCXX' >> configure.ac
   aclocal -I${pkgconfig:location}/share/aclocal -I${libtool:location}/share/aclocal
   ./_autosetup
   ./configure
 configure-options = 
-  --prefix="/${buildout:parts-directory}/${:_buildout_section_name_}"
+  --prefix="${buildout:parts-directory}/${:_buildout_section_name_}"
   --disable-fcgi
   --disable-shared
   --enable-static
-  --with-pic
   --disable-manager
   --disable-client
   --with-pkg-config
@@ -59,13 +65,14 @@ configure-options =
   --with-libcurl=${curl:location}/lib
   --with-x=no
 
+
 environment =
   PATH=${pkgconfig:location}/bin:${automake:location}/bin:${autoconf:location}/bin:${libtool:location}/bin:${subversion:location}/bin:%(PATH)s
   PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
   M4=${m4:location}/bin/m4
-  CFLAGS=-fPIC
   CPPFLAGS=-I${openssl:location}/include -I${mariadb:location}/include
   LDFLAGS = -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${mariadb:location}/lib -Wl,-rpath=${mariadb:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
   MYSQL_CONFIG=${mariadb:location}/bin/mysql_config
   ACLOCAL_PATH=${pkgconfig:location}/share/aclocal:${libtool:location}/share/aclocal
+
   
\ No newline at end of file
diff --git a/stack/boinc/buildout.cfg b/stack/boinc/buildout.cfg
index 3848247a0..a3f513de0 100644
--- a/stack/boinc/buildout.cfg
+++ b/stack/boinc/buildout.cfg
@@ -40,9 +40,9 @@ mode = 0644
 #Template for deploying MySQL Database Server
 [template-mariadb]
 recipe = slapos.recipe.template
-url = ${:_profile_base_location_}/instance-mariadb.cfg
+url = ${:_profile_base_location_}/../lamp/mariadb/instance-mariadb.cfg.in
 output = ${buildout:directory}/template-mariadb.cfg
-md5sum = 8142244a3087a23e002a08225579528a  
+#md5sum = 8142244a3087a23e002a08225579528a  
 mode = 0644
 
 [template-httpd-conf]
-- 
2.30.9