diff --git a/build/lemonldap-ng/Makefile b/build/lemonldap-ng/Makefile index 55c557e26..47889bc1d 100644 --- a/build/lemonldap-ng/Makefile +++ b/build/lemonldap-ng/Makefile @@ -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." diff --git a/build/lemonldap-ng/debian/control b/build/lemonldap-ng/debian/control index a9764c3eb..e6d5f3715 100644 --- a/build/lemonldap-ng/debian/control +++ b/build/lemonldap-ng/debian/control @@ -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 diff --git a/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.examples b/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.examples index 3440e1bde..9d9f4481b 100644 --- a/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.examples +++ b/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.examples @@ -1 +1,2 @@ debian/tmp/var/lib/lemonldap-ng/portal/* +debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal/ diff --git a/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.install b/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.install index 08db37809..4060f6fa0 100644 --- a/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.install +++ b/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.install @@ -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 diff --git a/build/lemonldap-ng/debian/rules b/build/lemonldap-ng/debian/rules index 92b79c1a4..039d284a2 100755 --- a/build/lemonldap-ng/debian/rules +++ b/build/lemonldap-ng/debian/rules @@ -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 diff --git a/modules/lemonldap-ng-handler/t/11-Lemonldap-NG-Handler-Status.t b/modules/lemonldap-ng-handler/t/11-Lemonldap-NG-Handler-Status.t index 5eb12720d..4c452f4c9 100644 --- a/modules/lemonldap-ng-handler/t/11-Lemonldap-NG-Handler-Status.t +++ b/modules/lemonldap-ng-handler/t/11-Lemonldap-NG-Handler-Status.t @@ -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 ); } diff --git a/modules/lemonldap-ng-portal/example/AuthLA/index.pl b/modules/lemonldap-ng-portal/example/AuthLA/index.pl index f60f78804..d409dbfe1 100644 --- a/modules/lemonldap-ng-portal/example/AuthLA/index.pl +++ b/modules/lemonldap-ng-portal/example/AuthLA/index.pl @@ -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 ) ;