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
This commit is contained in:
Xavier Guimard 2008-05-18 09:26:41 +00:00
parent 2273b45907
commit f71c37d97b
7 changed files with 35 additions and 20 deletions

View File

@ -7,6 +7,8 @@ MANAGERDIR=lemonldap-ng-manager
EXAMPLEDIRBUILD=`pwd`/example/ EXAMPLEDIRBUILD=`pwd`/example/
EXAMPLEDIR=$(EXAMPLEDIRBUILD) EXAMPLEDIR=$(EXAMPLEDIRBUILD)
EXAMPLECONFDIR=$(EXAMPLEDIR)conf/ EXAMPLECONFDIR=$(EXAMPLEDIR)conf/
EXAMPLELASPDIR=$(EXAMPLEDIR)liberty-alliance-sp-portal/
EXAMPLELASPDIRBUILD=$(EXAMPLELASPDIR)
EXAMPLELANG=en EXAMPLELANG=en
all: handler manager portal all: handler manager portal
@ -85,8 +87,12 @@ example: all
chmod 1777 ${EXAMPLEDIRBUILD}/conf chmod 1777 ${EXAMPLEDIRBUILD}/conf
cp -a ${HANDLERDIR}/example/* ${EXAMPLEDIRBUILD}/handler cp -a ${HANDLERDIR}/example/* ${EXAMPLEDIRBUILD}/handler
cp -a ${PORTALDIR}/example/* ${EXAMPLEDIRBUILD}/portal 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 ${MANAGERDIR}/example/* ${EXAMPLEDIRBUILD}/manager
cp -a _example/* ${EXAMPLEDIRBUILD} 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;' {} \; find ${EXAMPLEDIRBUILD} -type f -exec perl -i -pe 's#__DIR__/?#'${EXAMPLEDIR}'#g;s#__CONFDIR__/?#'${EXAMPLECONFDIR}'#g;' {} \;
@echo @echo
@echo "Example is ready." @echo "Example is ready."

View File

@ -14,7 +14,7 @@ Description: Lemonldap::NG Web-SSO system
Lemonldap::NG is a complete Web-SSO system that can run with reverse-proxies Lemonldap::NG is a complete Web-SSO system that can run with reverse-proxies
or directly on application apache servers. 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 Package: lemonldap-ng-doc
Section: doc Section: doc

View File

@ -1 +1,2 @@
debian/tmp/var/lib/lemonldap-ng/portal/* debian/tmp/var/lib/lemonldap-ng/portal/*
debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal/

View File

@ -3,3 +3,4 @@ debian/tmp/usr/share/perl5/auto/Lemonldap/NG/Portal
debian/tmp/usr/share/man/man3/Lemonldap::NG::Portal* debian/tmp/usr/share/man/man3/Lemonldap::NG::Portal*
debian/portal-apache*.conf /etc/lemonldap-ng 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/portal/scripts/purgeCentralCache /usr/share/lemonldap-ng/bin
debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal

View File

@ -50,7 +50,12 @@ install: build
# Add here commands to install the package into debian/lemonldap-ng. # Add here commands to install the package into debian/lemonldap-ng.
$(MAKE) test $(MAKE) test
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr $(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 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/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 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 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 {} \; 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 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 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;' {} \; 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 dh_install

View File

@ -42,16 +42,19 @@ ok( close($statusPipe) );
sub read { sub read {
my $ok = 0; my $ok = 0;
open LOG, '>/tmp/log'; #open LOG, '>/tmp/log';
while (<$statusOut>) { while (<$statusOut>) {
print LOG $_; #print LOG $_;
$ok++ if (/^OK\s+:\s*2$/); $ok++ if (/^OK\s+:\s*2\s*\(2\.00\s*\/\s*mn\)$/);
$ok++ if (/^REJECT\s+:\s*1$/); $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$/) { if (/^END$/) {
$ok++; $ok++;
last; last;
} }
} }
close LOG; #print LOG "$ok\n";
return ( $ok == 3 ); #close LOG;
return ( $ok == 5 );
} }

View File

@ -7,30 +7,28 @@ use HTML::Template ;
use Lemonldap::NG::Portal::AuthLA; use Lemonldap::NG::Portal::AuthLA;
# Local parameter to set the installation directory # 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({ my $portal = Lemonldap::NG::Portal::AuthLA->new({
configStorage => { configStorage => {
type => "File" , type => 'File' ,
dirName => "$var_dir/config" , dirName => '__CONFDIR__' ,
} , } ,
# Liberty Parameters # Liberty Parameters
laSp => { laSp => {
certificate => "$install_dir/ressources/lemonsp-key-public.pem" , certificate => "__DIR__/ressources/lemonsp-key-public.pem" ,
metadata => "$install_dir/ressources/lemonsp-metadata.xml" , metadata => "__DIR__/ressources/lemonsp-metadata.xml" ,
privkey => "$install_dir/ressources/lemonsp-key-private.pem" , privkey => "__DIR__/ressources/lemonsp-key-private.pem" ,
secretkey => "$install_dir/ressources/lemonsp-key-private.pem" , secretkey => "__DIR__/ressources/lemonsp-key-private.pem" ,
} , } ,
laIdpsFile => "$install_dir/idps.xml" , laIdpsFile => "__DIR__/idps.xml" ,
laDebug => 0 , laDebug => 0 ,
laLdapLoginAttribute => "uid" , laLdapLoginAttribute => "uid" ,
# Liberty Storage Options are now generic CGI::Session options # Liberty Storage Options are now generic CGI::Session options
laStorage => "File", laStorage => "File",
laStorageOptions => { laStorageOptions => {
Directory => "$var_dir/var/assertion" , Directory => "__DIR__/var/assertion" ,
} , } ,
# Parameters that permit to access lemonldap::NG::Handler local cache # Parameters that permit to access lemonldap::NG::Handler local cache
@ -43,7 +41,7 @@ my $portal = Lemonldap::NG::Portal::AuthLA->new({
if( $portal->process() ) { if( $portal->process() ) {
print $portal->header; 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 = (); my @sites = ();
foreach ($portal->getProtectedSites) { foreach ($portal->getProtectedSites) {
@ -71,7 +69,7 @@ if( $portal->process() ) {
# Print template # Print template
print $portal->header ; 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_ERROR => $portal->error ) ;
$template->param( AUTH_URL => $portal->param('url') ) ; $template->param( AUTH_URL => $portal->param('url') ) ;
$template->param( AUTH_IDPS => \@idps ) ; $template->param( AUTH_IDPS => \@idps ) ;