mirror of https://github.com/BOINC/boinc.git
Updates to build with lenny & the new BOINC package
git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@2201 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
parent
3cd58d5541
commit
5bc0dba9a7
|
@ -30,7 +30,7 @@
|
|||
#include <boinc_api.h>
|
||||
#include <filesys.h>
|
||||
#include <diagnostics.h>
|
||||
#include <graphics_api.h>
|
||||
#include <graphics2.h>
|
||||
#include <parse.h>
|
||||
|
||||
#include <dc_client.h>
|
||||
|
@ -402,14 +402,15 @@ int DC_sendMessage(const char *message)
|
|||
return DC_ERR_NOTIMPL;
|
||||
}
|
||||
|
||||
xml = (char *)malloc(6 * strlen(message) + 1);
|
||||
int buflen = 6 * strlen(message) + 1;
|
||||
xml = (char *)malloc(buflen);
|
||||
if (!xml)
|
||||
{
|
||||
DC_log(LOG_ERR, "Sending message: Out of memory");
|
||||
return DC_ERR_INTERNAL;
|
||||
}
|
||||
|
||||
xml_escape(message, xml);
|
||||
xml_escape(message, xml, buflen);
|
||||
len = strlen(xml) + 24;
|
||||
msg = (char *)malloc(len);
|
||||
if (!msg)
|
||||
|
|
|
@ -19,15 +19,14 @@
|
|||
|
||||
SCHED_CONFIG dc_boinc_config;
|
||||
|
||||
int _DC_parseConfigXML(const char *file)
|
||||
int _DC_parseConfigXML(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = dc_boinc_config.parse_config_file(file);
|
||||
ret = dc_boinc_config.parse_file();
|
||||
if (ret)
|
||||
{
|
||||
DC_log(LOG_ERR, "Failed to parse Boinc project "
|
||||
"configuration file %s", file);
|
||||
DC_log(LOG_ERR, "Failed to locate/parse the Boinc project configuration file");
|
||||
return DC_ERR_CONFIG;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -185,6 +185,7 @@ int DC_sendWUMessage(DC_Workunit *wu, const char *message)
|
|||
{
|
||||
DB_MSG_TO_HOST msg;
|
||||
char *xmlout;
|
||||
int buflen;
|
||||
|
||||
msg.clear();
|
||||
msg.create_time = time(NULL);
|
||||
|
@ -192,7 +193,8 @@ int DC_sendWUMessage(DC_Workunit *wu, const char *message)
|
|||
msg.handled = false;
|
||||
|
||||
/* BOINC tells output buffer should be 6x input size */
|
||||
xmlout = g_new(char, 6 * strlen(message) + 1);
|
||||
buflen = 6 * strlen(message) + 1;
|
||||
xmlout = g_new(char, buflen);
|
||||
if (!xmlout)
|
||||
{
|
||||
DC_log(LOG_WARNING, "Failed to send message because "
|
||||
|
@ -200,7 +202,7 @@ int DC_sendWUMessage(DC_Workunit *wu, const char *message)
|
|||
break;
|
||||
}
|
||||
|
||||
xml_escape(message, xmlout);
|
||||
xml_escape(message, xmlout, buflen);
|
||||
snprintf(msg.xml, sizeof(msg.xml), "<message>%s</message>", xmlout);
|
||||
g_free(xmlout);
|
||||
|
||||
|
|
|
@ -110,12 +110,8 @@ int DC_initMaster(const char *config_file)
|
|||
}
|
||||
|
||||
cfgval = DC_getCfgStr(CFG_PROJECTROOT);
|
||||
if (!cfgval)
|
||||
{
|
||||
DC_log(LOG_ERR, "%s is not specified in the config file",
|
||||
CFG_PROJECTROOT);
|
||||
return DC_ERR_CONFIG;
|
||||
}
|
||||
if (cfgval)
|
||||
setenv("BOINC_PROJECT_DIR", cfgval, 1);
|
||||
free(cfgval);
|
||||
|
||||
/* Check & switch to the working directory */
|
||||
|
@ -166,25 +162,7 @@ int DC_initMaster(const char *config_file)
|
|||
/* Enforce a canonical string representation of the UUID */
|
||||
uuid_unparse_lower(project_uuid, project_uuid_str);
|
||||
|
||||
/* Check the project's configuration */
|
||||
cfgval = DC_getCfgStr(CFG_CONFIGXML);
|
||||
if (!cfgval)
|
||||
{
|
||||
DC_log(LOG_ERR, "%s is not set in the config file",
|
||||
CFG_CONFIGXML);
|
||||
return DC_ERR_CONFIG;
|
||||
}
|
||||
|
||||
ret = access(cfgval, R_OK);
|
||||
if (ret)
|
||||
{
|
||||
DC_log(LOG_ERR, "Failed to access the project's configuration "
|
||||
"at %s: %s", cfgval, strerror(errno));
|
||||
free(cfgval);
|
||||
return DC_ERR_CONFIG;
|
||||
}
|
||||
|
||||
ret = _DC_parseConfigXML(cfgval);
|
||||
ret = _DC_parseConfigXML();
|
||||
free(cfgval);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -24,8 +24,6 @@ extern "C" {
|
|||
* Constants
|
||||
*/
|
||||
|
||||
/* Location of config.xml */
|
||||
#define CFG_CONFIGXML "BoincConfigXML"
|
||||
/* The root direcory of the BOINC project */
|
||||
#define CFG_PROJECTROOT "ProjectRootDir"
|
||||
/* Level of redundancy (per-client) */
|
||||
|
@ -131,7 +129,7 @@ extern uuid_t project_uuid;
|
|||
*/
|
||||
|
||||
/* Parses the project's config.xml */
|
||||
int _DC_parseConfigXML(const char *file) G_GNUC_INTERNAL;
|
||||
int _DC_parseConfigXML(void) G_GNUC_INTERNAL;
|
||||
|
||||
/* Returns the Boinc upload directory */
|
||||
char *_DC_getUploadDir(void) G_GNUC_INTERNAL;
|
||||
|
|
|
@ -19,8 +19,8 @@ AC_DEFUN([SZDG_BOINC_COMMON], [
|
|||
if test "$no_boinc" != yes; then
|
||||
case "$with_boinc" in
|
||||
yes|auto)
|
||||
BOINC_INCLUDES="/usr/include/BOINC"
|
||||
BOINC_CPPFLAGS="-I/usr/include/BOINC"
|
||||
BOINC_INCLUDES="/usr/include/boinc"
|
||||
BOINC_CPPFLAGS="-I/usr/include/boinc"
|
||||
BOINC_LDFLAGS=
|
||||
;;
|
||||
*)
|
||||
|
@ -30,7 +30,7 @@ AC_DEFUN([SZDG_BOINC_COMMON], [
|
|||
BOINC_CPPFLAGS="-I$with_boinc/api -I$with_boinc/lib -I$with_boinc/sched -I$with_boinc/tools -I$with_boinc/db"
|
||||
BOINC_LDFLAGS="-L$with_boinc/api -L$with_boinc/lib -L$with_boinc/sched"
|
||||
else
|
||||
BOINC_CPPFLAGS="-I$with_boinc/include/BOINC"
|
||||
BOINC_CPPFLAGS="-I$with_boinc/include/boinc"
|
||||
BOINC_LDFLAGS="-L$with_boinc/lib"
|
||||
fi
|
||||
;;
|
||||
|
@ -66,25 +66,6 @@ AC_DEFUN([SZDG_BOINC_SERVER], [
|
|||
AC_SUBST([MYSQL_CPPFLAGS])
|
||||
AC_SUBST([MYSQL_LIBS])
|
||||
|
||||
dnl
|
||||
dnl Check for BOINC 4.x/5.x
|
||||
dnl
|
||||
AC_LANG_PUSH([C++])
|
||||
AH_TEMPLATE([BOINC_VERSION], [BOINC major version])
|
||||
if test "$no_boinc" != yes; then
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOINC_CPPFLAGS"
|
||||
AC_CACHE_CHECK([for BOINC version], [boinc_cv_boinc_version], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sched_msgs.h>],
|
||||
[SCHED_MSG_LOG::Kind level = SCHED_MSG_LOG::CRITICAL;])],
|
||||
[boinc_cv_boinc_version=4],
|
||||
[boinc_cv_boinc_version=5])
|
||||
])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
AC_DEFINE_UNQUOTED([BOINC_VERSION], [$boinc_cv_boinc_version])
|
||||
fi
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
if test "$no_boinc" != yes; then
|
||||
BOINC_SERVER_CPPFLAGS="$BOINC_CPPFLAGS $MYSQL_CPPFLAGS"
|
||||
BOINC_SERVER_LIBS="-lsched $BOINC_COMMON_LIBS -lstdc++ $MYSQL_LIBS"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
7
|
|
@ -3,15 +3,13 @@ Section: devel
|
|||
Priority: extra
|
||||
Maintainer: Gábor Gombás <gombasg@sztaki.hu>
|
||||
Standards-Version: 3.6.2.1
|
||||
Build-Depends: boinc-dev (>= 1:5.6.4-1), uuid-dev, libglib2.0-dev, debhelper, automake1.9 | automaken (>= 1.9), autoconf (>= 2.53), libtool, gtk-doc-tools (>= 1.3)
|
||||
Build-Depends: boinc-dev (>= 1:6.9.0+r18425-1), uuid-dev, libglib2.0-dev, debhelper (>= 7), automake, autoconf (>= 2.53), libtool, gtk-doc-tools (>= 1.3)
|
||||
|
||||
Package: libdcapi-common-dev
|
||||
Section: libdevel
|
||||
Priority: extra
|
||||
Architecture: all
|
||||
Recommends: libdcapi-boinc-dev | libdcapi-dev
|
||||
Replaces: libdcapi-dev (<< 0.9-7)
|
||||
Conflicts: libdcapi-dev (<< 0.9-7)
|
||||
Description: Distributed Computing Platform API - Development files
|
||||
This package contains headers and libraries for building applications using
|
||||
the Distributed Computing Platform.
|
||||
|
@ -23,9 +21,7 @@ Section: libdevel
|
|||
Priority: extra
|
||||
Architecture: any
|
||||
Provides: libdcapi-dev
|
||||
Replaces: libdcapi-dev (<< 0.9-7)
|
||||
Conflicts: libdcapi-dev (<< 0.9-7)
|
||||
Depends: libdcapi-common-dev, pkg-config, libglib2.0-dev, boinc-dev (>= 5.6.4-1), uuid-dev
|
||||
Depends: libdcapi-common-dev (= ${Source-Version}), pkg-config, libglib2.0-dev, boinc-dev (>= 1:6.9.0+r18425-1), uuid-dev
|
||||
Description: Distributed Computing Platform API - Development files
|
||||
This package contains headers and libraries for building applications using
|
||||
the Distributed Computing Platform.
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# This is the debhelper compatibility version to use.
|
||||
export DH_COMPAT=4
|
||||
|
||||
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
|
||||
|
@ -17,7 +14,6 @@ else
|
|||
confflags += --build `echo $(DEB_BUILD_GNU_TYPE) | sed -e 's/i[345]86/i686/'` --host `echo $(DEB_HOST_GNU_TYPE) | sed -e 's/i[345]86/i686/'`
|
||||
endif
|
||||
|
||||
|
||||
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS = -g
|
||||
CXXFLAGS = -g
|
||||
|
@ -38,7 +34,6 @@ config.status: configure
|
|||
# autoreconf
|
||||
./configure $(confflags) \
|
||||
--prefix=/usr \
|
||||
--disable-maintainer-mode \
|
||||
--enable-gtk-doc \
|
||||
--enable-backend-boinc \
|
||||
--disable-backend-condor \
|
||||
|
|
|
@ -70,23 +70,13 @@
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>BoincConfigXML</term>
|
||||
<listitem>
|
||||
<para>
|
||||
REQUIRED. The location of the BOINC <filename>config.xml</filename>
|
||||
configuration file.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>ProjectRootDir</term>
|
||||
<listitem>
|
||||
<para>
|
||||
REQUIRED. The location of the project's root directory. This
|
||||
directory. This is the directory that contains the
|
||||
<filename>templates</filename>, <filename>upload</filename>,
|
||||
<filename>download</filename> and other BOINC-related
|
||||
OPTIONAL. The location of the project's root directory.
|
||||
This is the directory that contains
|
||||
<filename>config.xml</filename> and other BOINC-related
|
||||
subdirectories.
|
||||
</para>
|
||||
</listitem>
|
||||
|
|
|
@ -25,12 +25,6 @@ LogLevel = Debug
|
|||
# Configuration for BOINC DC-API implementation
|
||||
#--------------------------------------------------------
|
||||
|
||||
#
|
||||
# boinc config xml file. boinc_appmgr will set it automatically
|
||||
#
|
||||
|
||||
BoincConfigXML = *Must be specified*
|
||||
|
||||
#
|
||||
# BOINC project root directory. boinc_appmgr will set it automatically
|
||||
#
|
||||
|
|
|
@ -25,12 +25,6 @@ LogLevel = Debug
|
|||
# Configuration for BOINC DC-API implementation
|
||||
#--------------------------------------------------------
|
||||
|
||||
#
|
||||
# boinc config xml file. boinc_appmgr will set it automatically
|
||||
#
|
||||
|
||||
BoincConfigXML = *Must be specified*
|
||||
|
||||
#
|
||||
# BOINC project root directory. boinc_appmgr will set it automatically
|
||||
#
|
||||
|
|
|
@ -25,12 +25,6 @@ LogLevel = Debug
|
|||
# Configuration for BOINC DC-API implementation
|
||||
#--------------------------------------------------------
|
||||
|
||||
#
|
||||
# boinc config xml file. boinc_appmgr will set it automatically
|
||||
#
|
||||
|
||||
BoincConfigXML = *Must be specified*
|
||||
|
||||
#
|
||||
# BOINC project root directory. boinc_appmgr will set it automatically
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue