Commit f71c37d9 authored by Xavier Guimard's avatar Xavier Guimard

LEMONLDAP::NG : to avoid having AuthLA files in a simple installation, AuthLA...

LEMONLDAP::NG : to avoid having AuthLA files in a simple installation, AuthLA is now installed in a separate directory.
                On Debian, AuthLA is now installed in /var/lib/lemonldap-ng

parent 2273b459
......@@ -7,6 +7,8 @@ MANAGERDIR=lemonldap-ng-manager
EXAMPLEDIRBUILD=`pwd`/example/
EXAMPLEDIR=$(EXAMPLEDIRBUILD)
EXAMPLECONFDIR=$(EXAMPLEDIR)conf/
EXAMPLELASPDIR=$(EXAMPLEDIR)liberty-alliance-sp-portal/
EXAMPLELASPDIRBUILD=$(EXAMPLELASPDIR)
EXAMPLELANG=en
all: handler manager portal
......@@ -85,8 +87,12 @@ example: all
chmod 1777 ${EXAMPLEDIRBUILD}/conf
cp -a ${HANDLERDIR}/example/* ${EXAMPLEDIRBUILD}/handler
cp -a ${PORTALDIR}/example/* ${EXAMPLEDIRBUILD}/portal
#perl -l -e '$$a="${EXAMPLELASPDIRBUILD}";$$a=~s#/$$##;print $$a;'
#perl -l -e '$$ARGV[0]=~s#/$$##;print $$ARGV[0];' ${EXAMPLELASPDIRBUILD}
mv ${EXAMPLEDIRBUILD}/portal/AuthLA $$(echo ${EXAMPLELASPDIRBUILD}|sed -e 's/\/$$//')
cp -a ${MANAGERDIR}/example/* ${EXAMPLEDIRBUILD}/manager
cp -a _example/* ${EXAMPLEDIRBUILD}
find ${EXAMPLELASPDIRBUILD} -type f -exec perl -i -pe 's#__DIR__/?#'${EXAMPLELASPDIR}'#g;s#__CONFDIR__/?#'${EXAMPLECONFDIR}'#g;' {} \;
find ${EXAMPLEDIRBUILD} -type f -exec perl -i -pe 's#__DIR__/?#'${EXAMPLEDIR}'#g;s#__CONFDIR__/?#'${EXAMPLECONFDIR}'#g;' {} \;
@echo
@echo "Example is ready."
......
......@@ -14,7 +14,7 @@ Description: Lemonldap::NG Web-SSO system
Lemonldap::NG is a complete Web-SSO system that can run with reverse-proxies
or directly on application apache servers.
.
This package is a meta package that install handler, manager and portal.
This package is a metapackage that install handler, manager and portal.
Package: lemonldap-ng-doc
Section: doc
......
debian/tmp/var/lib/lemonldap-ng/portal/*
debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal/
......@@ -3,3 +3,4 @@ debian/tmp/usr/share/perl5/auto/Lemonldap/NG/Portal
debian/tmp/usr/share/man/man3/Lemonldap::NG::Portal*
debian/portal-apache*.conf /etc/lemonldap-ng
debian/tmp/var/lib/lemonldap-ng/portal/scripts/purgeCentralCache /usr/share/lemonldap-ng/bin
debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal
......@@ -50,7 +50,12 @@ install: build
# Add here commands to install the package into debian/lemonldap-ng.
$(MAKE) test
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr
$(MAKE) example EXAMPLEDIRBUILD=debian/tmp/var/lib/lemonldap-ng EXAMPLEDIR=/var/lib/lemonldap-ng/ EXAMPLECONFDIR=/var/lib/lemonldap-ng/conf
$(MAKE) example \
EXAMPLEDIRBUILD=debian/tmp/var/lib/lemonldap-ng \
EXAMPLEDIR=/var/lib/lemonldap-ng/ \
EXAMPLECONFDIR=/var/lib/lemonldap-ng/conf \
EXAMPLELASPDIRBUILD=debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal \
EXAMPLELASPDIR=/var/lib/lemonldap-ng/liberty-alliance-sp-portal
cp debian/tmp/var/lib/lemonldap-ng/handler/MyHandler.pm debian/tmp/var/lib/lemonldap-ng/handler/MyHandler-Debian.pm
mv debian/tmp/var/lib/lemonldap-ng/index.pl debian/tmp/var/lib/lemonldap-ng/test.pl
mv debian/tmp/var/lib/lemonldap-ng/handler/lmH-apache.conf debian/tmp/var/lib/lemonldap-ng/apache-protected-area.conf
......@@ -69,6 +74,7 @@ binary-indep: build install
cp _example/index.pl debian/tmp/var/lib/lemonldap-ng/protected
find debian/tmp/var/lib/lemonldap-ng -type f -perm /111 -exec chmod -x {} \;
chmod +x debian/tmp/var/lib/lemonldap-ng/manager/scripts/lmConfigEditor
find debian/tmp/var/lib/lemonldap-ng -type f -name *.pl -exec chmod +x {} \;
dh_installexamples
find debian/lemonldap-ng -type f -exec perl -i -pe 's#__DIR__/?#'/var/lib/lemonldap-ng'#g;s#__CONFDIR__/?#'/var/lib/lemonldap-ng/conf'#g;' {} \;
dh_install
......
......@@ -42,16 +42,19 @@ ok( close($statusPipe) );
sub read {
my $ok = 0;
open LOG, '>/tmp/log';
#open LOG, '>/tmp/log';
while (<$statusOut>) {
print LOG $_;
$ok++ if (/^OK\s+:\s*2$/);
$ok++ if (/^REJECT\s+:\s*1$/);
#print LOG $_;
$ok++ if (/^OK\s+:\s*2\s*\(2\.00\s*\/\s*mn\)$/);
$ok++ if (/^REJECT\s+:\s*1\s*\(1\.00\s*\/\s*mn\)$/);
$ok++ if (/^OK\s+:\s*0\.20\s*\/\s*mn$/);
$ok++ if (/^REJECT\s+:\s*0\.10\s*\/\s*mn$/);
if (/^END$/) {
$ok++;
last;
}
}
close LOG;
return ( $ok == 3 );
#print LOG "$ok\n";
#close LOG;
return ( $ok == 5 );
}
......@@ -7,30 +7,28 @@ use HTML::Template ;
use Lemonldap::NG::Portal::AuthLA;
# Local parameter to set the installation directory
my $install_dir = "/var/lib/lemonldap-ng/web/portal";
my $var_dir = "/var/lib/lemonldap-ng/";
my $portal = Lemonldap::NG::Portal::AuthLA->new({
configStorage => {
type => "File" ,
dirName => "$var_dir/config" ,
type => 'File' ,
dirName => '__CONFDIR__' ,
} ,
# Liberty Parameters
laSp => {
certificate => "$install_dir/ressources/lemonsp-key-public.pem" ,
metadata => "$install_dir/ressources/lemonsp-metadata.xml" ,
privkey => "$install_dir/ressources/lemonsp-key-private.pem" ,
secretkey => "$install_dir/ressources/lemonsp-key-private.pem" ,
certificate => "__DIR__/ressources/lemonsp-key-public.pem" ,
metadata => "__DIR__/ressources/lemonsp-metadata.xml" ,
privkey => "__DIR__/ressources/lemonsp-key-private.pem" ,
secretkey => "__DIR__/ressources/lemonsp-key-private.pem" ,
} ,
laIdpsFile => "$install_dir/idps.xml" ,
laIdpsFile => "__DIR__/idps.xml" ,
laDebug => 0 ,
laLdapLoginAttribute => "uid" ,
# Liberty Storage Options are now generic CGI::Session options
laStorage => "File",
laStorageOptions => {
Directory => "$var_dir/var/assertion" ,
Directory => "__DIR__/var/assertion" ,
} ,
# Parameters that permit to access lemonldap::NG::Handler local cache
......@@ -43,7 +41,7 @@ my $portal = Lemonldap::NG::Portal::AuthLA->new({
if( $portal->process() ) {
print $portal->header;
my $template = HTML::Template->new( filename => "$install_dir/tpl/menu.tpl");
my $template = HTML::Template->new( filename => "__DIR__/tpl/menu.tpl");
my @sites = ();
foreach ($portal->getProtectedSites) {
......@@ -71,7 +69,7 @@ if( $portal->process() ) {
# Print template
print $portal->header ;
my $template = HTML::Template->new( filename => "$install_dir/tpl/auth.tpl" ) ;
my $template = HTML::Template->new( filename => "__DIR__/tpl/auth.tpl" ) ;
$template->param( AUTH_ERROR => $portal->error ) ;
$template->param( AUTH_URL => $portal->param('url') ) ;
$template->param( AUTH_IDPS => \@idps ) ;
......
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