Commit 0526e075 authored by Łukasz Nowak's avatar Łukasz Nowak
Browse files

SlapOS related code moved out.

SlapOS code has been moved to: http://git.erp5.org/gitweb/slapos.git
parent 0eba9830
It is disallowed to:
* use hooks directory directly in buildout (eg. assuming that it will exists
while running buildout)
Rationale: It disallows using buildout in networked environment and extending
over network.
* accesing hooks by SVN URI
Rationale: It forces to use SVN structure and makes mirroring and HA hard to
obtain.
import os
import shutil
def post_make_hook(options, buildout):
make_options_list = [q for q in options.get('make-options', '').split('\n') if q]
if os.system('make %s -f Makefile-libbz2_so' % ' '.join(make_options_list)) != 0:
raise ValueError('Generation of dynamic library failed')
original = 'libbz2.so.1.0.6'
link_list = ['libbz2.so.1.0', 'libbz2.so.1', 'libbz2.so']
destination = os.path.join(options['location'], 'lib')
for filename in [original] + link_list:
f = os.path.join(destination, filename)
if os.path.exists(f) or os.path.islink(f):
os.unlink(f)
shutil.copyfile(os.path.join(os.curdir, original), os.path.join(destination,
original))
for link in link_list:
os.symlink(original, os.path.join(destination,
link))
import os
def pre_configure_hook(oprtions, buildout):
# fixes python bug related to not creating symlink contained in tarfiles
for missing in 'configure.ac', 'Makefile.in':
if not os.path.exists(os.path.join(os.path.curdir, missing)):
os.symlink(os.path.join(os.path.curdir, 'base', missing),
os.path.join(os.path.curdir, missing))
import os
import shutil
def post_make_hook(options, buildout):
destination = options['location']
directory_list = ['include', 'lib']
for d in directory_list:
dd = os.path.join(destination, d)
if not os.path.isdir(dd):
os.mkdir(dd)
for include in ['jbig.h', 'jbig85.h', 'jbig_ar.h']:
shutil.copyfile(os.path.join(os.curdir, 'libjbig', include),
os.path.join(destination, 'include', include))
for so in ['libjbig85.so', 'libjbig.so']:
shutil.copyfile(os.path.join(os.curdir, 'libjbig', so),
os.path.join(destination, 'lib', so))
import os
import sys
import traceback
from shutil import copy
from subprocess import Popen, PIPE
CONFIGURE_PATH = os.path.join('configure')
CONFIGURE_BACKUP_PATH = CONFIGURE_PATH + '_disabled'
# Fake configure, generating a fake Makefile which will create a marker file
# instead of actually installing anything.
# This is needed (?) to fetch --prefix from configure parameters, so we know
# where to tell Makefile to put the dummy file.
FAKE_CONFIGURE = '''#!%(python)s -S
import os
import sys
print 'Configuration is disabled on this host because %%s'
print 'Original configure file available at %(backup)s'
prefix = None
next = False
for arg in sys.argv:
if next:
prefix = arg
break
if arg.startswith('--prefix'):
if arg.startswith('--prefix='):
_, prefix = arg.split('=', 1)
break
next = True
if prefix is None:
raise '--prefix parameter not found'
# Generate Makefile with proper prefix
open('Makefile', 'w').write("""all:
\techo 'make disabled, see configure'
install:
\ttouch %%%%s""" %%%% (
os.path.join(prefix, 'BUILD_DISABLED_BY_BUILDOUT'),
))
sys.exit(0)
''' % {
'backup': CONFIGURE_BACKUP_PATH,
'python': sys.executable,
}
def pre_configure_hook(options, buildout):
gcc_executable = os.getenv('CC', 'gcc')
try:
gcc = Popen([gcc_executable, '-v'], stdout=PIPE, stderr=PIPE,
close_fds=True)
except OSError, (errno, _):
if errno == 2:
# No gcc installed, nothing to check
pass
else:
print 'Unexpected failure trying to detect gcc version'
traceback.print_exc()
else:
gcc.wait()
# Considered innocent until proven guilty.
error = None
for line in '\n'.join((gcc.stdout.read(), gcc.stderr.read())).splitlines():
if line.startswith('gcc version'):
if '4.1.1' in line and 'prerelease' in line:
# There is a bug in 4.1.1 prerelease (ie, as of mandriva
# 2007.0) g++ preventing kumo compilation from succeeding.
error = 'broken GCC version: %s' % (line, )
break
else:
print >>sys.stderr, 'GCC version could not be detected, ' \
'building anyway'
if error is not None:
print 'Disabling build, with reason:', error
# Copy to preserver permission
copy(CONFIGURE_PATH, CONFIGURE_BACKUP_PATH)
open(CONFIGURE_PATH, 'w').write(FAKE_CONFIGURE % (error, ))
import os
def pre_configure_hook(options, buildout):
os.chdir('build_unix')
import os
def pre_make_hook(options, buildout):
# change to pdftk directory, where built process shall be done
os.chdir('pdftk')
import os
def pre_configure_hook(options, buildout):
# remove certificate generation
# based on Gentoo: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-misc/stunnel/stunnel-4.33.ebuild
name = os.path.join('tools','Makefile.in')
f = file(name, 'r')
d = f.read().replace('install-data-local:', 'do-not-run-this:')
f.close()
file(name, 'w').write(d)
import os
import shutil
def pre_configure_hook(options, buildout):
os.chdir('unix')
def post_make_hook(options, buildout):
bindir = os.path.join(options['location'], 'bin')
destination = os.path.join(bindir, 'tclsh')
if not os.path.exists(destination):
original = os.path.join(bindir, [q for q in os.listdir(bindir) if q.startswith('tclsh')][0])
shutil.copy(original, destination)
[buildout]
parts =
instance
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
[instance]
recipe = ${instance-recipe:name}
dcrond_binary = ${dcron:location}/sbin/crond
haproxy_binary = ${haproxy:location}/sbin/haproxy
httpd_binary = ${apache:location}/bin/httpd
innobackupex_binary = ${xtrabackup:location}/bin/innobackupex
kumo_gateway_binary = ${kumo:location}/bin/kumo-gateway
kumo_manager_binary = ${kumo:location}/bin/kumo-manager
kumo_server_binary = ${kumo:location}/bin/kumo-server
logrotate_binary = ${logrotate:location}/usr/sbin/logrotate
memcached_binary = ${memcached:location}/bin/memcached
mysql_binary = ${mariadb:location}/bin/mysql
mysql_install_binary = ${mariadb:location}/bin/mysql_install_db
mysql_upgrade_binary = ${mariadb:location}/bin/mysql_upgrade
mysqld_binary = ${mariadb:location}/libexec/mysqld
openssl_binary = ${openssl:location}/bin/openssl
perl_binary = ${perl:location}/bin/perl
rdiff_backup_binary = ${buildout:bin-directory}/rdiff-backup
repozo_binary = ${buildout:bin-directory}/repozo
runTestSuite_binary = ${buildout:bin-directory}/runTestSuite
runUnitTest_binary = ${buildout:bin-directory}/runUnitTest
runzeo_binary = ${buildout:bin-directory}/runzeo
runzope_binary = ${buildout:bin-directory}/runzope
tidstorage_repozo_binary = ${buildout:bin-directory}/tidstorage_repozo
tidstoraged_binary = ${buildout:bin-directory}/tidstoraged
zabbix_agent_binary = ${zabbix-agent:location}/sbin/zabbix_agent
# cloudooo specific configuration
ooo_binary_path = ${libreoffice-bin:location}/program
ooo_paster = ${buildout:bin-directory}/cloudooo_paster
ooo_uno_path = ${libreoffice-bin:location}/basis-link/program
link_binary_list =
${coreutils:location}/bin/basename
${coreutils:location}/bin/cat
${coreutils:location}/bin/cp
${coreutils:location}/bin/ls
${coreutils:location}/bin/tr
${coreutils:location}/bin/uname
${git:location}/bin/git
${graphviz:location}/bin/dot
${grep:location}/bin/grep
${imagemagick:location}/bin/convert
${mariadb:location}/bin/mysql
${mariadb:location}/bin/mysqldump
${pdftk:location}/bin/pdftk
${sed:location}/bin/sed
${tesseract:location}/bin/tesseract
${w3m:location}/bin/w3m
${xpdf:location}/bin/pdfinfo
${xpdf:location}/bin/pdftotext
${xtrabackup:location}/bin/xtrabackup_51
# XXX: products won't be needed as soon as all ERP5 (and products-deps)
# products will be eggified so then it will be possible to use them thanks to
# availability in software's eggs
products = ${products:list}
environment =
LD_LIBRARY_PATH = ${file:location}/lib:${zlib:location}/lib:${freetype:location}/lib:${libXext:location}/lib:${libXau:location}/lib:${libX11:location}/lib:${libXdmcp:location}/lib:${libxcb:location}/lib
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@
MYSQL_INC="$MYSQL_INC -I$ac_mysql_source_dir/regex"
MYSQL_INC="$MYSQL_INC -I$ac_mysql_source_dir"
AC_SUBST(MYSQL_INC)
- MYSQL_SOURCE_VERSION=`cat $ac_mysql_source_dir/configure.in | grep "\[[MySQL Server\]]" | sed -e "s|.*\([[0-9]]\+\.[[0-9]]\+\.[[0-9]]\+[[0-9a-zA-Z\_\-]]*\).*|\1|"`
+ MYSQL_SOURCE_VERSION=`cat $ac_mysql_source_dir/configure.in | grep "\[[MariaDB Server\]]" | sed -e "s|.*\([[0-9]]\+\.[[0-9]]\+\.[[0-9]]\+[[0-9a-zA-Z\_\-]]*\).*|\1|"`
AC_MSG_RESULT([yes: Using $ac_mysql_source_dir, version $MYSQL_SOURCE_VERSION])
else
AC_MSG_ERROR([invalid MySQL source directory: $ac_mysql_source_dir])
--- a/handlersocket/database.cpp
+++ b/handlersocket/database.cpp
@@ -686,19 +686,19 @@
for (uint32_t i = 0; i < limit + skip; ++i) {
if (i == 0) {
const key_part_map kpm = (1U << args.kvalslen) - 1;
- r = hnd->index_read_map(table->record[0], key_buf, kpm, find_flag);
+ r = hnd->ha_index_read_map(table->record[0], key_buf, kpm, find_flag);
} else {
switch (find_flag) {
case HA_READ_BEFORE_KEY:
case HA_READ_KEY_OR_PREV:
- r = hnd->index_prev(table->record[0]);
+ r = hnd->ha_index_prev(table->record[0]);
break;
case HA_READ_AFTER_KEY:
case HA_READ_KEY_OR_NEXT:
- r = hnd->index_next(table->record[0]);
+ r = hnd->ha_index_next(table->record[0]);
break;
case HA_READ_KEY_EXACT:
- r = hnd->index_next_same(table->record[0], key_buf, kplen_sum);
+ r = hnd->ha_index_next_same(table->record[0], key_buf, kplen_sum);
break;
default:
r = HA_ERR_END_OF_FILE; /* to finish the loop */
fix warnings with gcc-4.4
http://bugs.gentoo.org/248738
--- cyrus-sasl-2.1.22/plugins/digestmd5.c
+++ cyrus-sasl-2.1.22/plugins/digestmd5.c
@@ -2715,7 +2715,7 @@ static sasl_server_plug_t digestmd5_serv
"DIGEST-MD5", /* mech_name */
#ifdef WITH_RC4
128, /* max_ssf */
-#elif WITH_DES
+#elif defined(WITH_DES)
112,
#else
1,
@@ -4034,7 +4034,7 @@ static sasl_client_plug_t digestmd5_clie
"DIGEST-MD5",
#ifdef WITH_RC4 /* mech_name */
128, /* max ssf */
-#elif WITH_DES
+#elif defined(WITH_DES)
112,
#else
1,
--- cyrus-sasl-2.1.23/include/sasl.h 2010-11-25 18:15:05.000000000 +0100
+++ cyrus-sasl-2.1.23/include/sasl.h 2010-11-25 18:15:34.000000000 +0100
@@ -346,7 +346,7 @@
* Mechanisms must ignore callbacks with id's they don't recognize.
*/
unsigned long id;
- int (*proc)(); /* Callback function. Types of arguments vary by 'id' */
+ int (*proc); /* Callback function. Types of arguments vary by 'id' */
void *context;
} sasl_callback_t;
# Patch for making dcron usable without root user, as a local service
diff -ru dcron-4.4.org/chuser.c dcron-4.4/chuser.c
--- dcron-4.4.org/chuser.c 2010-01-18 16:27:31.000000000 +0100
+++ dcron-4.4/chuser.c 2011-04-01 11:19:19.000000000 +0200
@@ -14,47 +14,6 @@
int
ChangeUser(const char *user, char *dochdir)
{
- struct passwd *pas;
-
- /*
- * Obtain password entry and change privilages
- */
-
- if ((pas = getpwnam(user)) == 0) {
- printlogf(LOG_ERR, "failed to get uid for %s\n", user);
- return(-1);
- }
- setenv("USER", pas->pw_name, 1);
- setenv("HOME", pas->pw_dir, 1);
- setenv("SHELL", "/bin/sh", 1);
-
- /*
- * Change running state to the user in question
- */
-
- if (initgroups(user, pas->pw_gid) < 0) {
- printlogf(LOG_ERR, "initgroups failed: %s %s\n", user, strerror(errno));
- return(-1);
- }
- if (setregid(pas->pw_gid, pas->pw_gid) < 0) {
- printlogf(LOG_ERR, "setregid failed: %s %d\n", user, pas->pw_gid);
- return(-1);
- }
- if (setreuid(pas->pw_uid, pas->pw_uid) < 0) {
- printlogf(LOG_ERR, "setreuid failed: %s %d\n", user, pas->pw_uid);
- return(-1);
- }
- if (dochdir) {
- /* try to change to $HOME */
- if (chdir(pas->pw_dir) < 0) {
- printlogf(LOG_ERR, "chdir failed: %s %s\n", user, pas->pw_dir);
- /* dochdir is a backup directory, usually /tmp */
- if (chdir(dochdir) < 0) {
- printlogf(LOG_ERR, "chdir failed: %s %s\n", user, dochdir);
- return(-1);
- }
- }
- }
- return(pas->pw_uid);
+ return getpwnam(user);
}
diff -ru dcron-4.4.org/crontab.c dcron-4.4/crontab.c
--- dcron-4.4.org/crontab.c 2010-01-18 16:27:31.000000000 +0100
+++ dcron-4.4/crontab.c 2011-04-01 11:19:19.000000000 +0200
@@ -316,9 +316,6 @@
close(filedes[0]);
- if (ChangeUser(user, NULL) < 0)
- exit(0);
-
fd = open(file, O_RDONLY);
if (fd < 0) {
printlogf(0, "unable to open %s: %s", file, strerror(errno));
@@ -344,8 +341,6 @@
const char *ptr;
char visual[SMALL_BUFFER];
- if (ChangeUser(user, TMPDIR) < 0)
- exit(0);
if ((ptr = getenv("EDITOR")) == NULL || strlen(ptr) >= sizeof(visual))
if ((ptr = getenv("VISUAL")) == NULL || strlen(ptr) >= sizeof(visual))
ptr = PATH_VI;
diff -ru dcron-4.4.org/job.c dcron-4.4/job.c
--- dcron-4.4.org/job.c 2010-01-18 16:27:31.000000000 +0100
+++ dcron-4.4/job.c 2011-04-01 11:19:19.000000000 +0200
@@ -62,14 +62,6 @@
* Change running state to the user in question
*/
- if (ChangeUser(file->cf_UserName, TempDir) < 0) {
- printlogf(LOG_ERR, "unable to ChangeUser (user %s %s)\n",
- file->cf_UserName,
- line->cl_Description
- );
- exit(0);
- }
-
/* from this point we are unpriviledged */
if (DebugOpt)
@@ -295,14 +287,6 @@
* by the mailing and we already verified the mail file.
*/
- if (ChangeUser(file->cf_UserName, TempDir) < 0) {
- printlogf(LOG_ERR, "unable to ChangeUser to send mail (user %s %s)\n",
- file->cf_UserName,
- line->cl_Description
- );
- exit(0);
- }
-
/* from this point we are unpriviledged */
/*
diff -ru dcron-4.4.org/Makefile dcron-4.4/Makefile
--- dcron-4.4.org/Makefile 2010-01-18 16:27:31.000000000 +0100
+++ dcron-4.4/Makefile 2011-04-01 11:19:35.000000000 +0200
@@ -3,7 +3,6 @@
# these variables can be configured by e.g. `make SCRONTABS=/different/path`
PREFIX = /usr/local
-CRONTAB_GROUP = wheel
SCRONTABS = /etc/cron.d
CRONTABS = /var/spool/cron/crontabs
CRONSTAMPS = /var/spool/cron/cronstamps
@@ -20,10 +19,10 @@
SHELL = /bin/sh
-INSTALL = install -o root
+INSTALL = install
INSTALL_PROGRAM = $(INSTALL) -D
-INSTALL_DATA = $(INSTALL) -D -m0644 -g root
-INSTALL_DIR = $(INSTALL) -d -m0755 -g root
+INSTALL_DATA = $(INSTALL) -D -m0644
+INSTALL_DIR = $(INSTALL) -d -m0755
CFLAGS ?= -O2
CFLAGS += -Wall -Wstrict-prototypes
SRCS = main.c subs.c database.c job.c concat.c chuser.c
@@ -44,7 +43,6 @@
echo "SBINDIR = $(SBINDIR)" >> config
echo "BINDIR = $(BINDIR)" >> config
echo "MANDIR = $(MANDIR)" >> config
- echo "CRONTAB_GROUP = $(CRONTAB_GROUP)" >> config
echo "SCRONTABS = $(SCRONTABS)" >> config
echo "CRONTABS = $(CRONTABS)" >> config
echo "CRONSTAMPS = $(CRONSTAMPS)" >> config
@@ -62,13 +60,10 @@
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $< -o $@
install:
- $(INSTALL_PROGRAM) -m0700 -g root crond $(DESTDIR)$(SBINDIR)/crond
- $(INSTALL_PROGRAM) -m4750 -g $(CRONTAB_GROUP) crontab $(DESTDIR)$(BINDIR)/crontab
+ $(INSTALL_PROGRAM) -m0755 crond $(DESTDIR)$(SBINDIR)/crond
+ $(INSTALL_PROGRAM) -m4750 crontab $(DESTDIR)$(BINDIR)/crontab
$(INSTALL_DATA) crontab.1 $(DESTDIR)$(MANDIR)/man1/crontab.1
$(INSTALL_DATA) crond.8 $(DESTDIR)$(MANDIR)/man8/crond.8
- $(INSTALL_DIR) $(DESTDIR)$(SCRONTABS)
- $(INSTALL_DIR) $(DESTDIR)$(CRONTABS)
- $(INSTALL_DIR) $(DESTDIR)$(CRONSTAMPS)
clean: force
rm -f *.o $(PROTOS)
--- Makefile.in 2002-10-08 16:09:12.000000000 +0000
+++ Makefile.in.nochange 2010-11-03 21:17:38.579435530 +0000
@@ -14,10 +14,6 @@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-# File ownership and group
-BINOWN = bin
-BINGRP = bin
-
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
@@ -131,11 +127,11 @@
$(INSTALL_ROOT)$(includedir) $(INSTALL_ROOT)$(man3dir) \
$(INSTALL_ROOT)$(infodir)
$(LIBTOOL) $(INSTALL) -c libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \
+ $(INSTALL_DATA) gdbm.h \
$(INSTALL_ROOT)$(includedir)/gdbm.h
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
+ $(INSTALL_DATA) $(srcdir)/gdbm.3 \
$(INSTALL_ROOT)$(man3dir)/gdbm.3
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
+ $(INSTALL_DATA) $(srcdir)/gdbm.info \
$(INSTALL_ROOT)$(infodir)/gdbm.info
install-compat:
@@ -143,9 +139,9 @@
$(INSTALL_ROOT)$(includedir)
$(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
$(INSTALL_ROOT)$(libdir)/libgdbm_compat.la
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \
+ $(INSTALL_DATA) $(srcdir)/dbm.h \
$(INSTALL_ROOT)$(includedir)/dbm.h
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \
+ $(INSTALL_DATA) $(srcdir)/ndbm.h \
$(INSTALL_ROOT)$(includedir)/ndbm.h
#libgdbm.a: $(OBJS) gdbm.h
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
--- ImageMagick-6.6.6-1/configure.ac~ 2010-11-28 21:51:05.000000000 +0100
+++ ImageMagick-6.6.6-1/configure.ac 2010-12-03 14:13:14.000000000 +0100
@@ -2791,7 +2791,7 @@
AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
-AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
+AC_PATH_PROGS(PSDelegate, "$PSDelegateDefault", "$PSDelegateDefault")
AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
--- ImageMagick-6.6.6-1/configure~ 2010-11-28 23:27:16.000000000 +0100
+++ ImageMagick-6.6.6-1/configure 2010-12-03 14:13:57.000000000 +0100
@@ -30931,7 +30931,7 @@
fi
-for ac_prog in gsx gsc "$PSDelegateDefault"
+for ac_prog in "$PSDelegateDefault"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
--- ImageMagick-6.6.7-4/configure~ 2011-02-10 11:50:21.704561096 +0100
+++ ImageMagick-6.6.7-4/configure 2011-02-10 12:23:45.612561097 +0100
@@ -28251,7 +28251,7 @@
#
have_lzma='no'
LZMA_LIBS=''
-if test "$with_lzma" != 'no' || test "$with_tiff" != 'no'; then
+if test "$with_lzma" != 'no'; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: -------------------------------------------------------------" >&5
$as_echo "-------------------------------------------------------------" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LZMA" >&5
--- ImageMagick-6.6.7-4/configure.ac~ 2011-02-10 11:50:21.693561096 +0100
+++ ImageMagick-6.6.7-4/configure.ac 2011-02-10 12:23:40.013561098 +0100
@@ -2290,7 +2290,7 @@
#
have_lzma='no'
LZMA_LIBS=''
-if test "$with_lzma" != 'no' || test "$with_tiff" != 'no'; then
+if test "$with_lzma" != 'no'; then
AC_MSG_RESULT([-------------------------------------------------------------])
AC_MSG_CHECKING(for LZMA)
AC_MSG_RESULT()
diff -ur jbigkit.orig/libjbig/Makefile jbigkit/libjbig/Makefile
--- jbigkit.orig/libjbig/Makefile 2008-08-30 20:20:52.000000000 +0300
+++ jbigkit/libjbig/Makefile 2010-02-28 13:12:41.000000000 +0200
@@ -1,29 +1,54 @@
# Unix makefile for the JBIG-KIT library
# $Id: jbigkit-2.0-build.patch,v 1.1 2010/02/28 11:21:39 ssuominen Exp $
-# Select an ANSI/ISO C compiler here, GNU gcc is recommended
-CC = gcc
+AR ?= ar
+CC ?= gcc
+RANLIB ?= ranlib
+
+CFLAGS += -Wall -ansi -pedantic
+
+ifeq ($(USERLAND),Darwin)
+ SONAME = dylib
+else
+ SONAME = so
+endif
-# Options for the compiler: A high optimization level is suggested
-CFLAGS = -g -O -Wall -ansi -pedantic # --coverage
-
-all: libjbig.a tstcodec tstcodec85
+all: libjbig.a libjbig.$(SONAME) libjbig85.a libjbig85.$(SONAME) tstcodec tstcodec85
tstcodec: tstcodec.o jbig.o jbig_ar.o
- $(CC) $(CFLAGS) -o tstcodec $+
+ $(CC) $(LDFLAGS) $(CFLAGS) -o tstcodec $+
tstcodec85: tstcodec85.o jbig85.o jbig_ar.o
- $(CC) $(CFLAGS) -o tstcodec85 $+
+ $(CC) $(LDFLAGS) $(CFLAGS) -o tstcodec85 $+
libjbig.a: jbig.o jbig_ar.o
rm -f libjbig.a
- ar rc libjbig.a jbig.o jbig_ar.o
- -ranlib libjbig.a
+ $(AR) rc libjbig.a jbig.o jbig_ar.o
+ -$(RANLIB) libjbig.a
+
+SOBJS = jbig.lo jbig_ar.lo
+
+libjbig.so: $(SOBJS)
+ $(CC) -shared $(LDFLAGS) -o $@ -Wl,-soname -Wl,$@ $(SOBJS)
+
+libjbig.dylib: $(SOBJS)
+ $(CC) -dynamic $(LDFLAGS) -o $@ -dynamiclib -install_name $@ $(SOBJS)
+
+SOBJS85 = jbig85.lo jbig_ar.lo
+
+libjbig85.so: $(SOBJS85)
+ $(CC) -shared $(LDFLAGS) -o $@ -Wl,-soname -Wl,$@ $(SOBJS85)
+
+libjbig85.dylib: $(SOBJS85)
+ $(CC) -dynamic $(LDFLAGS) -o $@ -dynamiclib -install_name $@ $(SOBJS85)
+
+%.lo: %.c jbig.h jbig85.h jbig_ar.h
+ $(CC) $(CFLAGS) -fPIC -c $< -o $@
libjbig85.a: jbig85.o jbig_ar.o
rm -f libjbig85.a
- ar rc libjbig85.a jbig85.o jbig_ar.o
- -ranlib libjbig85.a
+ $(AR) rc libjbig85.a jbig85.o jbig_ar.o
+ -$(RANLIB) libjbig85.a
jbig.o: jbig.c jbig.h jbig_ar.h
jbig85.o: jbig85.c jbig85.h jbig_ar.h
diff -ur jbigkit.orig/Makefile jbigkit/Makefile
--- jbigkit.orig/Makefile 2008-08-30 23:40:22.000000000 +0300
+++ jbigkit/Makefile 2010-02-28 12:59:07.000000000 +0200
@@ -1,34 +1,25 @@
# Unix makefile for JBIG-KIT
# $Id: jbigkit-2.0-build.patch,v 1.1 2010/02/28 11:21:39 ssuominen Exp $
-# Select an ANSI/ISO C compiler here, GNU gcc is recommended
-CC = gcc
-
-# Options for the compiler: A high optimization level is suggested
-CCFLAGS = -O2 -W
-#CCFLAGS = -O -g -W -Wall -ansi -pedantic #-DDEBUG # developer only
-
-CFLAGS = $(CCFLAGS) -I../libjbig
-
VERSION=2.0
all: lib pbm
- @echo "Enter 'make test' in order to start some automatic tests."
+ @echo "Enter '$(MAKE) test' in order to start some automatic tests."
lib:
- (cd libjbig; make "CC=$(CC)" "CFLAGS=$(CFLAGS)")
+ (cd libjbig; $(MAKE))
pbm: lib
- (cd pbmtools; make "CC=$(CC)" "CFLAGS=$(CFLAGS)")
+ (cd pbmtools; $(MAKE))
test: lib pbm
- (cd libjbig; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" test)
- (cd pbmtools; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" test)
+ (cd libjbig; $(MAKE) test)
+ (cd pbmtools; $(MAKE) test)
clean:
rm -f *~ core
- (cd libjbig; make clean)
- (cd pbmtools; make clean)
+ (cd libjbig; $(MAKE) clean)
+ (cd pbmtools; $(MAKE) clean)
distribution: clean
rm -f libjbig/libjbig*.a
diff -ur jbigkit.orig/pbmtools/Makefile jbigkit/pbmtools/Makefile
--- jbigkit.orig/pbmtools/Makefile 2008-08-26 01:26:39.000000000 +0300
+++ jbigkit/pbmtools/Makefile 2010-02-28 13:01:19.000000000 +0200
@@ -2,10 +2,10 @@
# $Id: jbigkit-2.0-build.patch,v 1.1 2010/02/28 11:21:39 ssuominen Exp $
# Select an ANSI/ISO C compiler here, e.g. GNU gcc is recommended
-CC = gcc
+CC ?= gcc
# Options for the compiler
-CFLAGS = -g -Wall -ansi -pedantic -I../libjbig # --coverage
+CFLAGS += -Wall -ansi -pedantic -I../libjbig
.SUFFIXES: .1 .5 .txt $(SUFFIXES)
@@ -13,16 +13,16 @@
pbmtojbg.txt jbgtopbm.txt pbm.txt pgm.txt
pbmtojbg: pbmtojbg.o ../libjbig/libjbig.a
- $(CC) $(CFLAGS) -o pbmtojbg pbmtojbg.o -L../libjbig -ljbig
+ $(CC) $(LDFLAGS) $(CFLAGS) -o pbmtojbg pbmtojbg.o -L../libjbig -ljbig
jbgtopbm: jbgtopbm.o ../libjbig/libjbig.a
- $(CC) $(CFLAGS) -o jbgtopbm jbgtopbm.o -L../libjbig -ljbig
+ $(CC) $(LDFLAGS) $(CFLAGS) -o jbgtopbm jbgtopbm.o -L../libjbig -ljbig
pbmtojbg85: pbmtojbg85.o ../libjbig/libjbig85.a
- $(CC) $(CFLAGS) -o pbmtojbg85 pbmtojbg85.o -L../libjbig -ljbig85
+ $(CC) $(LDFLAGS) $(CFLAGS) -o pbmtojbg85 pbmtojbg85.o -L../libjbig -ljbig85
jbgtopbm85: jbgtopbm85.o ../libjbig/libjbig85.a
- $(CC) $(CFLAGS) -o jbgtopbm85 jbgtopbm85.o -L../libjbig -ljbig85
+ $(CC) $(LDFLAGS) $(CFLAGS) -o jbgtopbm85 jbgtopbm85.o -L../libjbig -ljbig85
jbgtopbm.o: jbgtopbm.c ../libjbig/jbig.h
pbmtojbg.o: pbmtojbg.c ../libjbig/jbig.h
@@ -31,31 +31,31 @@
../libjbig/libjbig.a: ../libjbig/jbig.c ../libjbig/jbig.h \
../libjbig/jbig_ar.c ../libjbig/jbig_ar.h
- make -C ../libjbig libjbig.a
+ $(MAKE) -C ../libjbig libjbig.a
../libjbig/libjbig85.a: ../libjbig/jbig85.c ../libjbig/jbig85.h \
../libjbig/jbig_ar.c ../libjbig/jbig_ar.h
- make -C ../libjbig libjbig85.a
+ $(MAKE) -C ../libjbig libjbig85.a
test: test82 test85
test82: pbmtojbg jbgtopbm
- make IMG=ccitt1 OPTIONSP= dotest1
- make IMG=ccitt2 OPTIONSP= dotest1
- make IMG=ccitt3 OPTIONSP= dotest1
- make IMG=xvlogo "OPTIONSP=-d 3" dotest1
- make IMG=sandra OPTIONSP= OPTIONSJ= dotest2g
- make IMG=sandra OPTIONSP=-b OPTIONSJ=-b dotest2g
- make IMG=sandra OPTIONSP=-q OPTIONSJ= dotest2g
- make IMG=sandra "OPTIONSP=-o 0" OPTIONSJ= dotest2g
- make IMG=sandra "OPTIONSP=-o 2" OPTIONSJ= dotest2g
- make IMG=multi OPTIONSP= OPTIONSJ= dotest2g
- make IMG=multi OPTIONSP=-b OPTIONSJ=-b dotest2g
- make IMG=mx "OPTIONSP=-q -s 3 -m 128" dotest1
- make IMG=mx "OPTIONSP=-q -s 3 -m 128" dotest2b
- make IMG=mx "OPTIONSP=-q -s 3 -m 128 -p 92" dotest2b
- make IMG=mx "OPTIONSP=-q -Y -1" dotest2b
- make IMG=mx "OPTIONSP=-Y -1" dotest2b
+ $(MAKE) IMG=ccitt1 OPTIONSP= dotest1
+ $(MAKE) IMG=ccitt2 OPTIONSP= dotest1
+ $(MAKE) IMG=ccitt3 OPTIONSP= dotest1
+ $(MAKE) IMG=xvlogo "OPTIONSP=-d 3" dotest1
+ $(MAKE) IMG=sandra OPTIONSP= OPTIONSJ= dotest2g
+ $(MAKE) IMG=sandra OPTIONSP=-b OPTIONSJ=-b dotest2g
+ $(MAKE) IMG=sandra OPTIONSP=-q OPTIONSJ= dotest2g
+ $(MAKE) IMG=sandra "OPTIONSP=-o 0" OPTIONSJ= dotest2g
+ $(MAKE) IMG=sandra "OPTIONSP=-o 2" OPTIONSJ= dotest2g
+ $(MAKE) IMG=multi OPTIONSP= OPTIONSJ= dotest2g
+ $(MAKE) IMG=multi OPTIONSP=-b OPTIONSJ=-b dotest2g
+ $(MAKE) IMG=mx "OPTIONSP=-q -s 3 -m 128" dotest1
+ $(MAKE) IMG=mx "OPTIONSP=-q -s 3 -m 128" dotest2b
+ $(MAKE) IMG=mx "OPTIONSP=-q -s 3 -m 128 -p 92" dotest2b
+ $(MAKE) IMG=mx "OPTIONSP=-q -Y -1" dotest2b
+ $(MAKE) IMG=mx "OPTIONSP=-Y -1" dotest2b
rm -f test-*.jbg test-*.pbm test-*.pgm
./jbgtopbm ../examples/ccitt1.jbg | ./pbmtojbg > test-ccitt1.jbg
cmp ../examples/ccitt1.jbg test-ccitt1.jbg
@@ -91,24 +91,24 @@
cmp test-$(IMG).pgm ../examples/$(IMG).pgm
test85: pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85 test-t82.pbm
- make IMG=t82 "OPTIONSP=-p 0" dotest85
- make IMG=t82 "OPTIONSP=-p 8" dotest85
- make IMG=t82 "OPTIONSP=-p 8 -r" dotest85b
- make IMG=t82 "OPTIONSP=-p 64" dotest85
- make IMG=t82 "OPTIONSP=-p 72" dotest85
- make IMG=t82 "OPTIONSP=-s 2 -C c" dotest85
- make IMG=t82 "OPTIONSP=-s 99999" dotest85
- make IMG=t82 "OPTIONSP=-Y 9999 0" dotest85
- make IMG=t82 "OPTIONSP=-Y 1951 0" dotest85
- make IMG=t82 "OPTIONSP=-Y -1 127" dotest85
- make IMG=t82 "OPTIONSP=-Y -1 128" dotest85
- make IMG=t82 "OPTIONSP=-Y -1 1919" dotest85
- make IMG=t82 "OPTIONSP=-Y -1 1920" dotest85
- make IMG=t82 "OPTIONSP=-Y -1 1949" dotest85
- make IMG=t82 "OPTIONSP=-Y -1 1950" dotest85
- make IMG=ccitt1 dotest85
- make IMG=ccitt2 dotest85
- make IMG=ccitt3 dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-p 0" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-p 8" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-p 8 -r" dotest85b
+ $(MAKE) IMG=t82 "OPTIONSP=-p 64" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-p 72" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-s 2 -C c" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-s 99999" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-Y 9999 0" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-Y 1951 0" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-Y -1 127" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-Y -1 128" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-Y -1 1919" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-Y -1 1920" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-Y -1 1949" dotest85
+ $(MAKE) IMG=t82 "OPTIONSP=-Y -1 1950" dotest85
+ $(MAKE) IMG=ccitt1 dotest85
+ $(MAKE) IMG=ccitt2 dotest85
+ $(MAKE) IMG=ccitt3 dotest85
rm -f test-*.jbg test-*.jbg85 test-*.pbm
@echo
@echo "The T.85 pbmtools have PASSED the functional tests. Good!"
@@ -142,7 +142,7 @@
./jbgtopbm $< $@
test-t82.pbm:
- make -C ../libjbig tstcodec
+ $(MAKE) -C ../libjbig tstcodec
../libjbig/tstcodec $@
.1.txt .5.txt:
# Author: Guillaume BOTTEX
# Feature added: support for IPv6
# Bug fixed: https://github.com/etolabo/kumofs/issues#issue/8
diff --git a/src/logic/boot.cc b/src/logic/boot.cc
index d0a4c32..c197a30 100644
--- a/src/logic/boot.cc
+++ b/src/logic/boot.cc
@@ -29,6 +29,12 @@ scoped_listen_tcp::scoped_listen_tcp(struct sockaddr_in addr) :
m_addr(addr),
m_sock(listen(m_addr)) { }
+#ifdef KUMO_IPV6
+scoped_listen_tcp::scoped_listen_tcp(struct sockaddr_in6 addr) :
+ m_addr(addr),
+ m_sock(listen(m_addr)) { }
+#endif
+
scoped_listen_tcp::~scoped_listen_tcp()
{
::close(m_sock);
@@ -37,7 +43,11 @@ scoped_listen_tcp::~scoped_listen_tcp()
int scoped_listen_tcp::listen(const rpc::address& addr)
{
+#ifdef KUMO_IPV6
+ int lsock = socket(PF_INET6, SOCK_STREAM, 0);
+#else
int lsock = socket(PF_INET, SOCK_STREAM, 0);
+#endif
if(lsock < 0) {
throw std::runtime_error("socket failed");
}
@@ -152,7 +162,11 @@ void rpc_args::convert()
void cluster_args::convert()
{
cluster_addr = rpc::address(cluster_addr_in);
- cluster_addr_in.sin_addr.s_addr = INADDR_ANY; // listen any
+#ifdef KUMO_IPV6
+ // cluster_addr_in.sin6_addr = in6addr_any; // listen any
+#else
+ // cluster_addr_in.sin_addr.s_addr = INADDR_ANY; // listen any
+#endif
cluster_lsock = scoped_listen_tcp::listen(
rpc::address(cluster_addr_in));
rpc_args::convert();
diff --git a/src/logic/boot.h b/src/logic/boot.h
index 5d09549..e0e6ac1 100644
--- a/src/logic/boot.h
+++ b/src/logic/boot.h
@@ -31,6 +31,9 @@ namespace kumo {
class scoped_listen_tcp {
public:
scoped_listen_tcp(struct sockaddr_in addr);
+#ifdef KUMO_IPV6
+ scoped_listen_tcp(struct sockaddr_in6 addr);
+#endif
~scoped_listen_tcp();
public:
@@ -110,7 +113,11 @@ struct cluster_args : rpc_args {
virtual void set_basic_args();
virtual void show_usage();
+#ifdef KUMO_IPV6
+ struct sockaddr_in6 cluster_addr_in;
+#else
struct sockaddr_in cluster_addr_in;
+#endif
rpc::address cluster_addr; // convert
int cluster_lsock; // convert
diff --git a/src/logic/gateway/main.cc b/src/logic/gateway/main.cc
index 8829d6b..7faf81a 100644
--- a/src/logic/gateway/main.cc
+++ b/src/logic/gateway/main.cc
@@ -30,8 +30,13 @@ using namespace kumo;
struct arg_t : rpc_args {
+#ifdef KUMO_IPV6
+ sockaddr_in6 manager1_in;
+ sockaddr_in6 manager2_in;
+#else
sockaddr_in manager1_in;
sockaddr_in manager2_in;
+#endif
bool manager2_set;
rpc::address manager1; // convert
rpc::address manager2; // convert
@@ -48,15 +53,27 @@ struct arg_t : rpc_args {
std::string local_cache;
bool mctext_set;
+#ifdef KUMO_IPV6
+ sockaddr_in6 mctext_addr_in;
+#else
sockaddr_in mctext_addr_in;
+#endif
int mctext_lsock; // convert
bool mcbin_set;
+#ifdef KUMO_IPV6
+ sockaddr_in6 mcbin_addr_in;
+#else
sockaddr_in mcbin_addr_in;
+#endif
int mcbin_lsock; // convert
bool cloudy_set;
+#ifdef KUMO_IPV6
+ sockaddr_in6 cloudy_addr_in;
+#else
sockaddr_in cloudy_addr_in;
+#endif
int cloudy_lsock; // convert
bool mc_save_flag;
diff --git a/src/logic/manager/main.cc b/src/logic/manager/main.cc
index 5847ae0..63f948a 100644
--- a/src/logic/manager/main.cc
+++ b/src/logic/manager/main.cc
@@ -27,7 +27,11 @@ struct arg_t : cluster_args {
bool auto_replace;
bool partner_set;
+#ifdef KUMO_IPV6
+ struct sockaddr_in6 partner_in;
+#else
struct sockaddr_in partner_in;
+#endif
rpc::address partner; // convert
virtual void convert()
diff --git a/src/logic/server/main.cc b/src/logic/server/main.cc
index cd92e46..5d87120 100644
--- a/src/logic/server/main.cc
+++ b/src/logic/server/main.cc
@@ -25,8 +25,13 @@ struct arg_t : cluster_args {
std::string dbpath;
+#ifdef KUMO_IPV6
+ sockaddr_in6 manager1_in;
+ sockaddr_in6 manager2_in;
+#else
sockaddr_in manager1_in;
sockaddr_in manager2_in;
+#endif
bool manager2_set;
rpc::address manager1; // convert
rpc::address manager2; // convert
diff --git a/src/logic/server/mod_replace_stream.cc b/src/logic/server/mod_replace_stream.cc
index 091ebc9..25ee736 100644
--- a/src/logic/server/mod_replace_stream.cc
+++ b/src/logic/server/mod_replace_stream.cc
@@ -104,7 +104,11 @@ RPC_IMPL(mod_replace_stream_t, ReplaceOffer, req, z, response)
using namespace mp::placeholders;
m_stream_core->connect(
+#ifdef KUMO_IPV6
+ PF_INET6, SOCK_STREAM, 0,
+#else
PF_INET, SOCK_STREAM, 0,
+#endif
(sockaddr*)addrbuf, sizeof(addrbuf),
net->connect_timeout_msec(),
mp::bind(&mod_replace_stream_t::stream_connected, this, _1, _2));
diff --git a/src/rpc/client_tmpl.h b/src/rpc/client_tmpl.h
index 8424677..173a308 100644
--- a/src/rpc/client_tmpl.h
+++ b/src/rpc/client_tmpl.h
@@ -159,7 +159,11 @@ bool client_tmpl<Transport, Session>::async_connect(
addr.getaddr((sockaddr*)&addrbuf);
using namespace mp::placeholders;
+#ifdef KUMO_IPV6
+ wavy::connect(PF_INET6, SOCK_STREAM, 0,
+#else
wavy::connect(PF_INET, SOCK_STREAM, 0,
+#endif
(sockaddr*)addrbuf, sizeof(addrbuf),
m_connect_timeout_msec,
mp::bind(
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