Commit aeefee4e authored by Xavier Guimard's avatar Xavier Guimard

LEMONLDAP::NG : Debian installation in progress

parent 43120ba4
......@@ -31,14 +31,13 @@ package for Debian works fine).
Perl modules:
Apache::Session, Net::LDAP, MIME::Base64, CGI, LWP::UserAgent, Cache::Cache,
DBI, XML::Simple, SOAP::Lite (only if you want to use SOAP with the manager)
DBI, XML::Simple, SOAP::Lite, HTML::Template, XML::LibXML
With Debian:
apt-get install libapache-session-perl libnet-ldap-perl libcache-cache-perl \
libdbi-perl perl-modules libwww-perl libcache-cache-perl \
libxml-simple-perl
# If you want to use SOAP with the manager:
apt-get install libsoap-lite-perl
libxml-simple-perl libhtml-template-perl libsoap-lite-perl \
libxml-libxml-perl
1.2 - BUILDING
--------------
......@@ -49,14 +48,16 @@ With Debian:
$ cd lemonldap-ng-*
$ make && make test
$ sudo make install
$ make example
By default, all is installed in /usr/local/lemonldap-ng except Perl libraries
which are installed in a directory included in @INC.
1.2.2 - Install on Debian
$ tar xzf lemonldap-ng-*.tar.gz
$ cd lemonldap-ng-*
$ debuild
$ sudo dpkg -i ../lemonldap-ng*.deb
$ sudo dpkg -i ../*lemonldap-ng*.deb
1.3 - EXAMPLE CONFIGURATION
---------------------------
......
......@@ -12,8 +12,8 @@ PREFIX=/usr/local/
LMPREFIX=$(PREFIX)lemonldap-ng/
RLMPREFIX=$(DESTDIR)$(LMPREFIX)
# BIN dirs
BINDIR=$(RLMPREFIX)bin/
SBINDIR=$(RLMPREFIX)sbin/
BINDIR=$(LMPREFIX)bin/
RBINDIR=$(DESTDIR)$(BINDIR)
DATADIR=$(LMPREFIX)data/
RDATADIR=$(DESTDIR)$(DATADIR)
......@@ -155,32 +155,30 @@ install_libs: common_install_libs handler_install_libs portal_install_libs manag
common_install_libs: common
@$(MAKE) -C ${SRCCOMMONDIR} install
@touch common_install
handler_install_libs: handler
@$(MAKE) -C ${SRCHANDLERDIR} install
@touch handler_install
portal_install_libs: portal
@$(MAKE) -C ${SRCPORTALDIR} install
@touch portal_install
manager_install_libs: manager
@$(MAKE) -C ${SRCMANAGERDIR} install
@touch manager_install
example:
@$(MAKE) -f $(MAKEFILE) install_site LMPREFIX=$(EXAMPLEROOT)
install_bin: install_libs install_conf_dir
mkdir -p $(BINDIR)
cp --preserve=mode ${SRCPORTALDIR}/example/scripts/purgeCentralCache $(BINDIR)
cp --preserve=mode ${SRCMANAGERDIR}/example/scripts/lmConfigEditor $(BINDIR)
# Binary install
@install -v -d $(RBINDIR)
cp --preserve=mode --remove-destination ${SRCPORTALDIR}/example/scripts/purgeCentralCache $(RBINDIR)
cp --preserve=mode --remove-destination ${SRCMANAGERDIR}/example/scripts/lmConfigEditor $(RBINDIR)
#
# SITE INSTALL
#
install_site: install_manager_site install_portal_site install_handler_site install_test_site install_examples_site
# Site install
@install -v -d $(RCONFDIR)
# Apache configuration files
@cp --remove-destination _example/etc/apache* $(RCONFDIR)
......@@ -193,6 +191,37 @@ install_site: install_manager_site install_portal_site install_handler_site inst
# File for /etc/hosts inclusion
@cp --remove-destination _example/etc/for_etc_hosts $(RCONFDIR)
@perl -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)for_etc_hosts
#
@echo
@echo "LemonLDAP::NG example v${VERSION} is installed with these parameters:"
@echo " - System configuration: ${CONFDIR}"
@echo " - DNS domain (for cookies and virtual hosts): ${DNSDOMAIN}"
@echo " - LDAP parameters:"
@echo " - Host: ${LDAPHOST}"
@echo " - Port: ${LDAPPORT}"
@echo " - Suffix: ${LDAPSUFFIX}"
@echo
@echo "To finish configuration:"
@echo
@echo "1 - Add this in your Apache configuration file:"
@echo " with Apache-1.3.x"
@echo " include ${CONFDIR}apache.conf"
@echo " or with Apache-2.x:"
@echo " include ${CONFDIR}apache2.conf"
@echo
@echo "2 - Restart Apache (or Apache2)"
@echo
@echo "3 - Run 'make postconf' as root to update /etc/hosts" if your DNS service does not known auth.$(DNSDOMAIN) and manager.$(DNSDOMAIN)
@echo
@echo "4 - Use the manager at http://manager.${DNSDOMAIN}/ (after Apache restart) to modify LemonLDAP::NG configuration."
@echo " Edit ${DESTPORTALDIR}apps/apps-list.xml to modify the menu."
@echo
@echo "5 - Try to connect to http://test1.${DNSDOMAIN}/ or http://test2.${DNSDOMAIN}/"
@if [ "$(APACHEUSER)" == "" ]; then \
echo;echo " Warning, since APACHEUSER was not set, $(APACHESESSIONFILEDIR) and $(CONFDIR) have permissive permissions."; \
echo " Fix them by yourself to restrict their view to apache process only"; \
fi
@echo
install_manager_site: install_conf_dir
# Manager install
......@@ -202,11 +231,11 @@ install_manager_site: install_conf_dir
@find ${RMANAGERDIR} -type l -name imgs -delete
@find ${RMANAGERDIR} -type l -name images -delete
@cp -pR --remove-destination ${SRCMANAGERDIR}example/* ${RMANAGERDIR}
@rm -rf $$(find ${RMANAGERDIR} -type d -name .svn)
@rm -rf $$(find ${RMANAGERDIR} -type d -name .svn) ${RMANAGERDIR}scripts ${RMANAGERDIR}mrtg
@if [ "${RMANAGERDIR}imgs/" != "${RMANAGERDATADIR}" ]; then \
mv -f ${RMANAGERDIR}imgs/* ${RMANAGERDATADIR}; \
rm -rf ${RMANAGERDIR}imgs; \
ln -s $$(echo ${RMANAGERDATADIR} | sed -e 's/\/$$//') ${RMANAGERDIR}imgs; \
ln -s $$(echo ${MANAGERDATADIR} | sed -e 's/\/$$//') ${RMANAGERDIR}imgs; \
fi
# apply.conf install
@mv ${RMANAGERDIR}apply.conf $(RCONFDIR)
......@@ -251,38 +280,55 @@ install_portal_site: install_conf_dir
@rm -rf $$(find ${RPORTALDIR} $(RPORTALSKINSDIR) $(RLASPPORTALDIR) -type d -name .svn)
install_handler_site: install_conf_dir
# Handler install
@install -v -d ${RHANDLERDIR}
@cp --remove-destination ${SRCHANDLERDIR}/example/MyHandler.pm ${RHANDLERDIR}
install_test_site:
# Test site install
@install -v -d $(RTESTDIR)
@cp -pR --remove-destination _example/test/* $(RTESTDIR)
@perl -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RTESTDIR)index.pl
install_examples_site:
# Examples install
@install -v -d $(REXAMPLESDIR)
@for i in portal manager portal handler; do \
@for i in manager portal handler; do \
cp -dpR --remove-destination lemonldap-ng-$$i/example $(REXAMPLESDIR)/$$i; \
done
@rm -rf $(REXAMPLESDIR)portal/skins \
$(REXAMPLESDIR)manager/imgs \
$(REXAMPLESDIR)manager/images \
install_conf_dir: install_sessions_dir
# Configuration files install
@install -v -d $(RCONFDIR) $(RFILECONFIGDIR) $(RTOOLSDIR)
@cp --remove-destination $(SRCCOMMONDIR)storage.conf $(RCONFDIR)
@cp _example/conf/lmConf-1 $(RFILECONFIGDIR)
perl -000 -i -pe "s#^(globalStorageOptions\\n\\s+)'[^\\n]*?'\$$#\$${1}\'\\$$data1 = {&39;Directory&39; => &39;$(APACHESESSIONFILEDIR)&39;,&39;LockDirectory&39; => &39;$(APACHESESSIONFILELOCKDIR)&39;};'#m" $(RFILECONFIGDIR)lmConf-1
@perl -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g;\
s/__LDAPPORT__/$(LDAPPORT)/g;\
s/__LDAPHOST__/$(LDAPHOST)/g;\
s/__LDAPSUFFIX__/$(LDAPSUFFIX)/g;\
s#__SESSIONDIR__#$(APACHESESSIONFILEDIR)#g;' $(RFILECONFIGDIR)lmConf-1
@if [ "$(APACHEUSER)" != "" ]; then \
chown $(APACHEUSER) $(RFILECONFIGDIR) || exit 1; \
if [ "$(APACHEGROUP)" != "" ]; then \
chgrp $(APACHEGROUP) $(RFILECONFIGDIR) || exit 1; \
fi; \
chmod 770 $(RFILECONFIGDIR); \
else \
chmod 777 $(RFILECONFIGDIR); \
fi
@cp lemonldap-ng-common/tools/lmConfig.mysql lemonldap-ng-common/tools/apache-session-mysql.sql $(RTOOLSDIR)
install_sessions_dir:
@install -m 777 -v -d $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR)
# Fix Apache::Session directories permissions
@if [ "$(APACHEUSER)" != "" ]; then \
chown $(APACHEUSER) $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR); \
chown $(APACHEUSER) $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR) || exit 1; \
if [ "$(APACHEGROUP)" != "" ]; then \
chgrp $(APACHEGROUP) $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR); \
chgrp $(APACHEGROUP) $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR) || exit 1; \
fi; \
chmod 770 $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR); \
else \
......@@ -290,44 +336,12 @@ install_sessions_dir:
fi
TODO:
@echo
@echo "LemonLDAP::NG example v${VERSION} is installed with these parameters:"
@echo " - System configuration: ${SYSTEMCONFDIR}"
@echo " - Scripts: ${SCRIPTSDIR}"
@echo " - LemonLDAP::NG Configuration: ${DESTFILECONFDIR}"
@echo " - DNS domain (for cookies and virtual hosts): ${DNSDOMAIN}"
@echo " - LDAP parameters:"
@echo " - Host: ${LDAPHOST}"
@echo " - Port: ${LDAPPORT}"
@echo " - Suffix: ${LDAPSUFFIX}"
@echo
@echo "To finish configuration:"
@echo
@echo "1 - Add this in your Apache configuration file:"
@echo " with Apache-1.3.x"
@echo " include ${SYSTEMCONFDIR}apache.conf"
@echo " or with Apache-2.x:"
@echo " include ${SYSTEMCONFDIR}apache2.conf"
@echo
@echo "2 - Run 'make postconf' as root to update /etc/hosts and set UNIX rights"
@echo
@echo "3 - Use the manager at http://manager.${DNSDOMAIN}/ (after Apache restart) or edit ${DESTFILECONFDIR}lmConf-1 to modify LemonLDAP::NG configuration."
@echo " Edit ${DESTPORTALDIR}apps/apps-list.xml to modify the menu."
@echo
@echo "4 - Restart Apache (or Apache2)"
@echo
@echo "5 - Try to connect to http://test1.${DNSDOMAIN}/ or http://test2.${DNSDOMAIN}/"
postconf_hosts:
@cat ${SYSTEMCONFDIR}for_etc_hosts >> /etc/hosts
@echo "/etc/hosts was updated"
postconf_unixrights:
@chmod 1777 ${DESTFILECONFDIR}
@chmod 1777 ${DESTSESSIONDIR}
@echo "UNIX files permissions set"
postconf: postconf_hosts postconf_unixrights
postconf: postconf_hosts
@echo "Post configuration done"
uninstall: configure handler_uninstall portal_uninstall manager_uninstall
......
#!/usr/bin/perl
package Lemonldap::NG::Conf;
our $configStorage;
BEGIN {
open F, '/etc/lemonldap-ng/storage.conf' or die "/etc/lemonldap-ng/storage.conf: $!";
while(<F>) {
next if(/^\s*$/ or /^\s*#/);
chomp;
s/\r//g;
/^\s*([\w]+)(?:\s*[:=]\s*|\s+)(["']?)([\S].*[\S])\2\s*$/ or next;
my $k = $1;
$configStorage->{$k} = $3;
if($configStorage->{$k} =~ /^([{\[]).*[}\]]$/) {
eval "\$configStorage->{$k} = $configStorage->{$k}";
}
}
close F;
}
1;
/etc/lemonldap-ng
/usr/share
/usr/share/lemonldap-ng/bin
/var/lib/lemonldap-ng
/usr/share/doc/lemonldap-ng/examples
/var/lib/lemonldap-ng/conf
/var/lib/lemonldap-ng/sessions
/var/lib/lemonldap-ng/sessions/lock
debian/tmp/etc/lemonldap-ng/storage.conf
debian/tmp/etc/lemonldap-ng/for_etc_hosts
debian/tmp/usr/share/perl5/Lemonldap/NG/Common*
debian/tmp/usr/share/man/man3/Lemonldap::NG::Common*
debian/tmp/usr/share/lemonldap-ng/ressources
debian/tmp/usr/share/man/man1/lmConfig_File2MySQL.1p
debian/tmp/usr/bin/lmConfig* /usr/share/lemonldap-ng/bin
debian/configStorage.pm /usr/share/lemonldap-ng
debian/storage.conf /etc/lemonldap-ng
debian/tmp/var/lib/lemonldap-ng/conf /var/lib/lemonldap-ng
debian/tmp/usr/bin/lmConfig_File2MySQL /usr/share/lemonldap-ng/bin
debian/tmp/var/lib/lemonldap-ng/conf/
......@@ -19,6 +19,6 @@ then
db_get liblemonldap-ng-conf-perl/$i || true
perl -000 -i -pe "s#^$i(\\n\\s+)('?)[^\\n]*?('?)\$#$i\${1}\${2}$RET\${3}#m" $FIRSTCONFFILE
done
perl -000 -i -pe "s#^(globalStorageOptions\\n\\s+)'[^\\n]*?'\$#\${1}\'\\\$data1 = {&39;Directory&39; => &39;/var/lib/lemonldap-ng/sessions/&39;,&39;LockDirectory&39; => &39;/var/lib/lemonldap-ng/sessions/lock/&39;};'#m" $FIRSTCONFFILE
#perl -000 -i -pe "s#^(globalStorageOptions\\n\\s+)'[^\\n]*?'\$#\${1}\'\\\$data1 = {&39;Directory&39; => &39;/var/lib/lemonldap-ng/sessions/&39;,&39;LockDirectory&39; => &39;/var/lib/lemonldap-ng/sessions/lock/&39;};'#m" $FIRSTCONFFILE
fi
exit 0
debian/tmp/var/lib/lemonldap-ng/handler/*
debian/tmp/var/lib/lemonldap-ng/apache*-protected-area.conf
debian/tmp/etc/lemonldap-ng/handler-apache*.conf
debian/tmp/examples/handler/*
debian/tmp/usr/share/perl5/Lemonldap/NG/Handler*
debian/tmp/usr/share/man/man3/Lemonldap::NG::Handler*
debian/tmp/var/lib/lemonldap-ng/test
......@@ -5,7 +5,7 @@ set -e
. /usr/share/debconf/confmodule
EXAMPLEHANDLERFILE=/usr/share/doc/liblemonldap-ng-handler-perl/examples/MyHandler-Debian.pm
EXAMPLEHANDLERFILE=/usr/share/doc/liblemonldap-ng-handler-perl/examples/MyHandler.pm
HANDLERFILE=/var/lib/lemonldap-ng/handler/MyHandler.pm
SESSIONSDIR=/var/lib/lemonldap-ng/sessions
......
debian/tmp/var/lib/lemonldap-ng/manager/index*
debian/tmp/var/lib/lemonldap-ng/manager/mrtg
debian/tmp/var/lib/lemonldap-ng/manager/sessions.pl
debian/tmp/var/lib/lemonldap-ng/manager/soapserver.pl
debian/tmp/examples/manager/*
......@@ -3,11 +3,9 @@ debian/tmp/usr/share/perl5/auto/Lemonldap/NG/Manager
debian/tmp/usr/share/man/man3/Lemonldap::NG::Manager.3pm
debian/tmp/usr/share/man/man3/Lemonldap::NG::Manager::SOAPServer.3pm
debian/tmp/usr/share/man/man3/Lemonldap::NG::Manager::Restricted.3pm
debian/tmp/var/lib/lemonldap-ng/manager/apply.conf /etc/lemonldap-ng
debian/tmp/etc/lemonldap-ng/apply.conf
debian/manager-apache*.conf /etc/lemonldap-ng
debian/tmp/var/lib/lemonldap-ng/manager/imgs
debian/tmp/var/lib/lemonldap-ng/manager/images
debian/tmp/var/lib/lemonldap-ng/manager/theme
debian/tmp/var/lib/lemonldap-ng/manager/lemonldap-ng-manager.js
debian/tmp/var/lib/lemonldap-ng/manager/sessions.pl
debian/tmp/var/lib/lemonldap-ng/manager/scripts/lmConfigEditor /usr/share/lemonldap-ng/bin
debian/tmp/usr/share/lemonldap-ng/manager-imgs
debian/tmp/usr/share/lemonldap-ng/sessions-explorer-imgs
debian/tmp/var/lib/lemonldap-ng/manager
debian/tmp/usr/share/lemonldap-ng/bin/lmConfigEditor
......@@ -5,7 +5,7 @@ set -e
. /usr/share/debconf/confmodule
EXAMPLEMANAGERFILE=/usr/share/doc/liblemonldap-ng-manager-perl/examples/index-Debian.pl
EXAMPLEMANAGERFILE=/usr/share/doc/liblemonldap-ng-manager-perl/examples/index.pl
MANAGERFILE=/var/lib/lemonldap-ng/manager/index.pl
EXAMPLESESSIONSFILE=/usr/share/doc/liblemonldap-ng-manager-perl/examples/sessions.pl
SESSIONSFILE=/var/lib/lemonldap-ng/manager/sessions.pl
......
debian/tmp/var/lib/lemonldap-ng/portal/*.pl
debian/tmp/examples/portal/*
debian/tmp/usr/share/perl5/Lemonldap/NG/Portal*
debian/tmp/usr/share/perl5/auto/Lemonldap/NG/Portal
debian/tmp/etc/lemonldap-ng/apps-list*
debian/tmp/usr/share/lemonldap-ng/bin/purgeCentralCache
debian/tmp/usr/share/lemonldap-ng/portal-skins
debian/tmp/usr/share/man/man3/Lemonldap::NG::Portal*
debian/tmp/usr/share/perl5/auto/Lemonldap/NG/Portal
debian/tmp/usr/share/perl5/Lemonldap/NG/Portal*
debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal
debian/tmp/var/lib/lemonldap-ng/portal
debian/portal-apache*.conf /etc/lemonldap-ng
debian/tmp/var/lib/lemonldap-ng/portal/apps/
debian/tmp/etc/lemonldap-ng/apps*
debian/tmp/var/lib/lemonldap-ng/portal/skins
debian/tmp/var/lib/lemonldap-ng/portal/scripts/purgeCentralCache /usr/share/lemonldap-ng/bin
debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal/
......@@ -5,9 +5,9 @@ set -e
. /usr/share/debconf/confmodule
LAEXAMPLEPORTALFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/liberty-alliance-sp-portal/index-Debian.pl
LAEXAMPLEPORTALFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/AuthLA/index.pl
LAPORTALFILE=/var/lib/lemonldap-ng/liberty-alliance-sp-portal/index.pl
EXAMPLEPORTALFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/index_skin-Debian.pl
EXAMPLEPORTALFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/index_skin.pl
PORTALFILE=/var/lib/lemonldap-ng/portal/index.pl
SESSIONSDIR=/var/lib/lemonldap-ng/sessions
......
......@@ -11,15 +11,16 @@
export PERL_MM_USE_DEFAULT=1
LM_ROOT=/var/lib/lemonldap-ng/
DEB_TMP_LM_ROOT=debian/tmp$(LM_ROOT)
LM_CONF_ROOT=/etc/lemonldap-ng/
DEB_TMP_LM_CONF_ROOT=debian/tmp$(LM_CONF_ROOT)
LMSHAREDIR=/usr/share/lemonldap-ng/
LMVARDIR=/var/lib/lemonldap-ng/
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
$(MAKE) configure STORAGECONFFILE=/etc/lemonldap-ng/storage.conf \
PERLOPTIONS="INSTALLDIRS=vendor"
touch configure-stamp
......@@ -30,7 +31,7 @@ build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
$(MAKE) INSTALLDIRS=vendor
$(MAKE)
touch $@
......@@ -53,46 +54,35 @@ 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 \
EXAMPLEROOT=debian/tmp/ \
DESTDOCSDIR=debian/tmp/docs/ \
REALDESTFILECONFDIR=$(LM_ROOT)conf/ \
DESTFILECONFDIR=$(LM_ROOT)conf/ \
REALROOT=/
# Debian example files
mv $(DEB_TMP_LM_CONF_ROOT)conf $(DEB_TMP_LM_ROOT)
cp $(DEB_TMP_LM_ROOT)handler/MyHandler.pm $(DEB_TMP_LM_ROOT)handler/MyHandler-Debian.pm
cp $(DEB_TMP_LM_ROOT)portal/index.pl $(DEB_TMP_LM_ROOT)portal/index-Debian.pl
cp $(DEB_TMP_LM_ROOT)portal/index_skin.pl $(DEB_TMP_LM_ROOT)portal/index_skin-Debian.pl
cp $(DEB_TMP_LM_ROOT)liberty-alliance-sp-portal/index.pl $(DEB_TMP_LM_ROOT)liberty-alliance-sp-portal/index-Debian.pl
cp $(DEB_TMP_LM_ROOT)manager/index.pl $(DEB_TMP_LM_ROOT)manager/index-Debian.pl
#perl -i -pe 's#__DIR__/?#'/var/lib/lemonldap-ng'#g;s#__CONFDIR__/?#'$(LM_ROOT)conf'#g;' \
# $(DEB_TMP_LM_ROOT)apache*-protected-area.conf
cp debian/handler-apache* $(DEB_TMP_LM_CONF_ROOT)
# System to use /etc/lemonldap-ng/storage.conf instead of setting
# manually the configStorage parameter
perl -000 -i -pe 's/(Lemonldap::NG::Common::Conf.*new\s*\(\s*){[^}]+}/$$1\$$Lemonldap::NG::Conf::configStorage/; s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
$(DEB_TMP_LM_ROOT)manager/scripts/lmConfigEditor \
$(DEB_TMP_LM_ROOT)portal/scripts/purgeCentralCache
perl -000 -i -pe 's/(configStorage\s*=>\s*){[^}]+}/$$1\$$Lemonldap::NG::Conf::configStorage/s; s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
$(DEB_TMP_LM_ROOT)handler/MyHandler-Debian.pm \
$(DEB_TMP_LM_ROOT)manager/*Debian.pl \
$(DEB_TMP_LM_ROOT)portal/*Debian.pl \
$(DEB_TMP_LM_ROOT)liberty-alliance-sp-portal/index-Debian.pl
# apply.conf is in /etc/lemonldap-ng/
perl -i -pe 's#(applyConfFile\s+=>\s+.*?)/\S*(apply\.conf)#$$1/etc/lemonldap-ng/$$2#' \
$(DEB_TMP_LM_ROOT)manager/*.pl \
# SInce Lenny, jquery.js is provided by libjs-jquery
rm -f $(DEB_TMP_LM_ROOT)portal/skins/pastel/jquery.js $(DEB_TMP_LM_ROOT)manager/jquery.js
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp \
PREFIX=/usr/ \
BINDIR=$(LMSHAREDIR)bin/ \
DOCUMENTROOT=$(LMVARDIR) \
EXAMPLESDIR=/examples/ \
HANDLERDIR=$(LMVARDIR)handler/ \
PORTALSKINSDIR=$(LMSHAREDIR)portal-skins/ \
MANAGERDATADIR=$(LMSHAREDIR)manager-imgs/ \
SESSIONSEXPLORERDATADIR=$(LMSHAREDIR)sessions-explorer-imgs/ \
STORAGECONFFILE=/etc/lemonldap-ng/storage.conf \
TOOLSDIR=$(LMSHAREDIR)ressources/ \
CONFDIR=/etc/lemonldap-ng/ \
CRONDIR=/etc/cron.d/ \
DATADIR=$(LMVARDIR) \
APACHEUSER=www-data \
APACHEGROUP=www-data
# Since Lenny, jquery.js is provided by libjs-jquery
rm -f $(CURDIR)/debian/tmp$(LMSHAREDIR)portal-skins/pastel/jquery.js \
$(CURDIR)/debian/tmp$(LMVARDIR)manager/jquery.js \
debian/tmp/examples/manager/jquery.js
perl -i -pe 's#(["'"'"'])[\w-\./]*jquery.js#$$1/javascript/jquery/jquery.js#' \
$(DEB_TMP_LM_ROOT)manager/sessions.pl \
$(DEB_TMP_LM_ROOT)portal/skins/pastel/header.tpl
$(CURDIR)$(LMVARDIR)manager/sessions.pl \
$(CURDIR)/debian/tmp$(LMSHAREDIR)portal-skins/pastel/header.tpl
# postinst provides initial portal, manager and sessions-explorer
rm -f debian/tmp/var/lib/lemonldap-ng/portal/index.pl \
debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal/index.pl \
debian/tmp/var/lib/lemonldap-ng/manager/index.pl \
debian/tmp/var/lib/lemonldap-ng/manager/sessions.pl
# Build architecture-independent files here.
binary-indep: build install
......@@ -100,18 +90,15 @@ binary-indep: build install
dh_testroot
dh_installchangelogs changelog
dh_installdocs
mkdir $(DEB_TMP_LM_ROOT)protected
find debian/tmp/var/lib/lemonldap-ng -type f -perm /111 -exec chmod -x {} \;
chmod +x $(DEB_TMP_LM_ROOT)manager/scripts/lmConfigEditor
find debian/tmp/var/lib/lemonldap-ng -type f -name *.pl -exec chmod +x {} \;
dh_installexamples
dh_install
cd debian/lemonldap-ng/usr/share/doc/lemonldap-ng/examples && \
mkdir -p debian/lemonldap-ng/usr/share/doc/lemonldap-ng/examples && \
cd debian/lemonldap-ng/usr/share/doc/lemonldap-ng/examples && \
ln -s ../../liblemonldap-ng-handler-perl/examples handler && \
ln -s ../../liblemonldap-ng-manager-perl/examples manager && \
ln -s ../../liblemonldap-ng-portal-perl/examples portal && \
ln -s ../../liblemonldap-ng-conf-perl/examples/ conf
chmod +x debian/liblemonldap-ng-portal-perl/usr/share/lemonldap-ng/bin/purgeCentralCache
chmod +x debian/liblemonldap-ng-portal-perl$(LMSHAREDIR)bin/purgeCentralCache
# dh_installmenu
dh_installdebconf
# dh_installlogrotate
......
......@@ -86,7 +86,6 @@ sub abort {
$t2 ||= "See Apache's logs";
print $cgi->header(
-type => 'text/html; charset=utf8',
-status => '500 Server Error',
);
print $cgi->start_html(
-title => $t1,
......@@ -94,6 +93,7 @@ sub abort {
);
print "<h1>$t1</h1>";
print "<p>$t2</p>";
print STDERR ( ref($self)|| $self ) . " error: $t1, $t2\n";
exit;
}
......
......@@ -27,14 +27,14 @@ sub new {
unless ( $self->{mdone} ) {
$self->_readConfFile( $self->{confFile} );
unless ( $self->{type} ) {
$msg .= "configStorage: type is not defined\n";
$msg .= "Error: configStorage: type is not defined\n";
return 0;
}
$self->{type} = "Lemonldap::NG::Common::Conf::$self->{type}"
unless $self->{type} =~ /^Lemonldap::/;
eval "require $self->{type}";
if ($@) {
$msg .= "Unknown package $self->{type}";
$msg .= "Error: Unknown package $self->{type}";
return 0;
}
return 0 unless $self->prereq;
......@@ -59,7 +59,7 @@ sub _readConfFile {
my $file = shift || DEFAULTCONFFILE;
unless ( $_confFiles{$file} ) {
unless ( open F, $file ) {
$msg = "/etc/lemonldap-ng/storage.conf: $!";
$msg = "Warning $file: $!. ";
return 0;
}
while (<F>) {
......@@ -72,7 +72,7 @@ sub _readConfFile {
if ( $_confFiles{$file}->{$k} =~ /^[{\[].*[}\]]$/ ) {
eval "\$_confFiles{'$file'}->{'$k'} = $_confFiles{$file}->{$k}";
if ($@) {
$msg = "Error in file $file : $@";
$msg = "Warning: error in file $file : $@. ";
return 0;
}
}
......
......@@ -57,7 +57,7 @@ sub new {
return 0;
}
%$self = ( %$self, %$args );
foreach (qw(configStorage dhtmlXTreeImageLocation)) {
foreach (qw(dhtmlXTreeImageLocation)) {
unless ( $self->{$_} ) {
print STDERR qq/The "$_" parameter is required\n/;
return 0;
......@@ -73,7 +73,8 @@ qq#Unable to read $self->{jsFile}. You have to set "jsFile" parameter to /path/t
$self->{textareaH} ||= 5;
$self->{inputSize} ||= 30;
unless ( __PACKAGE__->can('ldapServer') ) {
Lemonldap::NG::Manager::_i18n::import( $ENV{HTTP_ACCEPT_LANGUAGE} );
Lemonldap::NG::Manager::_i18n::import( $self->{language}
|| $ENV{HTTP_ACCEPT_LANGUAGE} );
}
if ( $self->param('lmQuery') ) {
my $tmp = "print_" . $self->param('lmQuery');
......@@ -144,7 +145,8 @@ sub print_help {
my $self = shift;
print $self->header_public( $ENV{SCRIPT_FILENAME},
-type => 'text/html; charset=utf8' );
Lemonldap::NG::Manager::Help::import( $ENV{HTTP_ACCEPT_LANGUAGE} )
Lemonldap::NG::Manager::Help::import( $self->{language}
|| $ENV{HTTP_ACCEPT_LANGUAGE} )
unless ( $self->can('help_groups') );
my $chap = $self->param('help');
eval { no strict "refs"; &{"help_$chap"} };
......@@ -155,7 +157,8 @@ sub print_help {
sub print_delete {
my $self = shift;
print $self->header( -type => 'text/html; charset=utf8' );
Lemonldap::NG::Manager::Help::import( $ENV{HTTP_ACCEPT_LANGUAGE} )
Lemonldap::NG::Manager::Help::import( $self->{language}
|| $ENV{HTTP_ACCEPT_LANGUAGE} )
unless ( $self->can('help_groups') );
if ( $self->config->delete( $self->param('cfgNum') ) ) {
print &txt_configurationDeleted;
......@@ -773,7 +776,8 @@ sub config {
$self->{_config} =
Lemonldap::NG::Common::Conf->new( $self->{configStorage} );
unless ( $self->{_config} ) {
$self->abort("Configuration not loaded\n");
$self->abort( "Configuration not loaded\n",
$Lemonldap::NG::Common::Conf::msg );
}
return $self->{_config};
}
......
......@@ -74,7 +74,7 @@ EOT
sub javascript {
my $self = shift;
Lemonldap::NG::Manager::_i18n::import( $ENV{HTTP_ACCEPT_LANGUAGE} )
Lemonldap::NG::Manager::_i18n::import( $self->{language} || $ENV{HTTP_ACCEPT_LANGUAGE} )
unless ( __PACKAGE__->can('txt_newVirtualHost') );
my %text;
foreach (
......@@ -420,7 +420,8 @@ sub start_html {
}
sub main {
Lemonldap::NG::Manager::_i18n::import( $ENV{HTTP_ACCEPT_LANGUAGE} )
my $self = shift;
Lemonldap::NG::Manager::_i18n::import( $self->{language} || $ENV{HTTP_ACCEPT_LANGUAGE} )
unless ( __PACKAGE__->can('txt_field') );
my %text;
foreach (qw(field value)) {
......
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