Commit a69cc4ec authored by Cédric de Saint Martin's avatar Cédric de Saint Martin

Merge remote-tracking branch 'viktor/master'

Conflicts:
	component/imagemagick/buildout.cfg
	component/libtiff/buildout.cfg
	component/postgresql/buildout.cfg
	setup.py
parents 0b21bcfc 1d830cd6
[buildout]
parts = apache-perl
parts = apache-perl perl-Apache2-Request
extends =
../apache/buildout.cfg
......@@ -15,7 +15,16 @@ configure-command =
${perl:location}/bin/perl Makefile.PL
configure-options =
MP_AP_PREFIX=${apache-2.2:location}
LIBS="-L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}"
# for mod_apreq2 and Apache2::Request
[perl-Apache2-Request]
recipe = slapos.recipe.build:cpan
modules =
I/IS/ISAAC/libapreq2-2.13.tar.gz
perl = perl
cpan-configuration =
makepl_arg = ('--with-apache2-apxs=${apache-2.2:location}/bin/apxs')
environment =
# CPPFLAGS=-I${libuuid:location}/include
MP_CCOPTS=-L${libuuid:location}/lib
APR_LDFLAGS = -L${libuuid:location}/lib -Wl,-R${libuuid:location}/lib -L${libexpat:location}/lib -Wl,-R${libexpat:location}/lib -L${apache-2.2:location}/lib -Wl,-R${apache-2.2:location}/lib
LDFLAGS=-L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -L${libexpat:location}/lib -Wl,-rpath=${libexpat:location}/lib -L${apache-2.2:location}/lib -Wl,-rpath=${apache-2.2:location}/lib
......@@ -149,6 +149,7 @@ configure-options = --disable-static
--enable-proxy-scgi
--enable-dav
--enable-dav-fs
--enable-dav-lock
--enable-so
--enable-ssl
--with-included-apr
......
......@@ -28,7 +28,7 @@ filename = imagemagick-6.6.6-1-no-gsx-gsc-probe.patch
[imagemagick]
recipe = hexagonit.recipe.cmmi
url = http://ftp.vim.org/ImageMagick/ImageMagick-6.8.1-9.tar.bz2
url = ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.8.1-10.tar.bz2
md5sum = cde56988f9d2208d9d61815cc23665b4
depends =
${libtiff:version}
......
......@@ -10,7 +10,7 @@ parts =
[libtiff]
recipe = hexagonit.recipe.cmmi
version = 4.0.3
url = http://download.osgeo.org/libtiff/tiff-${:version}.tar.gz
url = http://www.imagemagick.org/download/delegates/tiff-${:version}.tar.gz
md5sum = 051c1068e6a0627f461948c365290410
configure-options =
--disable-static
......
[buildout]
extends =
../perl/buildout.cfg
../../component/openssl/buildout.cfg
../../component/zlib/buildout.cfg
parts =
perl-Crypt-SSLeay
[perl-Crypt-SSLeay]
recipe = slapos.recipe.build:cpan
modules =
G/GA/GAAS/URI-1.60.tar.gz
N/NA/NANIS/Crypt-SSLeay-0.64.tar.gz
cpan-configuration =
make_arg=('OTHERLDFLAGS="-L${zlib:location}/lib -Wl,-R${zlib:location}/lib -L${openssl:location}/lib -Wl,-R${openssl:location}/lib"')
makepl_arg=('INC=-I${openssl:location}/include')
environment =
OPENSSL_PREFIX=${openssl:location}
perl = perl
[buildout]
extends =
../perl/buildout.cfg
../postgresql/buildout.cfg
parts =
perl-DBD-Pg
[perl-DBD-Pg]
recipe = slapos.recipe.build:cpan
modules =
T/TU/TURNSTEP/DBD-Pg-2.19.3.tar.gz
environment =
POSTGRES_HOME=${postgresql:location}
perl = perl
[buildout]
extends =
../perl/buildout.cfg
../imagemagick/buildout.cfg
parts = perl-Image-Magick
[perl-Image-Magick_MakefilePL.patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = 31043e2b79e725d3b251aa09b4549046
download-only = true
filename = ${:_buildout_section_name_}
[perl-Image-Magick]
recipe = hexagonit.recipe.cmmi
depends =
${perl:version}
${imagemagick:location}
url = http://search.cpan.org/CPAN/authors/id/J/JC/JCRISTY/PerlMagick-6.77.tar.gz
md5sum = fa0f66fa0cabbd1b196254f94dec8e99
patch-options = -p0
patches =
${perl-Image-Magick_MakefilePL.patch:location}/${perl-Image-Magick_MakefilePL.patch:filename}
configure-command =
${perl:location}/bin/perl Makefile.PL LIBS="-L${imagemagick:location}/lib -Wl,-R${imagemagick:location}/lib -L${perl:location}/libs-c -Wl,-R${perl:location}/libs-c" INC="-I${imagemagick:location}/include/ImageMagick"
--- Makefile.PL.orig 2012-10-02 14:58:25.537661734 +0200
+++ Makefile.PL 2012-10-02 15:23:32.250928745 +0200
@@ -156,11 +156,26 @@
}
# defaults for LIBS & INC & CCFLAGS params that we later pass to Writemakefile
-my $INC_magick = '-I../ -I.. -pthread -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -pthread -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/graphviz -I/usr/include/freetype2 -I/usr/include/libxml2 -I"' . $Config{'usrinc'} . '/ImageMagick"';
-my $LIBS_magick = '-L../magick/.libs -lMagickCore -lperl -lm';
-my $CCFLAGS_magick = "$Config{'ccflags'} -fopenmp -g -O2 -Wall -pthread";
-my $LDFLAGS_magick = "-L../magick/.libs -lMagickCore $Config{'ldflags'} -L/usr/lib";
-my $LDDLFLAGS_magick = "-L../magick/.libs -lMagickCore $Config{'lddlflags'} -L/usr/lib";
+my %paths_magick = ();
+foreach my $section ('INC', 'LIBS', 'CCFLAGS', 'LDFLAGS', 'LDDLFLAGS') {
+ $paths_magick{$section} = '';
+}
+{
+ my $i = 0;
+ while ($i <= $#ARGV) {
+ my ($key, $val) = split(/=/, $ARGV[$i], 2);
+ if (exists $paths_magick{$key}) {
+ $paths_magick{$key} = $val;
+ delete $ARGV[$i];
+ }
+ $i++;
+ }
+}
+# Enforce standard components
+$paths_magick{LIBS} .= ' -lMagickCore -lperl -lm';
+$paths_magick{CCFLAGS} .= " $Config{'ccflags'} -fopenmp -g -O2 -Wall -pthread";
+$paths_magick{LDFLAGS} .= " -lMagickCore $Config{'ldflags'}";
+$paths_magick{LDDLFLAGS} .= " -lMagickCore $Config{'lddlflags'}";
if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) {
my($Ipaths, $Lpaths) = AutodetectWin32gcc();
@@ -168,11 +183,11 @@
#
# Setup for strawberry perl.
#
- $INC_magick = "$Ipaths";
- $LIBS_magick = "-lMagickCore";
- $CCFLAGS_magick = "$Config{'ccflags'}";
- $LDFLAGS_magick = "$Config{'ldflags'} $Lpaths ";
- $LDDLFLAGS_magick = "$Config{'lddlflags'} $Lpaths ";
+ $paths_magick{INC} = "$Ipaths";
+ $paths_magick{LIBS} = "-lMagickCore";
+ $paths_magick{CCFLAGS} = "$Config{'ccflags'}";
+ $paths_magick{LDFLAGS} = "$Config{'ldflags'} $Lpaths ";
+ $paths_magick{LDDLFLAGS} = "$Config{'lddlflags'} $Lpaths ";
}
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
@@ -195,7 +210,7 @@
'DEFINE' => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING'
# Header search specfication and preprocessor flags
- 'INC' => $INC_magick,
+ 'INC' => $paths_magick{INC},
# C compiler
#'CC' => 'gcc -std=gnu99 -std=gnu99',
@@ -204,22 +219,22 @@
# 'CPPFLAGS' => "$Config{'cppflags'} -pthread -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -pthread -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/graphviz -I/usr/include/freetype2 -I/usr/include/libxml2",
# C compiler flags (e.g. -O -g)
- 'CCFLAGS' => $CCFLAGS_magick,
+ 'CCFLAGS' => $paths_magick{CCFLAGS},
# Linker
#'LD' => $Config{'ld'} == $Config{'cc'} ? 'gcc -std=gnu99 -std=gnu99' : $Config{'ld'},
# Linker flags for building an executable
- 'LDFLAGS' => $LDFLAGS_magick,
+ 'LDFLAGS' => $paths_magick{LDFLAGS},
# Linker flags for building a dynamically loadable module
- 'LDDLFLAGS' => $LDDLFLAGS_magick,
+ 'LDDLFLAGS' => $paths_magick{$LDDLFLAGS},
# Install PerlMagick binary into ImageMagick bin directory
'INSTALLBIN' => '/usr/local/bin',
# Library specification
- 'LIBS' => [ $LIBS_magick ],
+ 'LIBS' => [ $paths_magick{LIBS} ],
# Perl binary name (if a Perl binary is built)
'MAP_TARGET' => 'PerlMagick',
[buildout]
extends =
../perl/buildout.cfg
../xapian/buildout.cfg
parts =
perl-Search-Xapian
[perl-Search-Xapian]
recipe = slapos.recipe.build:cpan
modules =
O/OL/OLLY/Search-Xapian-1.2.10.0.tar.gz
environment =
XAPIAN_CONFIG=${xapian:location}/bin/xapian-config
perl = perl
[buildout]
extends =
../perl/buildout.cfg
../ncurses/buildout.cfg
../readline/buildout.cfg
parts = perl-Term-ReadLine-Gnu
[perl-Term-ReadLine-Gnu.patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = d4e4624e717c8da63e4d153149d57b68
download-only = true
filename = ${:_buildout_section_name_}
[perl-Term-ReadLine-Gnu]
recipe = hexagonit.recipe.cmmi
depends =
${perl:version}
url = http://search.cpan.org/CPAN/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu-1.20.tar.gz
md5sum = fa33510193b89a2ada74fcef00816322
patch-options = -p0
patches =
${perl-Term-ReadLine-Gnu.patch:location}/${perl-Term-ReadLine-Gnu.patch:filename}
configure-command =
${perl:location}/bin/perl Makefile.PL --libdir=${readline:location}/lib --includedir="${readline:location}/include" LIBS="-Wl,-R${readline:location}/lib -L${ncurses:location}/lib -Wl,-R${ncurses:location}/lib" INC="-I${ncurses:location}/include"
--- Makefile.PL.orig 2012-09-26 16:40:42.922821617 +0200
+++ Makefile.PL 2012-10-02 02:51:26.400659861 +0200
@@ -22,7 +22,22 @@
use Config;
use Getopt::Long;
use 5.007; use 5.7.0; # use version 1.09 for older Perl
-my ($defs, $libs, $lddflags, $RLLIB, $RLINC);
+my ($defs, $lddflags, %config);
+
+{
+ $config{LIBS} = '';
+ $config{INC} = '';
+
+ my $i = 0;
+ while ($i <= $#ARGV) {
+ my ($key, $val) = split(/=/, $ARGV[$i], 2);
+ $config{$key} = $val;
+ if ($key eq 'LIBS' || $key eq 'INC') {
+ delete $ARGV[$i];
+ }
+ $i++;
+ }
+}
# exit 0 before creating the Makefile to be CPAN Testers friendly
# see http://wiki.cpantester.org/wiki/CPANAuthorNotes
@@ -36,20 +51,23 @@
$defs = ($Config{strings} =~ m|/string.h$|) ? '-DHAVE_STRING_H' : '';
# Parse command line to specify paths for the GNU Readline Library
+# (if they have not already been included within LIBS or INC)
{
my ($prefix, $libdir, $incdir);
GetOptions("prefix=s" => \$prefix,
"libdir=s" => \$libdir,
"includedir=s" => \$incdir);
- $RLLIB = defined $libdir
+ my $RLLIB = defined $libdir
? "-L$libdir" : (defined $prefix ? "-L$prefix/lib" : '');
- $RLINC = defined $incdir
+ my $RLINC = defined $incdir
? "-I$incdir" : (defined $prefix ? "-I$prefix/include" : '');
+ $config{LIBS} .= " $RLLIB";
+ $config{INC} .= " $RLINC";
}
if ($Config{osname} eq 'os2') {
# Check ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2/
- $libs = '-lreadline_import';
+ $config{LIBS} .= ' -lreadline_import';
$defs .= ' -DOS2_USEDLL';
$lddflags = '';
} else {
@@ -60,18 +78,27 @@
# Old Cygwin may require setting false (0).
my $PREFER_CURSES = $Config{osname} eq 'aix' || $Config{osname} eq 'hpux'
|| $Config{osname} eq 'cygwin';
- my $TERMCAP_LIB = (! $PREFER_CURSES && &search_lib('-ltermcap'))
- || &search_lib('-lncurses')
- || &search_lib('-lcurses');
+ my @lib_dirs = ();
+ # Turn -L<path> parameters into a list of <path>s
+ {
+ foreach my $libopt (split(' ',$config{LIBS})) {
+ if ($libopt =~ m#^-L(.*)$#) {
+ push @lib_dirs, $1;
+ }
+ }
+ }
+ my $TERMCAP_LIB = (! $PREFER_CURSES && &search_lib('-ltermcap', \@lib_dirs))
+ || &search_lib('-lncurses', \@lib_dirs)
+ || &search_lib('-lcurses', \@lib_dirs);
unless ($TERMCAP_LIB) {
warn "Could not find neither libtermcap.a, libncurses.a, or libcurses.\n";
exit $err;
}
- $libs = "-lreadline $TERMCAP_LIB";
+ $config{LIBS} .= " -lreadline $TERMCAP_LIB";
# Latest Perl in FreeBSD does not need this hack. (Dec.2002)
- $libs .= ' -lcrypt' if ($Config{osname} =~ /freebsd/i);
+ $config{LIBS} .= ' -lcrypt' if ($Config{osname} =~ /freebsd/i);
$lddflags = '';
# If you are using old Cygwin, enable the following line.
#$lddflags = ($Config{osname} =~ /cygwin/i) ? '-static' : '';
@@ -80,7 +107,7 @@
# Check version of GNU Readline Library (for version 4.2 and before)
{
my ($rlmajorver, $rlminorver) =
- check_readline_version($RLINC, $RLLIB, $defs, $lddflags, $libs);
+ check_readline_version($defs, $lddflags, \%config);
if ($rlmajorver < 4 || $rlmajorver == 4 && $rlminorver <= 2) {
$defs .= " -DRL_READLINE_VERSION=" .
@@ -95,15 +122,15 @@
(
NAME => 'Term::ReadLine::Gnu',
VERSION_FROM => 'Gnu.pm',
- LIBS => [ "$RLLIB $libs" ],
- LDDLFLAGS => "$RLLIB $Config{lddlflags}",
+ LIBS => $config{LIBS},
+ LDDLFLAGS => $Config{lddlflags},
dynamic_lib => { OTHERLDFLAGS => $lddflags },
DEFINE => $defs,
($Config{osname} eq 'os2' ?
(
IMPORTS => { xfree => 'emxlibcm.401' }, # Yuck!
) : () ),
- INC => $RLINC,
+ INC => $config{INC},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' },
clean => { FILES => "rlver.c rlver$Config{_exe}" },
);
@@ -122,20 +149,20 @@
exit(0);
########################################################################
-# Search a library '$lib' in $Config{libpth} directories, and return
+# Search a library '$lib' in the given directories (listref), and return
# $lib if exist or undef unless exist.
# ExtUtils::Liblist::ext() do similar job as this subroutine, but it
# warns unnecessary messages.
sub search_lib {
- my ($lib) = @_;
+ my ($lib, $lib_dirs) = @_;
unless ($lib =~ /^-l/) {
warn "search_lib: illegal arguments, \`$lib\'.\n";
return undef;
}
my $libbase = 'lib' . substr($lib, 2) . $Config{lib_ext};
my $libbase_so = 'lib' . substr($lib, 2) . "." . $Config{so};
- foreach (split(' ', $Config{libpth})) {
+ foreach (split(' ', $Config{libpth}), @$lib_dirs) {
if (-f $_ . '/' . $libbase) {
# print "$_/$libbase\n";
print "Found \`$_/$libbase\'.\n";
@@ -158,7 +185,7 @@
# RL_VERSION_MINOR
# Someday we don't need this subroutine..
sub check_readline_version {
- my ($RLINC, $RLLIB, $defs, $lddflags, $libs) = @_;
+ my ($defs, $lddflags, $config) = @_;
my $frlver = 'rlver.c';
# make temp file
@@ -172,7 +199,7 @@
close(F);
# compile it
- my $comp_cmd = "$Config{cc} $RLINC $Config{ccflags} $defs $frlver -o rlver $RLLIB $lddflags $Config{ldflags} $libs";
+ my $comp_cmd = "$Config{cc} $config->{INC} $Config{ccflags} $defs $frlver -o rlver $lddflags $Config{ldflags} $config->{LIBS}";
print $comp_cmd, "\n";
system($comp_cmd);
if ($?) {
[buildout]
extends =
../perl/buildout.cfg
../libiconv/buildout.cfg
parts = perl-Text-Iconv
[perl-Text-Iconv]
recipe = slapos.recipe.build:cpan
cpan-configuration =
makepl_arg='LIBS="-L${libiconv:location}/lib -Wl,-R${libiconv:location}/lib" INC="-I${libiconv:location}/include"'
modules =
M/MP/MPIOTR/Text-Iconv-1.7.tar.gz
perl = perl
[buildout]
extends =
../perl/buildout.cfg
../libxslt/buildout.cfg
../libxml2/buildout.cfg
../zlib/buildout.cfg
parts = perl-XML-LibXSLT
[perl-XML-LibXSLT]
recipe = slapos.recipe.build:cpan
cpan-configuration =
makepl_arg='LIBS="-L${libxslt:location}/lib -Wl,-R${libxslt:location}/lib -L${zlib:location}/lib -Wl,-R${zlib:location}/lib -L${libxml2:location}/lib -Wl,-R${libxml2:location}/lib" INC="-I${libxslt:location}/include -I${libxml2:location}/include/libxml2"'
modules =
S/SH/SHLOMIF/XML-LibXSLT-1.78.tar.gz
perl = perl
......@@ -12,24 +12,37 @@ md5sum = 9873a89c969bd5a478434c3b8b2d57d8
download-only = true
filename = ${:_buildout_section_name_}
[perl-postmakehook-download]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = 7fded8308c1676decf77575c6d6b325f
download-only = true
filename = create-libs-symlink.py
[perl]
recipe = hexagonit.recipe.cmmi
depends =
${gdbm:version}
version = 5.16.0
version = 5.14.2
url = http://www.cpan.org/src/5.0/perl-${:version}.tar.bz2
md5sum = 15a2f95fb27231e10998240f13acf961
md5sum = 04a4c5d3c1f9f19d77daff8e8cd19a26
siteprefix = ${buildout:parts-directory}/site_${:_buildout_section_name_}
patch-options = -p1
patches =
${perl-keep-linker-flags-in-ldflags.patch:location}/${perl-keep-linker-flags-in-ldflags.patch:filename}
# Viktor has adapted the following commands for AMD64 compilation
# TODO: find out how we can write a generic code that suits all architectures
configure-command =
sh Configure -des \
-A ccflags=-fPIC \
-Dprefix=${buildout:parts-directory}/${:_buildout_section_name_} \
-Dsiteprefix=${:siteprefix} \
-Dcflags=-I${gdbm:location}/include \
-Dldflags="-L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib" \
-Ui_db \
-Dnoextensions=ODBM_File
-Dnoextensions=ODBM_File \
-Dusethreads
environment =
PATH=${patch:location}/bin:%(PATH)s
CFLAGS='-m64 -mtune=nocona'
post-make-hook = ${perl-postmakehook-download:location}/${perl-postmakehook-download:filename}:post_make_hook
\ No newline at end of file
import fnmatch
import os
import pprint
def post_make_hook(options, buildout):
location = options['location']
matches = []
for root, dirnames, filenames in os.walk(location):
for filename in fnmatch.filter(filenames, 'libperl.a'):
matches.append(os.path.join(root, filename))
nr_matches = len(matches)
if nr_matches == 0:
print "ERROR - no libperl.* found!"
exit
elif nr_matches > 1:
print "WARNING - several libperl.a found, taking only the first one:", matches.join("\n")
# matches[0] is a prefix of "location"
# For the symlink, we want the relative path.
rel_link = os.path.relpath(os.path.dirname(matches[0]), location)
os.symlink(rel_link, os.path.join(location, "libs-c"))
print "Created symlink \"libs-c\" to", rel_link
......@@ -4,6 +4,7 @@ extends =
../readline/buildout.cfg
../zlib/buildout.cfg
../ncurses/buildout.cfg
../perl/buildout.cfg
parts = postgresql
......@@ -15,10 +16,10 @@ parts = postgresql
recipe = hexagonit.recipe.cmmi
url = http://ftp.postgresql.org/pub/source/v9.1.7/postgresql-9.1.7.tar.bz2
md5sum = eaf7b67493d59d1a60767ffdfbd65ce9
configure-options = --with-openssl
configure-options = --with-openssl --with-perl
environment =
CPPFLAGS=-I${zlib:location}/include -I${readline:location}/include -I${openssl:location}/include -I${ncurses:location}/lib
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${perl:location}/libs-c -Wl,-rpath=${perl:location}/libs-c
[postgresql92]
......@@ -28,5 +29,4 @@ md5sum = 1cc388988e69bf75c6b55d59070100f6
configure-options = --with-openssl
environment =
CPPFLAGS=-I${zlib:location}/include -I${readline:location}/include -I${openssl:location}/include -I${ncurses:location}/lib
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${perl:location}/libs-c -Wl,-rpath=${perl:location}/libs-c
[buildout]
parts =
rsync
[rsync]
recipe = hexagonit.recipe.cmmi
url = http://rsync.samba.org/ftp/rsync/src/rsync-3.0.9.tar.gz
md5sum = 5ee72266fe2c1822333c407e1761b92b
make-options =
PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
[buildout]
parts =
xapian
depends =
../zlib/buildout.cfg
../libuuid/buildout.cfg
[xapian]
recipe = hexagonit.recipe.cmmi
url = http://oligarchy.co.uk/xapian/1.2.12/xapian-core-1.2.12.tar.gz
md5sum = faf33a3945edbe4c848627750856cbeb
environment =
CPPFLAGS = -I${zlib:location}/include -I${libuuid:location}/include
LDFLAGS = -L${zlib:location}/lib -Wl,-R${zlib:location}/lib -L${libuuid:location}/lib -Wl,-R${libuuid:location}/lib
\ No newline at end of file
......@@ -70,6 +70,7 @@ setup(name=name,
'agent = slapos.recipe.agent:Recipe',
'apache.frontend = slapos.recipe.apache_frontend:Recipe',
'apache.zope.backend = slapos.recipe.apache_zope_backend:Recipe',
'apacheperl = slapos.recipe.apacheperl:Recipe',
'apachephp = slapos.recipe.apachephp:Recipe',
'apacheproxy = slapos.recipe.apacheproxy:Recipe',
'certificate_authority = slapos.recipe.certificate_authority:Recipe',
......@@ -126,6 +127,7 @@ setup(name=name,
'logrotate.d = slapos.recipe.logrotate:Part',
'memcached = slapos.recipe.memcached:Recipe',
'mkdirectory = slapos.recipe.mkdirectory:Recipe',
'mioga.instantiate = slapos.recipe.mioga.instantiate:Recipe',
'mydumper = slapos.recipe.mydumper:Recipe',
'mysql = slapos.recipe.mysql:Recipe',
'nbdserver = slapos.recipe.nbdserver:Recipe',
......
##############################################################################
#
# 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 shutil
import os
import signal
from binascii import b2a_uu as uuencode
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def install(self):
path_list = []
# Copy application
# shutil.rmtree(self.options['htdocs'])
# shutil.copytree(self.options['source'],
# self.options['htdocs'])
# Install apache
apache_config = dict(
pid_file=self.options['pid-file'],
lock_file=self.options['lock-file'],
ip=self.options['ip'],
port=self.options['port'],
error_log=self.options['error-log'],
access_log=self.options['access-log'],
document_root=self.options['htdocs'],
)
httpd_conf = self.createFile(self.options['httpd-conf'],
self.substituteTemplate(self.getTemplateFilename('apache.in'),
apache_config)
)
path_list.append(httpd_conf)
wrapper = self.createPythonScript(self.options['wrapper'],
'slapos.recipe.librecipe.execute.execute',
[self.options['httpd-binary'], '-f', self.options['httpd-conf'],
'-DFOREGROUND']
)
path_list.append(wrapper)
if os.path.exists(self.options['pid-file']):
# Reload apache configuration
with open(self.options['pid-file']) as pid_file:
pid = int(pid_file.read().strip(), 10)
try:
os.kill(pid, signal.SIGUSR1) # Graceful restart
except OSError:
pass
return path_list
# Apache static configuration
LoadModule log_config_module modules/mod_log_config.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule headers_module modules/mod_headers.so
LoadModule dir_module modules/mod_dir.so
LoadModule mime_module modules/mod_mime.so
LoadModule perl_module modules/mod_perl.so
LoadModule apreq_module modules/mod_apreq2.so
# Basic server configuration
PidFile "%(pid_file)s"
Listen [%(ip)s]:%(port)s
ServerAdmin someone@email
DefaultType text/plain
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
# Log configuration
ErrorLog "%(error_log)s"
LogLevel warn
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
<Perl>
use strict;
use warnings;
package mytest;
use Apache2::Const -compile => qw(OK);
use Apache2::RequestIO ();
use Apache2::RequestRec ();
use Apache2::Request;
use Date::Calc ();
use Image::Magick;
sub test_handler {
my ($r) = @_;
$r->content_type('text/plain');
{
my $date = localtime();
$r->print("Hello world! Current time: $date\n");
}
{
my $year = (localtime())[5] + 1900;
$r->print("Testing Date::Calc: English ordinal for current year is "
. Date::Calc::English_Ordinal($year) . "\n");
}
{
my $apreq = new Apache2::Request($r);
my $hello = $apreq->param('hello');
$r->print("Testing Apache2::Request: The parameter 'hello' is '$hello'\n");
}
{
my $im = new Image::Magick;
$r->print("Testing Image::Magick: PerlMagick success: "
. Image::Magick->Success . "\n");
}
return Apache2::Const::OK;
}
</Perl>
<Location />
SetHandler perl-script
PerlHandler mytest::test_handler
</Location>
DocumentRoot %(document_root)s
DirectoryIndex index.html
##############################################################################
#
# Copyright (c) 2012 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 pprint
import re
import shutil
import signal
import stat
import subprocess
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
"""\
Configure a Mioga instance:
- copy over /var and /buildinst directories
- call "make install-all"
"""
def removeIfExisting(self, filepath):
if os.path.isfile(filepath):
os.remove(filepath)
def rsync_dir(self, src, target):
if os.path.isdir(src) and not src.endswith('/'):
src += '/'
cmd = subprocess.Popen(self.options['rsync_bin'] + '/rsync -a --specials '
+ src + ' ' + target,
env=os.environ, shell=True)
cmd.communicate()
# Even if there is a dedicated update(), this is still called sometimes.
# So better not trust that and decide for ourselves.
def install(self):
self.options['admin_password'] = 'test_for_programmatic_setting'
# Copy the build/ and var/lib/Mioga2 folders into the instance
mioga_location = self.options['mioga_location']
var_dir = self.options['var_directory']
self.rsync_dir(os.path.join(mioga_location, 'var'), var_dir)
buildinst_dir = self.options['buildinst_directory']
self.rsync_dir(self.options['mioga_buildinst'], buildinst_dir)
former_directory = os.getcwd()
os.chdir(buildinst_dir)
vardir = self.options['var_directory']
mioga_base = os.path.join(vardir, 'lib', 'Mioga2')
fm = FileModifier('conf/Config.xml')
fm.modifyParameter('init_sql', 'no') # force_init_sql is set manually everywhere
fm.modifyParameter('install_dir', mioga_base)
fm.modifyParameter('tmp_dir', os.path.join(mioga_base, 'tmp'))
fm.modifyParameter('search_tmp_dir', os.path.join(mioga_base, 'mioga_search'))
fm.modifyParameter('maildir', os.path.join(vardir, 'spool', 'mioga', 'maildir'))
fm.modifyParameter('maildirerror', os.path.join(vardir, 'spool', 'mioga', 'error'))
fm.modifyParameter('mailfifo', os.path.join(vardir, 'spool', 'mioga', 'fifo'))
notifier_fifo = os.path.join(vardir, 'spool', 'mioga', 'notifier')
fm.modifyParameter('notifierfifo', notifier_fifo)
searchengine_fifo = os.path.join(vardir, 'spool', 'mioga', 'searchengine')
fm.modifyParameter('searchenginefifo', searchengine_fifo)
fm.modifyParameter('dbi_passwd', self.options['db_password'])
fm.modifyParameter('db_host', self.options['db_host'])
fm.modifyParameter('db_port', self.options['db_port'])
fm.modifyParameter('dav_host', self.options['public_ipv6'])
fm.modifyParameter('dav_port', self.options['public_ipv6_port'])
fm.modifyParameter('bin_dir', self.options['bin_dir'])
# db_name, dbi_login are standard
fm.save()
# Ensure no old data is kept
self.removeIfExisting('config.mk')
# if os.path.isdir('web/conf/apache'):
# shutil.rmtree('web/conf/apache')
environ = os.environ
environ['PATH'] = ':'.join([self.options['perl_bin'], # priority!
# Mioga scripts in Makefiles and shell scripts
self.options['bin_dir'],
self.options['libxslt_bin'],
self.options['libxml2_bin'],
self.options['postgres_bin'],
self.options['rsync_bin'],
environ['PATH'] ])
environ['MIOGA_SITEPERL'] = self.options['mioga_siteperl']
# Write the Postgres password file
pgpassfilepath = os.path.join(self.options['instance_root'], '.pgpass')
pgpassfile = open(pgpassfilepath, 'w')
pgpassfile.write(':'.join([re.sub(r':', r'\:', self.options['db_host']),
self.options['db_port'],
'*', # could be self.options['db_dbname'] or 'postgres'
self.options['db_username'],
self.options['db_password'] ]) + "\n")
pgpassfile.close()
os.chmod(pgpassfilepath, stat.S_IRUSR | stat.S_IWUSR)
environ['PGPASSFILE'] = pgpassfilepath
# We must call "make" in the SAME environment that
# "perl Makefile.PL" left!
cmd = subprocess.Popen(self.options['perl_bin'] + '/perl Makefile.PL disable_check'
+ ' && make slapos-instantiation',
env=environ, shell=True)
cmd.communicate()
# Apache configuration!
# Take the files that Mioga has prepared, and wrap some standard configuration around it.
# TODO: can't we squeeze this somehow into the generic apacheperl recipe?
apache_config_mioga = '''
LoadModule alias_module modules/mod_alias.so
LoadModule apreq_module modules/mod_apreq2.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule perl_module modules/mod_perl.so
# Basic server configuration
PidFile REPL_PID
Listen [REPL_IPV6HOST]:REPL_IPV6PORT
Listen REPL_IPV4HOST:REPL_IPV6PORT
# Listen [REPL_IPV6]:443 # what about mod_ssl and all that stuff?
# ServerAdmin someone@email
# Log configuration
ErrorLog REPL_ERRORLOG
LogLevel debug
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 REPL_ACCESSLOG common
DocumentRoot REPL_DOCROOT
DirectoryIndex index.html
DavLockDB REPL_DAVLOCK
Include conf/extra/httpd-autoindex.conf
'''
apache_config_mioga = (apache_config_mioga
.replace('REPL_PID', self.options['pid_file'])
.replace('REPL_IPV6HOST', self.options['public_ipv6'])
.replace('REPL_IPV4HOST', self.options['private_ipv4'])
.replace('REPL_IPV6PORT', self.options['public_ipv6_port'])
.replace('REPL_ERRORLOG', self.options['error_log'])
.replace('REPL_ACCESSLOG', self.options['access_log'])
.replace('REPL_DOCROOT', self.options['htdocs'])
.replace('REPL_STATIC', os.path.join(mioga_base, 'static'))
.replace('REPL_DAVLOCK', self.options['dav_locks']) )
mioga_prepared_apache_config_dir = os.path.join(mioga_base, 'conf', 'apache')
for filepath in os.listdir(mioga_prepared_apache_config_dir):
apache_config_mioga += ("# Read in from "+filepath+"\n" +
open(os.path.join(mioga_prepared_apache_config_dir, filepath)).read() + "\n" )
# Internal DAV only accepts its own addresses
apache_config_mioga = re.sub(
'Allow from localhost',
"Allow from "+self.options['private_ipv4']+"\n\tAllow from "+self.options['public_ipv6'],
apache_config_mioga)
path_list = []
open(self.options['httpd_conf'], 'w').write(apache_config_mioga)
# TODO: if that all works fine, put it into a proper template
# httpd_conf = self.createFile(self.options['httpd_conf'],
# self.substituteTemplate(self.getTemplateFilename('apache.in'),
# apache_config)
# )
path_list.append(os.path.abspath(self.options['httpd_conf']))
services_dir = self.options['services_dir']
httpd_wrapper = self.createPythonScript(
os.path.join(services_dir, 'httpd_wrapper'),
'slapos.recipe.librecipe.execute.execute',
[self.options['httpd_binary'], '-f', self.options['httpd_conf'],
'-DFOREGROUND']
)
path_list.append(httpd_wrapper)
for fifo in [notifier_fifo, searchengine_fifo]:
if os.path.exists(fifo):
if not stat.S_ISFIFO(os.stat(fifo).st_mode):
raise Exception("The file "+fifo+" exists but is not a FIFO.")
else:
os.mkfifo(fifo, 0600)
site_perl_bin = os.path.join(self.options['site_perl'], 'bin')
mioga_conf_path = os.path.join(mioga_base, 'conf', 'Mioga.conf')
notifier_wrapper = self.createPythonScript(
os.path.join(services_dir, 'notifier'),
'slapos.recipe.librecipe.execute.execute',
[ os.path.join(site_perl_bin, 'notifier.pl'),
mioga_conf_path ]
)
path_list.append(notifier_wrapper)
searchengine_wrapper = self.createPythonScript(
os.path.join(services_dir, 'searchengine'),
'slapos.recipe.librecipe.execute.execute',
[ os.path.join(site_perl_bin, 'searchengine.pl'),
mioga_conf_path ]
)
path_list.append(searchengine_wrapper)
crawl_fm = FileModifier( os.path.join('bin', 'search', 'crawl_sample.sh') )
# TODO: The crawl script will still call the shell command "date"
crawl_fm.modify(r'/var/tmp/crawl', self.options['log_dir'] + '/crawl')
crawl_fm.modify(r'/var/lib/Mioga2/conf', mioga_base + '/conf')
crawl_fm.modify(r'/usr/local/bin/(mioga2_(?:info|crawl|index).pl)',
site_perl_bin + r"/\g<1>")
crawl_path = os.path.join(self.options['bin_dir'], 'crawl.sh')
crawl_fm.save(crawl_path)
os.chmod(crawl_path, stat.S_IRWXU)
if os.path.exists(self.options['pid_file']):
# Reload apache configuration
with open(self.options['pid_file']) as pid_file:
pid = int(pid_file.read().strip(), 10)
try:
os.kill(pid, signal.SIGUSR1) # Graceful restart
except OSError:
pass
os.chdir(former_directory)
print "Mioga instantiate.py::install finished!"
return path_list
# Copied and adapted from mioga-hooks.py - how to reuse code?
class FileModifier:
def __init__(self, filename):
self.filename = filename
f = open(filename, 'rb')
self.content = f.read()
f.close()
def modifyParameter(self, key, value):
(self.content, count) = re.subn(
r'(<parameter[^>]*\sname\s*=\s*"' + re.escape(key) + r'"[^>]*\sdefault\s*=\s*")[^"]*',
r"\g<1>" + value,
self.content)
return count
def modify(self, pattern, replacement):
(self.content, count) = re.subn(pattern, replacement, self.content)
return count
def save(self, output=""):
if output == "":
output = self.filename
f = open(output, 'w')
f.write(self.content)
f.close()
[buildout]
parts =
postgres-urlparse
# apacheperl-promise
mioga-instance
cron-entry-crawler
sshkeys-dropbear
dropbear-server-add-authorized-key
sshkeys-authority
publish-connection-information
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
bin = $${buildout:directory}/bin
etc = $${buildout:directory}/etc
srv = $${buildout:directory}/srv
log = $${buildout:directory}/log
var = $${buildout:directory}/var
buildinst = $${buildout:directory}/buildinst
[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run
promises = $${rootdirectory:etc}/promise
htdocs = $${rootdirectory:srv}/htdocs
cronstamps = $${rootdirectory:etc}/cronstamps/
cron-entries = $${rootdirectory:etc}/cron.d/
crontabs = $${rootdirectory:etc}/crontabs/
sshkeys = $${rootdirectory:srv}/sshkeys
ssh = $${rootdirectory:etc}/ssh
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${rootdirectory:bin}/cron_simplelogger
log = $${rootdirectory:log}/crond.log
[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cronstamps = $${basedirectory:cronstamps}
cron-entries = $${basedirectory:cron-entries}
crontabs = $${basedirectory:crontabs}
catcher = $${cron-simplelogger:wrapper}
binary = $${basedirectory:services}/crond
[cron-entry-crawler]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 23 50 * * *
command = $${mioga-instance:bin_dir}/crawl.sh
[apacheperl-promise]
recipe = slapos.cookbook:check_port_listening
path = $${basedirectory:promises}/httpd_promise
hostname = $${apacheperl-instance:ip}
port = $${apacheperl-instance:port}
[publish-connection-information]
recipe = slapos.cookbook:publish
direct_url = $${mioga-url:direct_url}
ssh_command = ssh $${dropbear-server:host} -p $${dropbear-server:port}
url = $${request-frontend:connection-site_url}
# Request POSTGRES INSTANCE and parse its URL
[request-postgres]
<= slap-connection
recipe = slapos.cookbook:request
name = Postgres
software-url = $${slap-connection:software-release-url}
software-type = postgres
return = url
sla = computer_guid
sla-computer_guid = $${slap-connection:computer-id}
[postgres-urlparse]
recipe = slapos.cookbook:urlparse
url = $${request-postgres:connection-url}
[symlinks]
recipe = cns.recipe.symlink
symlink_target = $${rootdirectory:bin}
symlink_base = ${postgresql:location}/bin
# SSH SERVER
[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
requests = $${basedirectory:sshkeys}/requests/
keys = $${basedirectory:sshkeys}/keys/
[sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority
request-directory = $${sshkeys-directory:requests}
keys-directory = $${sshkeys-directory:keys}
wrapper = $${basedirectory:services}/sshkeys_authority
keygen-binary = ${dropbear:location}/bin/dropbearkey
[dropbear-server]
recipe = slapos.cookbook:dropbear
host = $${slap-network-information:global-ipv6}
port = 2222
home = $${basedirectory:ssh}
wrapper = $${rootdirectory:bin}/raw_sshd
shell = /bin/bash
rsa-keyfile = $${basedirectory:ssh}/server_key.rsa
dropbear-binary = ${dropbear:location}/sbin/dropbear
[sshkeys-dropbear]
<= sshkeys-authority
recipe = slapos.cookbook:sshkeys_authority.request
name = dropbear
type = rsa
executable = $${dropbear-server:wrapper}
public-key = $${dropbear-server:rsa-keyfile}.pub
private-key = $${dropbear-server:rsa-keyfile}
wrapper = $${basedirectory:services}/sshd
[dropbear-server-add-authorized-key]
<= dropbear-server
recipe = slapos.cookbook:dropbear.add_authorized_key
key = $${slap-parameter:authorized-key}
[slap-parameter]
# Default value if no ssh key is specified
authorized-key =
# IPv4 AND PORT 80 FRONTEND
[request-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config = url
config-url = $${mioga-url:direct_url}
return = site_url
# MIOGA INSTANCE
[mioga-instance]
recipe = slapos.cookbook:mioga.instantiate
# mioga_compile_dir = ${template-apacheperl:compile-directory}
# Pity that the following line does not work. Or does it?
# mioga_compile_env = ${mioga:environment}
mioga_location = ${mioga:location}
mioga_buildinst = ${mioga:buildinst}
libxslt_bin = ${libxslt:location}/bin
libxml2_bin = ${libxml2:location}/bin
rsync_bin = ${rsync:location}/bin
var_directory = $${rootdirectory:var}
buildinst_directory = $${rootdirectory:buildinst}
instance_root = $${buildout:directory}
perl_bin = ${perl:location}/bin
postgres_bin = ${postgresql:location}/bin
htdocs = $${apacheperl-instance:htdocs}
db_host = $${postgres-urlparse:host}
db_port = $${postgres-urlparse:port}
db_dbname = $${postgres-urlparse:path}
db_username = $${postgres-urlparse:username}
db_password = $${postgres-urlparse:password}
public_ipv6 = $${slap-network-information:global-ipv6}
public_ipv6_port = 8080
private_ipv4 = $${slap-network-information:local-ipv4}
httpd_binary = ${apache-2.2:location}/bin/httpd
path = $${basedirectory:services}/apacheperl
htdocs = $${basedirectory:htdocs}
httpd_conf = $${rootdirectory:etc}/httpd.conf
pid_file = $${basedirectory:services}/apache.pid
lock_file = $${basedirectory:services}/apache.lock
dav_locks = $${buildout:directory}/var/dav_locks
services_dir = $${basedirectory:services}
error_log = $${rootdirectory:log}/error.log
access_log = $${rootdirectory:log}/access.log
bin_dir = $${rootdirectory:bin}
log_dir = $${rootdirectory:log}
site_perl = ${perl:siteprefix}
[mioga-url]
direct_url = http://[$${slap-network-information:global-ipv6}]:$${mioga-instance:public_ipv6_port}
\ No newline at end of file
[buildout]
parts =
symlinks
publish
postgres-instance
postgres-promise
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[instance-parameters]
# Fetches parameters defined in SlapOS Master for this instance
recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
bin = $${buildout:directory}/bin
etc = $${buildout:directory}/etc
services = $${rootdirectory:etc}/run/
promises = $${rootdirectory:etc}/promise/
var = $${buildout:directory}/var
[symlinks]
recipe = cns.recipe.symlink
symlink_target = $${rootdirectory:bin}
symlink_base = ${postgresql:location}/bin
[postgres-instance]
# create cluster, configuration files and a database
recipe = slapos.cookbook:postgres
# Options
ipv6_host = $${slap-network-information:global-ipv6}
user = mioga
port = 5432
dbname = mioga2
# pgdata_directory is created by initdb, and should not exist beforehand.
pgdata-directory = $${rootdirectory:var}/data
services = $${rootdirectory:services}
bin = $${rootdirectory:bin}
# Deploy promises scripts
[postgres-promise]
recipe = slapos.cookbook:check_port_listening
path = $${rootdirectory:promises}/postgres
hostname = $${slap-network-information:global-ipv6}
port = $${postgres-instance:port}
[publish]
recipe = slapos.cookbook:publishurl
url = $${postgres-instance:url}
[buildout]
parts =
switch-softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
parts = instance
[instance]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
source = ${application:location}
template = ${application-template:location}/${application-template:filename}
configuration = ${application-configuration:location}
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
default = ${template-apacheperl:output}
postgres = ${template-postgres:output}
httpd_binary = ${apache:location}/bin/httpd
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
import fnmatch
import grp
import os
import pprint
import pwd
import re
import shutil
import sys
class FileModifier:
def __init__(self, filename):
self.filename = filename
f = open(filename, 'rb')
self.content = f.read()
f.close()
def modify(self, key, value):
(self.content, count) = re.subn(
r'(<parameter[^>]*\sname\s*=\s*"' + re.escape(key) + r'"[^>]*\sdefault\s*=\s*")[^"]*',
r"\g<1>" + value,
self.content)
return count
def save(self):
f = open(self.filename, 'w')
f.write(self.content)
f.close()
def pre_configure_hook(options, bo, env):
location = options['location']
# TODO: double-check which one of these values must be set
# at instantiation time!
fm = FileModifier('conf/Config.xml')
fm.modify('apache_user', pwd.getpwuid(os.getuid())[0])
fm.modify('apache_group', grp.getgrgid(os.getgid())[0])
mioga_base = os.path.join(location, 'var', 'lib', 'Mioga2')
fm.modify('install_dir', mioga_base)
fm.modify('tmp_dir', os.path.join(mioga_base, 'tmp'))
fm.modify('search_tmp_dir', os.path.join(mioga_base, 'mioga_search'))
fm.modify('maildir', os.path.join(location, 'var', 'spool', 'mioga', 'maildir'))
fm.modify('maildirerror', os.path.join(location, 'var', 'spool', 'mioga', 'error'))
fm.modify('mailfifo', os.path.join(location, 'var', 'spool', 'mioga', 'fifo'))
fm.save()
# TODO: mail settings are certainly wrong, what is the domain name?
# Correct shebangs to the right Perl
for root, dirnames, filenames in os.walk('.'):
for filename in fnmatch.filter(filenames, '*.pl'):
with open(os.path.join(root, filename), "r+") as f:
lines = f.readlines()
(lines[0], count) = re.subn(r'^#!/usr/bin/perl',
'#!' + options['perl-binary'],
lines[0], 1)
if count > 0:
f.seek(0)
f.writelines(lines)
print "Corrected interpreter for script "+filename
# def post_make_hook(options, buildout):
# location = options['location']
# print "Mioga - postmakehook"
# print "We are currently in", os.getcwd()
# shutil.move("var", location)
# return None
diff --git a/INSTALL b/INSTALL
index ef0f369..b275a48 100644
--- a/INSTALL
+++ b/INSTALL
@@ -382,6 +382,8 @@ A default init script is provided in file web/conf/mioga2.init.d. This script wo
Additional configuration for the Search engine
----------------------------------------------
+The default init script starts the search engine daemon.
+
You must edit the crawl_sample.sh to specify default location for configuration files and rename it to crawl.sh.
This script must be run by cron in a day basis with apache user (www-data for Debian)
diff --git a/Makefile.PL b/Makefile.PL
index 3582d20..c24e217 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -20,8 +20,10 @@
# ============================================================================
+use Cwd;
use ExtUtils::MakeMaker;
use ExtUtils::MakeMaker::Config;
+use File::Find;
# ****************************************************************************
#
@@ -67,6 +69,7 @@ sub CheckPreDepends {
my $disable_check = grep {lc($_) eq 'disable_check'} @ARGV;
+if (! $disable_check) {
CheckPreDepends({ # 'Data::Dumper' => '2.101',
# 'DBI' => '1.13',
# 'DBD::Pg' => '1.01',
@@ -75,7 +78,8 @@ CheckPreDepends({ # 'Data::Dumper' => '2.101',
'Error' => '0.15',
# 'Net::LDAP' => '0.25',
# 'Unicode::String' => '2.06',
- });
+ })
+}
require MiogaConf;
@@ -115,7 +119,7 @@ my $docsubdirs = "docs";
# ----------------------------------------------------------------------------
sub MY::processPL {
return '
-# Not realy in the good section, but at a good place:
+# Not really in the good section, but at a good place:
# between "all" and next "tardist"
include config.mk
@@ -124,10 +128,7 @@ tardist: doc
dist: doc
install ::
if test -e $(TMP_DIR) ; then \
- if test -d $(TMP_DIR) ; then \
- ( su - $(APACHE_USER) -c "id" -s /bin/sh || \
- ( echo "===> Problem with \"$(APACHE_USER)\" user" ; exit 1 ) ) \
- else \
+ if ! test -d $(TMP_DIR) ; then \
echo "===> File $(TMP_DIR) exists but is not a directory ..." ; \
exit 1 ; \
fi \
@@ -156,6 +157,31 @@ install-all ::
(cd web && $(MAKE) setperms) || exit 1;
+slapos-compilation :: install
+ for i in bin locales web ; \
+ do \
+ (cd $$i && $(MAKE) install) || exit 1;\
+ done
+ # Create symlinks for static content that can be shared among all SlapOS instances
+ for i in var/lib/Mioga2/static var/lib/Mioga2/conf/themes/default var/lib/Mioga2/conf/xsl; do \
+ mkdir -p `dirname "$(MIOGA_STATIC)/$$i"` && \
+ mv "$(MIOGA_BASE)/$$i" "$(MIOGA_STATIC)/$$i" && \
+ ln -s "$(MIOGA_STATIC)/$$i" "$(MIOGA_BASE)/$$i"; \
+ done
+ # copy a minimal build system into mioga/build
+ mkdir -p "$(MIOGA_BUILDINST)"
+ cp -R --parents \
+ Makefile.PL sql web/conf web/skel conf bin/search/crawl_sample.sh \
+ "$(MIOGA_BUILDINST)"
+
+slapos-instantiation ::
+ rm -Rf web/conf/apache; (cd web/conf && $(MAKE) apache)
+
+ for i in web/conf conf web/skel sql ; \
+ do \
+ (cd $$i && $(MAKE) install) || exit 1;\
+ done
+
doc:
for i in ' . $docsubdirs . ' ; \
do \
@@ -176,9 +202,18 @@ installall: install install-all
#
# ----------------------------------------------------------------------------
+my $Mioga2_pm = 'lib/Mioga2.pm';
+if ((not -e $Mioga2_pm) and exists($ENV{MIOGA_SITEPERL})) {
+ my $findfile = sub {
+ if ($_ eq 'Mioga2.pm') {
+ $Mioga2_pm = $File::Find::name;
+ }
+ };
+ find($findfile, $ENV{MIOGA_SITEPERL});
+};
WriteMakefile(
'NAME' => 'Mioga',
'DIR' => ['bin', 'web', 'locales', 'docs', 'sql'],
- 'VERSION_FROM' => 'lib/Mioga2.pm',
+ 'VERSION_FROM' => $Mioga2_pm,
);
diff --git a/bin/mailinglist/miogamailinglist.pl b/bin/mailinglist/miogamailinglist.pl
index 80668e2..fa1603a 100755
--- a/bin/mailinglist/miogamailinglist.pl
+++ b/bin/mailinglist/miogamailinglist.pl
@@ -205,11 +205,11 @@ sub MsgSendStock
sub CheckUTF8 {
my ($str) = @_;
- my $conv = Text::Iconv->new('utf8', 'utf8');
+ my $conv = Text::Iconv->new('UTF-8', 'UTF-8');
my $tmp_str = $conv->convert($str);
unless ($tmp_str) {
my $charset = detect($str) || 'iso-8859-15'; # defaults to latin9
- $conv = Text::Iconv->new($charset, "utf8");
+ $conv = Text::Iconv->new($charset, "UTF-8");
$str = $conv->convert($str);
}
return $str;
diff --git a/bin/notifier/searchengine.pl b/bin/notifier/searchengine.pl
index efd1ca2..fc5ba67 100755
--- a/bin/notifier/searchengine.pl
+++ b/bin/notifier/searchengine.pl
@@ -39,8 +39,7 @@ if (!open(FIFO, "+>$fifo")) {
syslog('err', "Can't open fifo: $!. Exiting...");
}
my $flags = fcntl(FIFO, F_GETFL, 0);
-
-
+my $crawler = $config->GetBinariesDir()."/crawl.sh";
# MAIN LOOP
my %instances;
@@ -53,7 +52,7 @@ while (1) {
$instances{$line} += 1;
}
foreach my $inst (keys(%instances)) {
- system("/usr/local/bin/crawl.sh $inst");
+ system("$crawler $inst");
}
fcntl(FIFO, F_SETFL, $flags);
}
diff --git a/conf/Config.xml b/conf/Config.xml
index e614cda..3a9b7e3 100644
--- a/conf/Config.xml
+++ b/conf/Config.xml
@@ -3,6 +3,9 @@
<version module="Mioga2"/>
<config>
+ <parameter name="init_sql" question="Initialize database ?"
+ type="bool" default="no" xpath="/init_sql"/>
+
<parameter name="instance_ident" question="First Mioga instance Identifier ?"
type="text" default="Mioga"
xpath="/instance_ident"/>
@@ -35,8 +38,18 @@
<parameter name="authentication" question="Authentification method ?"
type="enum" default="Mioga2" values="Mioga2"
xpath="/authentication"/>
-
+
+ <parameter name="bin_dir" question="Directory for helper scripts and binaries ?"
+ type="text" default="/usr/local/bin"
+ xpath="/bin_dir"/>
+
<parameter name="Database settings" type="submenu">
+ <parameter name="db_host" question=" Mioga database server name or address ?"
+ type="text" default="localhost"
+ xpath="/database/DBhost"/>
+ <parameter name="db_port" question=" Mioga database server port ?"
+ type="text" default="5432"
+ xpath="/database/DBport"/>
<parameter name="db_name" question=" Name of Mioga database ?"
type="text" default="mioga2"
xpath="/database/DBname"/>
@@ -462,7 +475,6 @@
<app ident="Portal" package="Mioga2::Portal"/>
<app ident="Search" package="Mioga2::Search"/>
<app ident="Magellan" package="Mioga2::Magellan"/>
- <app ident="Mermoz" package="Mioga2::Mermoz"/>
<app ident="RSS" package="Mioga2::RSS"/>
<app ident="Narkissos" package="Mioga2::Narkissos"/>
<app ident="Colbert" package="Mioga2::Colbert"/>
@@ -476,7 +488,7 @@
<mioglet ident="Workspace" package="Mioga2::Portal::WSMioglet"/>
<mioglet ident="Organizer" package="Mioga2::Portal::OrgMioglet"/>
<mioglet ident="News" package="Mioga2::Portal::NewsMioglet"/>
- <mioglet ident="File" package="Mioga2::Portal::FileMioglet"/>
+ <mioglet ident="File" package="Miorouga2::Portal::FileMioglet"/>
<mioglet ident="Articles" package="Mioga2::Portal::ArticlesMioglet"/>
<mioglet ident="Poll" package="Mioga2::Portal::PollMioglet"/>
<mioglet ident="Search" package="Mioga2::Portal::SearchMioglet"/>
diff --git a/lib/Mioga2/Bottin.pm b/lib/Mioga2/Bottin.pm
index ba4cd8d..0db5651 100644
--- a/lib/Mioga2/Bottin.pm
+++ b/lib/Mioga2/Bottin.pm
@@ -1742,11 +1742,11 @@ sub InitSuperAdminMode {
sub CheckUTF8 {
my ($str) = @_;
- my $conv = Text::Iconv->new('utf8', 'utf8');
+ my $conv = Text::Iconv->new('UTF-8', 'UTF-8');
my $tmp_str = $conv->convert($str);
unless ($tmp_str) {
- my $charset = detect($str) || 'iso-8859-15'; # defaults to latin9
- $conv = Text::Iconv->new($charset, "utf8");
+ my $charset = detect($str) || 'ISO-8859-15'; # defaults to latin9
+ $conv = Text::Iconv->new($charset, "UTF-8");
$str = $conv->convert($str);
}
return $str;
diff --git a/lib/Mioga2/Classes/URI.pm b/lib/Mioga2/Classes/URI.pm
index 8678b33..bf97e71 100644
--- a/lib/Mioga2/Classes/URI.pm
+++ b/lib/Mioga2/Classes/URI.pm
@@ -75,15 +75,16 @@ sub new {
# convert uri to UTF-8
my $uri = uri_unescape($options{uri});
+
# attempt to see if uri is utf8 to avoid detection
- my $conv = Text::Iconv->new('utf8', 'utf8');
+ my $conv = Text::Iconv->new('UTF-8', 'UTF-8');
my $tmp_uri = $conv->convert($uri);
-
+
unless ($tmp_uri) {
- my $charset = detect($uri) || 'iso-8859-15'; # defaults to latin9
+ my $charset = detect($uri) || 'ISO-8859-15'; # defaults to latin9
warn "charset = '$charset' for uri = '$uri'" if $debug;
- $conv = Text::Iconv->new($charset, "utf8");
+ $conv = Text::Iconv->new($charset, "UTF-8");
$uri = $conv->convert($uri);
warn "==> converted uri = '$uri'" if $debug;
}
diff --git a/lib/Mioga2/Config.pm b/lib/Mioga2/Config.pm
index b088823..4edac62 100644
--- a/lib/Mioga2/Config.pm
+++ b/lib/Mioga2/Config.pm
@@ -28,7 +28,7 @@ Config.pm: Access class to the current Mioga instance configuration.
This module permits to access to the current Mioga instance
configuration parameters.
-=head1 METHODS DESRIPTION
+=head1 METHODS DESCRIPTION
=cut
diff --git a/lib/Mioga2/DAVFS.pm b/lib/Mioga2/DAVFS.pm
index b56c4ad..7810f82 100644
--- a/lib/Mioga2/DAVFS.pm
+++ b/lib/Mioga2/DAVFS.pm
@@ -141,10 +141,11 @@ use Mioga2::tools::APIAuthz;
use Mioga2::tools::database;
use Mioga2::tools::string_utils;
use Mioga2::tools::Convert;
+use Net::INET6Glue::INET_is_INET6;
use XML::LibXML ();
use Mioga2::Constants;
-my $debug = 0;
+my $debug = 5;
my $MULTI_STATUS = 207; # code DAV for the Multi-status response
@@ -756,13 +757,17 @@ sub make_request {
my $host = $self->{host};
my $port = $self->{port};
+ my $hostport = $host;
+ $hostport = '['.$hostport.']' if $host =~ /:.*:/;
+ $hostport .= ':'.$port;
+
my $dav_uri = $config->GetDAVBasePath;
my $mioga_uri = $config->GetBasePath;
my $orig_uri = Mioga2::Classes::URI->new( uri => $callbacks->{uri}->() );
my $uri = $orig_uri->as_string;
$uri =~ s/^$mioga_uri/$dav_uri/;
- $uri = Mioga2::Classes::URI->new( uri => "$protocol://$host:$port$uri" )
+ $uri = Mioga2::Classes::URI->new( uri => "$protocol://$hostport$uri" )
->as_string;
print STDERR "[Mioga2::DAVFS::make_request] uri = $uri\n" if $debug;
@@ -774,7 +779,7 @@ sub make_request {
# process headers
if ( $header =~ /^destination/i && $value !~ $dav_uri ) {
- $value =~ s!(//)[^/]+$mioga_uri!$1$host$dav_uri!;
+ $value =~ s!(//)[^/]+$mioga_uri!$1$hostport$dav_uri!; # was only $host before!
$value = Mioga2::Classes::URI->new( uri => $value )->as_string;
$value = $self->escapeSpecialChars($value);
}
diff --git a/lib/Mioga2/Database.pm b/lib/Mioga2/Database.pm
index 4afa54b..ca8368c 100644
--- a/lib/Mioga2/Database.pm
+++ b/lib/Mioga2/Database.pm
@@ -61,7 +61,7 @@ sub new {
my $self = { };
bless($self, $class);
- for my $attr (qw/DBIlogin DBIpasswd DBIdriver DBname/) {
+ for my $attr (qw/DBhost DBport DBIlogin DBIpasswd DBIdriver DBname/) {
if (!defined ($attributes{$attr})) {
throw Mioga2::Exception::DB ("[Mioga2::Database::new]", "Cannot connect to database: " . $DBI::errstr);
}
@@ -72,8 +72,10 @@ sub new {
my $dbiPassword = $self->{database}->{DBIpasswd};
my $dbDriver = $self->{database}->{DBIdriver};
my $dbName = $self->{database}->{DBname};
+ my $dbHost = $self->{database}->{DBhost};
+ my $dbPort = $self->{database}->{DBport};
- my $datasource = "dbi:$dbDriver:dbname=$dbName";
+ my $datasource = "dbi:$dbDriver:dbname=$dbName;host=$dbHost;port=$dbPort";
$self->{dbh} = DBI->connect($datasource, $dbiUser, $dbiPassword);
diff --git a/lib/Mioga2/Exception/DB.pm b/lib/Mioga2/Exception/DB.pm
index 7ce5020..dd29d83 100644
--- a/lib/Mioga2/Exception/DB.pm
+++ b/lib/Mioga2/Exception/DB.pm
@@ -1,3 +1,4 @@
+
# ============================================================================
# Mioga2 Project (C) 2003-2007 The Mioga2 Project
#
@@ -53,6 +54,7 @@ sub new {
my($class, $function, $errDB, $errStr, $sql) = @_;
my $self = $class->SUPER::new(-text => "$errStr : $errDB");
$self->{errDB} = $errDB;
+ $self->{errStr} = $errStr;
$self->{sql} = $sql;
$self->{function} = $function;
return $self;
@@ -76,6 +78,27 @@ sub as_string
return $string;
}
+# ----------------------------------------------------------------------------
+=head2 getDBerr ()
+Return the error code as sent by the database connector.
+=cut
+# ----------------------------------------------------------------------------
+sub getDBerr {
+ my ($self) = @_;
+ return $self->{errDB};
+}
+
+# ----------------------------------------------------------------------------
+=head2 getDBerrstr ()
+Return the error string as sent by the database connector.
+=cut
+# ----------------------------------------------------------------------------
+sub getDBerrstr {
+ my ($self) = @_;
+ return $self->{errStr};
+}
+
+
# ============================================================================
=head1 PRIVATE METHODS DESCRIPTION
diff --git a/lib/Mioga2/InstanceList.pm b/lib/Mioga2/InstanceList.pm
index 3e2cf7a..a676a1b 100644
--- a/lib/Mioga2/InstanceList.pm
+++ b/lib/Mioga2/InstanceList.pm
@@ -423,7 +423,9 @@ sub Store {
$conf->RunHooks($self->{config}->{miogaconf});
# Run crawl.sh to initialize search engine database
- my $crawlcmd = $self->{config}->{miogaconf}->GetMiogaPrefix () . "/bin/mioga2_index.pl --conf=" . $self->{config}->GetMiogaConfPath () . ' --search_conf=' . $self->{config}->GetInstallPath . "/conf/search_conf.xml" . ' ' . $self->Get ('ident');
+ my $crawlcmd = $self->{config}->{miogaconf}->GetMiogaPrefix () . "/bin/mioga2_index.pl --conf=" . $self->{config}->GetMiogaConfPath ()
+ . ' --search_conf=' . $self->{config}->{miogaconf}->GetInstallDir()."/conf/search_conf.xml"
+ . ' '. $self->Get ('ident');
system ("$crawlcmd");
}
elsif (scalar (keys (%{$self->{update}}))) {
diff --git a/lib/Mioga2/Magellan.pm b/lib/Mioga2/Magellan.pm
index 86e2e42..4b3814a 100644
--- a/lib/Mioga2/Magellan.pm
+++ b/lib/Mioga2/Magellan.pm
@@ -327,10 +327,13 @@ sub GetNodes {
$mygroup = $group;
}
+ my $host = $config->GetMiogaConf()->GetDAVHost();
+ $host = "[${host}]" if $host =~ /:.*?:/;
+
my $resources = Mioga2::Magellan::DAV::GetCollection(
$context,
$context->GetSessionToken,
- $config->GetMiogaConf ()->GetDAVProtocol () . "://" . $config->GetMiogaConf ()->GetDAVHost () . ":" . $config->GetMiogaConf ()->GetDAVPort (), $node
+ $config->GetMiogaConf ()->GetDAVProtocol () . "://" . $host . ":" . $config->GetMiogaConf ()->GetDAVPort (), $node
);
$inconsistent = pop (@$resources);
@@ -853,7 +856,7 @@ sub GetResource {
);
print STDERR "mime = $mime\n content= $content\n" if ($debug);
if ($mime) {
- #my $conv = Text::Iconv->new( 'utf8', 'utf8' );
+ #my $conv = Text::Iconv->new( 'UTF-8', 'UTF-8' );
#my $encoding = $conv->convert($content);
#if ($encoding) {
if ($mime =~ /(application\/xml)|(text\/)|(application\/xsl)/)
diff --git a/lib/Mioga2/Magellan/Archive.pm b/lib/Mioga2/Magellan/Archive.pm
index 842ae90..3b9e7f7 100644
--- a/lib/Mioga2/Magellan/Archive.pm
+++ b/lib/Mioga2/Magellan/Archive.pm
@@ -163,7 +163,7 @@ sub Content
return undef;
}
- my $conv = Text::Iconv->new('utf8', 'utf8');
+ my $conv = Text::Iconv->new('UTF-8', 'UTF-8');
my %folders;
while(my $file = <PRG>) {
chomp($file);
diff --git a/lib/Mioga2/Magellan/DAV.pm b/lib/Mioga2/Magellan/DAV.pm
index cdf77f1..116ebf4 100644
--- a/lib/Mioga2/Magellan/DAV.pm
+++ b/lib/Mioga2/Magellan/DAV.pm
@@ -106,7 +106,7 @@ sub ExecuteRequest
}
if ($response->code >= 500) {
- warn "Mioga2::Magellan::ExecuteRequest Failed: " . $response->content;
+ warn "Mioga2::Magellan::DAV::ExecuteRequest Failed: " . $response->content;
}
return $response;
diff --git a/lib/Mioga2/MailingList.pm b/lib/Mioga2/MailingList.pm
index c7d631c..3a92466 100644
--- a/lib/Mioga2/MailingList.pm
+++ b/lib/Mioga2/MailingList.pm
@@ -749,11 +749,11 @@ sub MailDeleteMsg
sub CheckUTF8 {
my ($str) = @_;
- my $conv = Text::Iconv->new('utf8', 'utf8');
+ my $conv = Text::Iconv->new('UTF-8', 'UTF-8');
my $tmp_str = $conv->convert($str);
unless ($tmp_str) {
- my $charset = detect($str) || 'iso-8859-15'; # defaults to latin9
- $conv = Text::Iconv->new($charset, "utf8");
+ my $charset = detect($str) || 'ISO-8859-15'; # defaults to latin9
+ $conv = Text::Iconv->new($charset, "UTF-8");
$str = $conv->convert($str);
}
return $str;
diff --git a/lib/Mioga2/MiogaConf.pm b/lib/Mioga2/MiogaConf.pm
index 5b74a96..a46e27c 100644
--- a/lib/Mioga2/MiogaConf.pm
+++ b/lib/Mioga2/MiogaConf.pm
@@ -258,7 +258,7 @@ sub GetFilenameEncoding {
sub GetBinariesDir {
my ($self) = @_;
- return $self->{binaries_dir};
+ return $self->{bin_dir};
}
# ============================================================================
diff --git a/lib/Mioga2/Search.pm b/lib/Mioga2/Search.pm
index 2c20259..292f864 100644
--- a/lib/Mioga2/Search.pm
+++ b/lib/Mioga2/Search.pm
@@ -447,13 +447,13 @@ sub CheckArgs
elsif (exists($context->{args}->{query})) {
$query_string = $context->{args}->{query};
}
- my $conv = Text::Iconv->new('utf8', 'utf8');
+ my $conv = Text::Iconv->new('UTF-8', 'UTF-8');
my $tmp_query = $conv->convert($query_string);
unless ($tmp_query) {
- my $charset = detect($query_string) || 'iso-8859-15'; # defaults to latin9
+ my $charset = detect($query_string) || 'ISO-8859-15'; # defaults to latin9
warn "charset = '$charset' for query_string = '$query_string'" if $debug;
- $conv = Text::Iconv->new($charset, "utf8");
+ $conv = Text::Iconv->new($charset, "UTF-8");
$query_string = $conv->convert($query_string);
warn "==> converted query_string = '$query_string'" if $debug;
}
diff --git a/lib/Mioga2/tools/string_utils.pm b/lib/Mioga2/tools/string_utils.pm
index c56cc3b..36bfa5a 100644
--- a/lib/Mioga2/tools/string_utils.pm
+++ b/lib/Mioga2/tools/string_utils.pm
@@ -46,6 +46,7 @@ use Mioga2::Content::XSLT;
use Mioga2::XML::Simple;
use Exporter;
use Text::Iconv;
+use Encode;
use Encode::Detect::Detector;
use Data::Dumper;
use HTML::TokeParser::Simple;
@@ -715,11 +716,11 @@ Check if string is UTF8 and convert it if needed
sub st_CheckUTF8 {
my ($str) = @_;
- my $conv = Text::Iconv->new('utf8', 'utf8');
+ my $conv = Text::Iconv->new('UTF-8', 'UTF-8');
my $tmp_str = $conv->convert($str);
unless ($tmp_str) {
- my $charset = detect($str) || 'iso-8859-15'; # defaults to latin9
- $conv = Text::Iconv->new($charset, "utf8");
+ my $charset = detect($str) || 'ISO-8859-15'; # defaults to latin9
+ $conv = Text::Iconv->new($charset, "UTF-8");
$str = $conv->convert($str);
utf8::decode ($str);
}
diff --git a/lib/MiogaConf.pm b/lib/MiogaConf.pm
index 0870174..bbcc80a 100644
--- a/lib/MiogaConf.pm
+++ b/lib/MiogaConf.pm
@@ -836,6 +836,10 @@ sub CheckDepends
my @missing;
my @missing_clib;
+ # Some modules rewrite $ENV{PATH} without hesitation when "require"d,
+ # we need to put the old one back in place.
+ my $oldpath = $ENV{PATH};
+
foreach my $dep (@{$self->{CONFIG}->{dependencies}->[0]->{dep}}) {
my $version;
if(exists $dep->{version}) {
@@ -858,6 +862,7 @@ sub CheckDepends
}
}
+ $ENV{PATH} = $oldpath;
foreach my $dep (@{$self->{CONFIG}->{dependencies}->[0]->{clib}}) {
my $version;
diff --git a/sql/Makefile b/sql/Makefile
index 07b26f5..3d79b1b 100644
--- a/sql/Makefile
+++ b/sql/Makefile
@@ -15,19 +15,21 @@ install:
cp upgradeMiogletDesc.pl $(DESTDIR)$(INSTALL_DIR)/conf/Config.hook.d
chmod a+x $(DESTDIR)$(INSTALL_DIR)/conf/Config.hook.d/upgradeMiogletDesc.pl
- if [ $(INIT_SQL) = 'yes' ] ; \
+ DB_STATE=`perl -w testdb.pl`; \
+ if [ "$$DB_STATE" = "nodb" -o "$$DB_STATE" = "empty" ] ; \
then \
echo "Initialize database"; \
- su - $(POSTGRES_USER) -c "dropdb $(DB_NAME)" ; \
- su - $(POSTGRES_USER) -c "createdb --encoding UTF8 $(DB_NAME)" && \
- su $(POSTGRES_USER) -c "psql $(DB_NAME) < create_lang.sql" && \
- perl -w -I../lib initdb.pl ; \
- elif [ $(INIT_SQL) != 'noupdate' ]; then \
+ dropdb -h $(DB_HOST) -p $(DB_PORT) -U $(DBI_LOGIN) $(DB_NAME) ; \
+ createdb --encoding UTF8 -h $(DB_HOST) -p $(DB_PORT) -U $(DBI_LOGIN) $(DB_NAME) && \
+ psql -h $(DB_HOST) -p $(DB_PORT) -U $(DBI_LOGIN) $(DB_NAME) < create_lang.sql && \
+ perl -w -I../lib initdb.pl force_init_sql=1; \
+ elif [ "$$DB_STATE" = "present" ]; then \
echo "Update database"; \
perl -w -I../lib updatedb.pl configxml=$(DESTDIR)$(INSTALL_DIR)/conf/Config.xml; \
+ elif [ "$$DB_STATE" = "noserver" ]; then \
+ echo "ERROR: Cannot connect to the database server!"; \
fi
-
clean:
rm -f *~
diff --git a/sql/schema_base.sql b/sql/schema_base.sql
index b7d8cc2..88d5e2d 100644
--- a/sql/schema_base.sql
+++ b/sql/schema_base.sql
@@ -429,10 +429,6 @@ CREATE OR REPLACE FUNCTION check_group_base_default_profile_id () RETURNS trigge
END;
' LANGUAGE 'plpgsql';
-CREATE TRIGGER m_group_base_default_profile_id_check
- BEFORE DELETE ON m_profile FOR EACH ROW
- EXECUTE PROCEDURE check_group_base_default_profile_id ();
-
CREATE OR REPLACE FUNCTION check_group_base_mioga_id () RETURNS trigger AS '
DECLARE
@@ -839,6 +835,10 @@ create table m_profile (
);
create unique index m_profile_ident_group_index on m_profile (ident, group_id);
+CREATE TRIGGER m_group_base_default_profile_id_check
+ BEFORE DELETE ON m_profile FOR EACH ROW
+ EXECUTE PROCEDURE check_group_base_default_profile_id ();
+
--
-- Add referencial integrity on default_profile_id in m_group_base
diff --git a/sql/testdb.pl b/sql/testdb.pl
new file mode 100755
index 0000000..1952891
--- /dev/null
+++ b/sql/testdb.pl
@@ -0,0 +1,64 @@
+#!/usr/bin/perl -w
+
+# Tests the availability of the Mioga2 database.
+# Returns on stdout one of:
+# 'present' - The Mioga2 database has been found and contains data.
+# 'empty' - The Mioga2 database exists but the table "m_mioga" is empty or nonexistent.
+# 'nodb' - There is no Mioga2 database but the database server is working fine
+# (i.e. one can try to create the database)
+# 'noserver' - Connection to the database server failed.
+
+# This has been written for Mioga2/SlapOS, to avoid overwriting the database
+# when re-instantiating the Apache/mod_perl partition.
+
+use strict;
+use lib "../lib";
+
+use Data::Dumper;
+use DBI;
+use Error qw(:try);
+use Mioga2::Exception::DB;
+use Mioga2::MiogaConf;
+
+# TODO: get this through a parameter?
+# my $configxml = "../conf/Config.xml";
+my $miogaconf = "../web/conf/Mioga.conf";
+
+my $result = 'undefined';
+try {
+ my $config = new Mioga2::MiogaConf($miogaconf);
+ my $dbh = $config->GetDBH();
+ my $sql = 'SELECT COUNT(*) FROM m_mioga';
+ my $sth = $dbh->prepare($sql);
+ my $exec_result = $sth->execute();
+ if (not defined($exec_result)) {
+ throw Mioga2::Exception::DB("testdb.pl 0", $sth->err, $sth->errstr, $sql);
+ }
+ my $res = $sth->fetchrow_arrayref();
+ if (not defined($res)) {
+ throw Mioga2::Exception::DB("testdb.pl 1", $sth->err, $sth->errstr, $sql);
+ }
+ my $count = $res->[0];
+ if (not defined($count)) {
+ throw Mioga2::Exception::DB("testdb.pl 2", $sth->err, $sth->errstr, $sql);
+ } elsif ($count == 0) {
+ $result = 'empty';
+ } else {
+ $result = 'present';
+ }
+} catch Mioga2::Exception::DB with {
+ my $err = shift;
+ my $errstr = $err->getDBerrstr();
+ if ($errstr =~ m#database "mioga2" does not exist#) {
+ $result = 'nodb';
+ } elsif ($errstr =~ m#relation "m_mioga" does not exist#) {
+ $result = 'empty';
+ } else {
+ $result = 'noserver';
+ }
+} otherwise {
+ my $err = shift;
+ $result = 'noserver';
+};
+
+print $result;
diff --git a/sql/updatedb.pl b/sql/updatedb.pl
index 67921e7..bb4db1a 100644
--- a/sql/updatedb.pl
+++ b/sql/updatedb.pl
@@ -25,7 +25,7 @@ foreach my $var qw(configxml miogaconf timezonexml dir) {
my $config = new Mioga2::MiogaConf($miogaconf);
-my $conf = new MiogaConf( dir => $dir, config => $configxml);
+my $conf = new MiogaConf( dir => $dir, config => $configxml, force_init_sql => 0);
$conf->Install($config);
diff --git a/web/Makefile b/web/Makefile
index 66af45f..9649a02 100644
--- a/web/Makefile
+++ b/web/Makefile
@@ -16,11 +16,11 @@ all ::
install ::
- if [ $(INIT_SQL) = 'yes' -a -d $(INSTALL_DIR) ] ; \
- then \
- su - $(POSTGRES_USER) -c "pg_dump -b -Ft --column-inserts $(DB_NAME) | gzip" > ${INSTALL_DIR}/db_dump.tar.gz ; \
- mv $(INSTALL_DIR) $(BACKUP_DIR) ; \
- fi
+# if [ $(INIT_SQL) = 'yes' -a -d $(INSTALL_DIR) ] ; \
+# then \
+# su - $(POSTGRES_USER) -c "pg_dump -b -Ft --column-inserts $(DB_NAME) | gzip" > ${INSTALL_DIR}/db_dump.tar.gz ; \
+# mv $(INSTALL_DIR) $(BACKUP_DIR) ; \
+# fi
mkdir -p $(TMP_DIR)
mkdir -p $(DESTDIR)$(INSTALL_DIR)/$(INSTANCE_IDENT)/$(MIOGA_FILES)
diff --git a/web/conf/Makefile b/web/conf/Makefile
index 1573e5c..189f2fd 100644
--- a/web/conf/Makefile
+++ b/web/conf/Makefile
@@ -14,5 +14,6 @@ install:
# is done in ../Makefile
clean:
+ echo "VHH DEBUG: web/conf make clean, deleting apache/ !"
rm -Rf apache Mioga.conf .memdump
diff --git a/web/conf/startup.pl b/web/conf/startup.pl
index a9dc968..6558061 100644
--- a/web/conf/startup.pl
+++ b/web/conf/startup.pl
@@ -29,6 +29,7 @@ use MIME::Entity ();
use MIME::Parser ();
use MIME::QuotedPrint ();
use MiogaConf ();
+use Net::INET6Glue::INET_is_INET6;
use Net::LDAP ();
use Parse::Yapp::Driver ();
use Storable ();
diff --git a/web/skel/Makefile b/web/skel/Makefile
index e604e7d..fbaad2d 100644
--- a/web/skel/Makefile
+++ b/web/skel/Makefile
@@ -33,7 +33,7 @@ fr_FR : $(SRC_FR_FILES)
install:
rsync $(RSYNC_OPTS) $(SUBDIRS) $(DESTDIR)$(INSTALL_DIR)/conf/skel/
# Update instance default skeletons
- for i in `mioga2_info.pl --conf=$(DESTDIR)$(INSTALL_DIR)/conf/Mioga.conf instances`; do if [ ! -d /var/lib/Mioga2/$$i/MiogaFiles/skel/ ]; then mkdir $(DESTDIR)$(INSTALL_DIR)/$$i/MiogaFiles/skel/; fi; cp -R $(DESTDIR)$(INSTALL_DIR)/conf/skel/* $(DESTDIR)$(INSTALL_DIR)/$$i/MiogaFiles/skel/; done
+# for i in `mioga2_info.pl --conf=$(DESTDIR)$(INSTALL_DIR)/conf/Mioga.conf instances`; do if [ ! -d /var/lib/Mioga2/$$i/MiogaFiles/skel/ ]; then mkdir $(DESTDIR)$(INSTALL_DIR)/$$i/MiogaFiles/skel/; fi; cp -R $(DESTDIR)$(INSTALL_DIR)/conf/skel/* $(DESTDIR)$(INSTALL_DIR)/$$i/MiogaFiles/skel/; done
clean:
rm -rf $(SUBDIRS)
diff --git a/web/skel/src/en_US/group/50-standard.xml b/web/skel/src/en_US/group/50-standard.xml
index 6cf89e5..e1ef140 100644
--- a/web/skel/src/en_US/group/50-standard.xml
+++ b/web/skel/src/en_US/group/50-standard.xml
@@ -12,7 +12,6 @@
<applications>
<application ident="AnimGroup" active="1"/>
<application ident="Magellan" active="1"/>
- <application ident="Mermoz" active="1"/>
<application ident="Organizer"/>
<application ident="Contact"/>
<application ident="Tasks"/>
@@ -38,9 +37,6 @@
<application ident="Magellan">
<all_functions/>
</application>
- <application ident="Mermoz">
- <all_functions/>
- </application>
<application ident="Portal">
<all_functions/>
</application>
@@ -53,10 +49,6 @@
<application ident="Magellan">
<function>Read</function>
</application>
- <application ident="Mermoz">
- <function>Base</function>
- <function>Standard</function>
- </application>
<application ident="Portal">
<function>Portal</function>
</application>
@@ -69,9 +61,6 @@
<application ident="Magellan">
<function>Read</function>
</application>
- <application ident="Mermoz">
- <function>Base</function>
- </application>
<application ident="Portal">
<function>Portal</function>
</application>
diff --git a/web/skel/src/en_US/group/60-admin.xml b/web/skel/src/en_US/group/60-admin.xml
index c73b700..d3f368b 100644
--- a/web/skel/src/en_US/group/60-admin.xml
+++ b/web/skel/src/en_US/group/60-admin.xml
@@ -12,7 +12,6 @@
<applications>
<application ident="AnimGroup" active="1"/>
<application ident="Magellan" active="1"/>
- <application ident="Mermoz" active="1"/>
<application ident="Colbert" active="1"/>
<application ident="Organizer"/>
<application ident="Contact"/>
@@ -39,9 +38,6 @@
<application ident="Magellan">
<all_functions/>
</application>
- <application ident="Mermoz">
- <all_functions/>
- </application>
<application ident="Colbert">
<all_functions/>
</application>
@@ -57,10 +53,6 @@
<application ident="Magellan">
<function>Read</function>
</application>
- <application ident="Mermoz">
- <function>Base</function>
- <function>Standard</function>
- </application>
<application ident="Colbert">
<function>UsersWrite</function>
<function>GroupsWrite</function>
@@ -79,9 +71,6 @@
<application ident="Magellan">
<function>Read</function>
</application>
- <application ident="Mermoz">
- <function>Base</function>
- </application>
<application ident="Colbert">
<function>UsersRead</function>
<function>GroupsRead</function>
diff --git a/web/skel/src/en_US/instance/50-standard.xml b/web/skel/src/en_US/instance/50-standard.xml
index cdb1e88..82a125b 100644
--- a/web/skel/src/en_US/instance/50-standard.xml
+++ b/web/skel/src/en_US/instance/50-standard.xml
@@ -102,10 +102,6 @@
</application>
<application ident="MailingList">
</application>
- <application ident="Mermoz">
- <all_users/>
- <all_groups/>
- </application>
<application ident="Narkissos">
<all_users/>
</application>
diff --git a/web/skel/src/en_US/user/50-standard.xml b/web/skel/src/en_US/user/50-standard.xml
index c8983bb..256400d 100644
--- a/web/skel/src/en_US/user/50-standard.xml
+++ b/web/skel/src/en_US/user/50-standard.xml
@@ -92,7 +92,6 @@
<application ident="FileBrowser"/>
<application ident="Portal"/>
<application ident="Search" active="1"/>
- <application ident="Mermoz"/>
<application ident="RSS" active="1"/>
</applications>
diff --git a/web/skel/src/en_US/user/60-admin.xml b/web/skel/src/en_US/user/60-admin.xml
index 9083b6f..e246d19 100644
--- a/web/skel/src/en_US/user/60-admin.xml
+++ b/web/skel/src/en_US/user/60-admin.xml
@@ -101,7 +101,6 @@
<application ident="FileBrowser"/>
<application ident="Portal"/>
<application ident="Search" active="1"/>
- <application ident="Mermoz"/>
<application ident="RSS" active="1"/>
</applications>
diff --git a/web/skel/src/fr_FR/group/50-standard.xml b/web/skel/src/fr_FR/group/50-standard.xml
index 954f71d..dfc79b1 100644
--- a/web/skel/src/fr_FR/group/50-standard.xml
+++ b/web/skel/src/fr_FR/group/50-standard.xml
@@ -35,9 +35,6 @@
<!-- Le navigateur de fichiers est accessible et actif. -->
<application ident="Magellan" active="1"/>
- <!-- L'application de rédaction d'e-mails est accessible et active. -->
- <application ident="Mermoz" active="1"/>
-
<!-- Le portail est accessible et actif. -->
<application ident="Portal" active="1"/>
@@ -77,11 +74,6 @@
<all_functions/>
</application>
- <!-- Le profil "Animation" donne accès à toutes les fonctions de l'application Mermoz d'envoi d'e-mail. -->
- <application ident="Mermoz">
- <all_functions/>
- </application>
-
<!-- Le profil "Animation" donne accès à toutes les fonctions du portail de groupe. -->
<application ident="Portal">
<all_functions/>
@@ -102,12 +94,6 @@
<function>Read</function>
</application>
- <!-- Le profil "Membre" donne accès uniquement à l'envoi d'e-mail au groupe ou indépendamment aux différentes équipes du groupe via l'application d'envoi d'e-mail Mermoz. -->
- <application ident="Mermoz">
- <function>Base</function>
- <function>Standard</function>
- </application>
-
<!-- Le profil "Membre" donne accès uniquement à la consultation du portail de groupe. -->
<application ident="Portal">
<function>Portal</function>
@@ -128,11 +114,6 @@
<function>Read</function>
</application>
- <!-- Le profil "Invité" donne accès uniquement à l'envoi d'e-mail au groupe via l'application d'envoi d'e-mail Mermoz. -->
- <application ident="Mermoz">
- <function>Base</function>
- </application>
-
<!-- Le profil "Invité" donne accès uniquement à la consultation du portail de groupe. -->
<application ident="Portal">
<function>Portal</function>
@@ -151,6 +132,7 @@
<space type="private">
<!-- La balise "acls" contient les définitions de droits d'accès à la racine de l'espace privé du groupe. -->
+
<acls>
<!-- Les profils "Animation" et "Membre" ont accès en lecture et écriture. -->
diff --git a/web/skel/src/fr_FR/group/60-admin.xml b/web/skel/src/fr_FR/group/60-admin.xml
index d9bd724..1c97ca5 100644
--- a/web/skel/src/fr_FR/group/60-admin.xml
+++ b/web/skel/src/fr_FR/group/60-admin.xml
@@ -12,7 +12,6 @@
<applications>
<application ident="AnimGroup" active="1"/>
<application ident="Magellan" active="1"/>
- <application ident="Mermoz" active="1"/>
<application ident="Colbert" active="1"/>
<application ident="Organizer"/>
<application ident="Contact"/>
@@ -39,9 +38,6 @@
<application ident="Magellan">
<all_functions/>
</application>
- <application ident="Mermoz">
- <all_functions/>
- </application>
<application ident="Colbert">
<all_functions/>
</application>
@@ -57,10 +53,6 @@
<application ident="Magellan">
<function>Read</function>
</application>
- <application ident="Mermoz">
- <function>Base</function>
- <function>Standard</function>
- </application>
<application ident="Colbert">
<function>UsersWrite</function>
<function>GroupsWrite</function>
@@ -79,9 +71,6 @@
<application ident="Magellan">
<function>Read</function>
</application>
- <application ident="Mermoz">
- <function>Base</function>
- </application>
<application ident="Colbert">
<function>UsersRead</function>
<function>GroupsRead</function>
diff --git a/web/skel/src/fr_FR/instance/50-standard.xml b/web/skel/src/fr_FR/instance/50-standard.xml
index 34a8536..f7d1eb1 100644
--- a/web/skel/src/fr_FR/instance/50-standard.xml
+++ b/web/skel/src/fr_FR/instance/50-standard.xml
@@ -215,12 +215,6 @@
<application ident="MailingList">
</application>
- <!-- L'application d'envoi d'e-mail est accessible à tous les utilisateurs et à tous les groupes. -->
- <application ident="Mermoz">
- <all_users/>
- <all_groups/>
- </application>
-
<!-- L'application de gestion des données personnelles est accessible à tous les utilisateurs. -->
<application ident="Narkissos">
<all_users/>
diff --git a/web/skel/src/fr_FR/user/50-standard.xml b/web/skel/src/fr_FR/user/50-standard.xml
index c7da5e8..d07b180 100644
--- a/web/skel/src/fr_FR/user/50-standard.xml
+++ b/web/skel/src/fr_FR/user/50-standard.xml
@@ -138,7 +138,6 @@
<!-- L'afficheur de fichiers, le portail utilisateur et l'application d'envoi d'e-mails Mermoz sont accessible mais ne sont pas actives. L'utilisateur pourra les activer s'il le souhaite. -->
<application ident="FileBrowser"/>
<application ident="Portal"/>
- <application ident="Mermoz"/>
</applications>
diff --git a/web/skel/src/fr_FR/user/60-admin.xml b/web/skel/src/fr_FR/user/60-admin.xml
index afff18d..4d4df04 100644
--- a/web/skel/src/fr_FR/user/60-admin.xml
+++ b/web/skel/src/fr_FR/user/60-admin.xml
@@ -101,7 +101,6 @@
<application ident="FileBrowser"/>
<application ident="Portal"/>
<application ident="Search" active="1"/>
- <application ident="Mermoz"/>
<application ident="RSS" active="1"/>
</applications>
[buildout]
extends =
../../component/postgresql/buildout.cfg
develop =
/srv/slapgrid/slappart9/srv/runner/project/slapos
/opt/slapdev_build
extends =
../../component/rsync/buildout.cfg
../../component/apache-perl/buildout.cfg
../../component/perl-Crypt-SSLeay/buildout.cfg
../../component/perl-XML-Parser/buildout.cfg
../../component/perl-XML-LibXML/buildout.cfg
../../component/perl-XML-LibXSLT/buildout.cfg
../../component/perl-Term-ReadLine-Gnu/buildout.cfg
../../component/perl-Text-Iconv/buildout.cfg
../../component/perl-Image-Magick/buildout.cfg
../../component/postgresql/buildout.cfg
../../component/perl-DBD-Pg/buildout.cfg
../../component/perl-Search-Xapian/buildout.cfg
../../component/libxslt/buildout.cfg
../../component/dcron/buildout.cfg
../../component/dropbear/buildout.cfg
../../component/lxml-python/buildout.cfg
../../stack/slapos.cfg
parts =
eggs
apache-perl
perl-Apache2-Request
perl-Crypt-SSLeay
perl-DBD-Pg
perl-XML-Parser
perl-XML-LibXML
perl-XML-LibXSLT
perl-Term-ReadLine-Gnu
perl-Text-Iconv
perl-Image-Magick
perl-String-Checker-mioga
perl-Search-Xapian
cpan-simple-modules
rsync
mioga
template
template-apacheperl
template-postgres
[eggs]
recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
slapos.cookbook
cns.recipe.symlink
[cpan-simple-modules]
recipe = slapos.recipe.build:cpan
modules =
S/ST/STBEY/Date-Calc-6.3.tar.gz
D/DC/DCOPPIT/Benchmark-Timer-0.7102.tar.gz
R/RB/RBOW/Date-ICal-2.678.tar.gz
S/SB/SBECK/Date-Manip-6.37.tar.gz
G/GB/GBARR/TimeDate-1.20.tar.gz
S/SH/SHLOMIF/Error-0.17018.tar.gz
P/PA/PARDUS/File-MimeInfo/File-MimeInfo-0.16.tar.gz
O/OV/OVID/HTML-TokeParser-Simple-3.15.tar.gz
D/DS/DSKOLL/MIME-tools-5.503.tar.gz
D/DS/DSKOLL/IO-stringy-2.110.tar.gz
C/CO/COSIMO/HTTP-DAV-0.47.tar.gz
M/MA/MARSCHAP/perl-ldap-0.48.tar.gz
F/FD/FDESAR/Parse-Yapp-1.05.tar.gz
S/SN/SNOWHARE/Unicode-MapUTF8-1.11.tar.gz
G/GA/GAAS/Unicode-String-2.09.tar.gz
T/TY/TYEMQ/Algorithm-Diff-1.1902.tar.gz
J/JG/JGMYERS/Encode-Detect-1.01.tar.gz
G/GU/GUIDO/libintl-perl-1.20.tar.gz
K/KE/KEN/XML-XML2JSON-0.06.tar.gz
A/AR/ARISTOTLE/XML-Atom-SimpleFeed-0.86.tar.gz
P/PE/PETDANCE/Test-WWW-Mechanize-1.44.tar.gz
G/GR/GRANTM/XML-Simple-2.20.tar.gz
A/AD/ADAMK/Archive-Zip-1.30.tar.gz
D/DU/DURIST/Proc-ProcessTable-0.45.tar.gz
S/SU/SULLR/Net-INET6Glue-0.5.tar.gz
perl = perl
cpan-configuration =
makepl_arg=''
make_arg=''
[perl-String-Checker-mioga]
recipe = hexagonit.recipe.cmmi
depends =
${perl:version}
url = http://packages.alixen.org/contribs/String-Checker-0.03.tar.gz
md5sum = c750a33505609544f95eace7a2896c84
configure-command =
${perl:location}/bin/perl Makefile.PL
[mioga]
recipe = hexagonit.recipe.cmmi
version = 2.4.16
# No use re-using "version", the whole URL will change for the next one
url = http://www.alixen.org/attachments/download/89/Mioga2-2.4.16.tar.gz
md5sum = 1d2e76c798ee6d5f233011997200e125
location = ${buildout:parts-directory}/${:_buildout_section_name_}
buildinst = ${mioga:location}/buildinst
static = ${mioga:location}/static
environment =
MIOGA_BASE=${mioga:location}
MIOGA_BUILDINST=${mioga:buildinst}
MIOGA_STATIC=${mioga:static}
MIOGA_SITEPERL=${perl:siteprefix}
PATH=${libxslt:location}/bin:${libxml2:location}/bin:${perl:location}/bin:${perl:siteprefix}/bin:${rsync:location}/bin:%(PATH)s
patch-options = -p1
patches =
${mioga-patch:location}/${mioga-patch:filename}
# post-make-hook = ${mioga-postmakehook:location}/${mioga-postmakehook:filename}:post_make_hook
pre-configure-hook = ${mioga-hooks:location}/${mioga-hooks:filename}:pre_configure_hook
configure-command =
${perl:location}/bin/perl Makefile.PL
make-targets =
slapos-compilation
keep-compile-dir = true
perl-binary = ${perl:location}/bin/perl
[mioga-patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
# md5sum = b836ad89902d1ea68b091a5b9800edd8
download-only = true
filename = ${:_buildout_section_name_}
[mioga-hooks]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
# md5sum = c7ceec7788749238cb5fbe09beb647b1
download-only = true
filename = mioga-hooks.py
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
# md5sum =
output = ${buildout:directory}/template.cfg
mode = 0644
[template-apacheperl]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apacheperl.cfg
# md5sum =
output = ${buildout:directory}/template-apacheperl.cfg
mode = 0644
compile-directory = ${mioga:compile-directory}/Mioga2-${mioga:version}
[template-postgres]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-postgres.cfg
# md5sum =
output = ${buildout:directory}/template-postgres.cfg
mode = 0644
[networkcache]
# Cedric de Saint Martin signature certificate
# Test agent
......@@ -33,4 +185,4 @@ signature-certificate-list =
M/p3R8/xS6zvH1EqJ3FFD7XeAQ52WuQnKSREzuw0dsw12ClxjcHiQEFioyTiTtjs
5pW18Ry5Ie7iFK4cQMerZwWPxBodEbAteYlRsI6kePV7Gf735Y1RpuN8qZ2sYL6e
x2IMeSwJ82BpdEI5niXxB+iT0HxhmR+XaMI=
-----END CERTIFICATE-----
\ No newline at end of file
-----END CERTIFICATE-----
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