lemonldap-ng/Makefile

878 lines
34 KiB
Makefile
Raw Normal View History

#!/usr/bin/make
# Prefix for packaging
DESTDIR=
# Flag for optimizations
PROD=no
# Compression
JSCOMPRESS=$(PROD)
CSSCOMPRESS=$(PROD)
PERL=$$(which perl)
PERLVERSION=`perl -e '$$version = $$^V; $$version =~ s/v//; print $$version'`
2010-01-08 07:41:37 +01:00
SU=su -c
COMPRESS=tar czf
UNCOMPRESS=tar xzf
2010-11-22 14:36:16 +01:00
LISTCOMPRESSED=tar tzf
2010-01-08 07:41:37 +01:00
COMPRESSSUFFIX=tar.gz
# Perl options
#PERLOPTIONS="INSTALLDIRS=vendor"
PERLOPTIONS=
# Default directories install
PREFIX=/usr/local
LMPREFIX=$(PREFIX)/lemonldap-ng
RLMPREFIX=$(DESTDIR)/$(LMPREFIX)
# BIN dirs
BINDIR=$(LMPREFIX)/bin
RBINDIR=$(DESTDIR)/$(BINDIR)
DATADIR=$(LMPREFIX)/data
RDATADIR=$(DESTDIR)/$(DATADIR)
EXAMPLEROOT=`pwd`/example
# Document roots for Apache VirtualHosts
DOCUMENTROOT=$(LMPREFIX)/htdocs
PORTALDIR=$(DOCUMENTROOT)/portal
RPORTALDIR=$(DESTDIR)/$(PORTALDIR)
PORTALSKINSDIR=$(PORTALDIR)/skins
RPORTALSKINSDIR=$(DESTDIR)/$(PORTALSKINSDIR)
MANAGERDIR=$(DOCUMENTROOT)/manager
RMANAGERDIR=$(DESTDIR)/$(MANAGERDIR)
2015-06-10 22:40:29 +02:00
MANAGERSITEDIR=$(MANAGERDIR)
2015-05-14 08:45:03 +02:00
RMANAGERSITEDIR=$(DESTDIR)/$(MANAGERSITEDIR)
MANAGERSTATICDIR=$(MANAGERSITEDIR)/static
RMANAGERSTATICDIR=$(DESTDIR)/$(MANAGERSTATICDIR)
2015-06-10 22:40:29 +02:00
MANAGERRELATIVESTATICDIR=/static
MANAGERPSGIDIR=$(MANAGERSITEDIR)/psgi
RMANAGERPSGIDIR=$(DESTDIR)/$(MANAGERPSGIDIR)
MANAGERTEMPLATESDIR=$(MANAGERSITEDIR)/templates
RMANAGERTEMPLATESDIR=$(DESTDIR)/$(MANAGERTEMPLATESDIR)
2014-04-18 12:17:08 +02:00
DOCDIR=$(DOCUMENTROOT)
RDOCDIR=$(DESTDIR)/$(DOCDIR)
2014-04-18 12:17:08 +02:00
DEFDOCDIR=$(DOCUMENTROOT)/doc
RDEFDOCDIR=$(DESTDIR)/$(DEFDOCDIR)
FRDOCDIR=$(DOCUMENTROOT)/fr-doc
TESTDIR=$(DOCUMENTROOT)/test
RTESTDIR=$(DESTDIR)/$(TESTDIR)
EXAMPLESDIR=$(LMPREFIX)/examples
REXAMPLESDIR=$(DESTDIR)/$(EXAMPLESDIR)
TOOLSDIR=$(LMPREFIX)/tools
RTOOLSDIR=$(DESTDIR)/$(TOOLSDIR)
# Handler dir
HANDLERDIR=$(LMPREFIX)/handler
RHANDLERDIR=$(DESTDIR)/$(HANDLERDIR)
# Configuration dir
CONFDIR=$(LMPREFIX)/etc
RCONFDIR=$(DESTDIR)/$(CONFDIR)
CRONDIR=$(LMPREFIX)/etc/cron.d
RCRONDIR=$(DESTDIR)/$(CRONDIR)
CONFFILENAME=lemonldap-ng.ini
STORAGECONFFILE=$(CONFDIR)/$(CONFFILENAME)
# LL::NG configuration storage dir
FILECONFIGDIR=$(DATADIR)/conf
RFILECONFIGDIR=$(DESTDIR)/$(FILECONFIGDIR)
# LL::NG sessions storage dir
APACHESESSIONFILEDIR=$(DATADIR)/sessions
RAPACHESESSIONFILEDIR=$(DESTDIR)/$(APACHESESSIONFILEDIR)
APACHESESSIONFILELOCKDIR=$(APACHESESSIONFILEDIR)/lock
RAPACHESESSIONFILELOCKDIR=$(DESTDIR)/$(APACHESESSIONFILELOCKDIR)
# LL::NG persistent sessions storage dir
APACHEPSESSIONFILEDIR=$(DATADIR)/psessions
RAPACHEPSESSIONFILEDIR=$(DESTDIR)/$(APACHEPSESSIONFILEDIR)
APACHEPSESSIONFILELOCKDIR=$(APACHEPSESSIONFILEDIR)/lock
RAPACHEPSESSIONFILELOCKDIR=$(DESTDIR)/$(APACHEPSESSIONFILELOCKDIR)
# LL::NG notifications storage dir
2012-08-31 09:48:54 +02:00
APACHEFILENOTIFDIR=$(DATADIR)/notifications
RFILENOTIFDIR=$(DESTDIR)/$(APACHEFILENOTIFDIR)
2014-12-19 10:07:29 +01:00
# LL::NG captcha dir
CAPTCHADIR=$(DATADIR)/captcha
RCAPTCHADIR=$(DESTDIR)/$(CAPTCHADIR)
# Apache user/group
APACHEUSER=
APACHEGROUP=
# Apache version
2015-06-17 13:35:23 +02:00
APACHEVERSION=2.X
# DNS Domain for cookie and virtual hosts
DNSDOMAIN=example.com
# Virtual Host Listen IP and Port (*, *:80, ...)
VHOSTLISTEN=*:80
WEBSERVERPORT=19876
# Other
SRCCOMMONDIR=lemonldap-ng-common
SRCHANDLERDIR=lemonldap-ng-handler
SRCPORTALDIR=lemonldap-ng-portal
SRCMANAGERDIR=lemonldap-ng-manager
VERSION=`head -n1 changelog |sed -e 's/lemonldap-ng (//' -e 's/).*$$//'`
PORTALSKINS=`ls $(SRCPORTALDIR)/example/skins/`
DIFF=diff -aurN -x '*.tpl' -x '*.bak' -x .svn -x '*.map' -x '*.min.js' -x '*.min.css' -x '*.swp' --ignore-matching-lines='.*jquery.*' --ignore-matching-lines='.*lemonldap-ng\.ini.*'
DIFFPREFIX=
EXAMPLELANG=en # For static Manager example only
2009-06-02 15:48:48 +02:00
ERASECONFIG=1 # Set to 0 if you do not want to replace your configuration
# GENERATED SRC FILESlemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm
MANAGERJSONSRC= scripts/jsongenerator.pl \
2015-12-27 23:17:20 +01:00
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build.pm \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build/Attributes.pm \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build/Tree.pm \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Conf/Zero.pm
MANAGERJSONDST=$(SRCMANAGERDIR)/site/static/struct.json \
$(SRCMANAGERDIR)/site/static/js/conftree.js \
2015-12-27 08:19:10 +01:00
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Attributes.pm \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Constants.pm \
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm \
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/Constants.pm \
_example/conf/lmConf-1.js
# Javascript and CSS to minify
2016-01-21 12:36:14 +01:00
JSSRCFILES:=$(shell find $(SRCMANAGERDIR)/site/static/js $(SRCPORTALDIR)/example -type f -name '*.js' ! -name '*.min.js')
CSSSRCFILES:=$(shell find $(SRCMANAGERDIR)/site/static/css $(SRCPORTALDIR)/example -type f -name '*.css' ! -name '*.min.css')
# Minified files
JSDSTFILES=$(JSSRCFILES:.js=.min.js)
CSSDSTFILES=$(CSSSRCFILES:.css=.min.css)
all: configure common handler manager portal
@echo
@echo "Building succeed. Now run :"
@echo " - make test to verify your installation"
@echo " - make install to install all"
@echo
@echo 'Other targets :'
@echo " * Partial build :"
@echo " - portal, manager, handler"
@echo " * Doxygen documentation"
@echo " - doxygen (to build Doxygen documentation in doc/devel/)"
@echo
@echo 'Other targets launched by "make install" :'
@echo " * Perl libraries install :"
@echo " - install_libs (all Perl libraries)"
@echo " - install_portal_libs"
@echo " - install_manager_libs"
@echo " - install_handler_libs"
@echo " * Binaries install :"
@echo " - install_bin ($(BINDIR))"
@echo " * Web sites install :"
@echo " - install_site (all sites including install_doc_site)"
@echo " - install_portal_site ($(PORTALDIR))"
@echo " - install_manager_site ($(MANAGERDIR))"
@echo " - install_handler_site ($(HANDLERDIR))"
@echo " * Documentation install :"
2014-04-18 12:17:08 +02:00
@echo " - install_doc_site ($(DEFDOCDIR))"
@echo " - install_examples_site ($(EXAMPLESDIR))"
@echo
2013-11-14 06:28:20 +01:00
@echo "Other languages documentation (fr only for now)"
@echo " - fr-doc (needs OmegaT)"
@echo " - install_fr_doc_site"
2013-11-14 06:28:20 +01:00
@echo
2016-01-18 21:26:29 +01:00
#
# Minification
#
minify: $(JSDSTFILES) $(CSSDSTFILES)
%.min.css: %.css
2016-01-21 12:35:48 +01:00
@echo "Compressing $*.css"
@yui-compressor $*.css > $*.min.css
%.min.js: %.js
2016-01-21 12:35:48 +01:00
@echo "Compressing $*.js"
@yui-compressor $*.js > $*.min.js
2016-01-18 21:26:29 +01:00
#
# Perl libraries configuration
#
2010-01-23 13:48:18 +01:00
json: $(MANAGERJSONDST)
2016-01-20 22:48:06 +01:00
-$(MAKE) minify
2015-12-10 21:05:27 +01:00
$(MANAGERJSONDST): $(MANAGERJSONSRC)
./scripts/jsongenerator.pl
2015-12-10 21:05:27 +01:00
2015-12-28 06:29:34 +01:00
configure: json common_conf handler_conf portal_conf manager_conf
common_conf: ${SRCCOMMONDIR}/Makefile
handler_conf: ${SRCHANDLERDIR}/Makefile
portal_conf: ${SRCPORTALDIR}/Makefile
manager_conf: ${SRCMANAGERDIR}/Makefile
${SRCCOMMONDIR}/Makefile:
@cd ${SRCCOMMONDIR}; LMNGCONFFILE=$(STORAGECONFFILE) $(PERL) Makefile.PL $(PERLOPTIONS)
${SRCHANDLERDIR}/Makefile:
@cd ${SRCHANDLERDIR}; $(PERL) Makefile.PL $(PERLOPTIONS)
${SRCPORTALDIR}/Makefile:
@cd ${SRCPORTALDIR}; $(PERL) Makefile.PL $(PERLOPTIONS)
${SRCMANAGERDIR}/Makefile:
@cd ${SRCMANAGERDIR}; $(PERL) Makefile.PL $(PERLOPTIONS)
#
# Perl libraries make
#
common: common_conf
@$(MAKE) -C ${SRCCOMMONDIR}
handler: handler_conf
@$(MAKE) -C ${SRCHANDLERDIR}
portal: portal_conf
@$(MAKE) -C ${SRCPORTALDIR}
manager: manager_conf
$(MAKE) -C ${SRCMANAGERDIR}
2010-10-29 00:30:57 +02:00
test: all common_test handler_test portal_test manager_test extra_test
common_test: common
@$(MAKE) -C ${SRCCOMMONDIR} test
2015-06-17 14:00:12 +02:00
handler_test: handler
@$(MAKE) -C ${SRCHANDLERDIR} test FULLPERL="$(PERL) -I../${SRCCOMMONDIR}/blib/lib/"
2015-06-17 14:00:12 +02:00
portal_test: portal
@$(MAKE) -C ${SRCPORTALDIR} test FULLPERL="$(PERL) -I../${SRCCOMMONDIR}/blib/lib/ -I../${SRCHANDLERDIR}/blib/lib/"
2015-06-17 14:00:12 +02:00
manager_test: manager
@$(MAKE) -C ${SRCMANAGERDIR} test FULLPERL="$(PERL) -I../${SRCCOMMONDIR}/blib/lib/ -I../${SRCHANDLERDIR}/blib/lib/"
2010-10-29 00:30:57 +02:00
extra_test: all
cd ${SRCPORTALDIR} && prove -b -I ../$(SRCCOMMONDIR)/blib/lib -I ../$(SRCHANDLERDIR)/blib/lib -I../${SRCPORTALDIR}/blib/lib/ xt
# PERL_DL_NONLAZY=1 $(PERL) "-MExtUtils::Command::MM" "-e" "test_harness(0, 'lemonldap-ng-common/blib/lib', 'lemonldap-ng-handler/blib/lib', 'lemonldap-ng-manager/blib/lib', 'lemonldap-ng-portal/blib/lib')" extra-tests/*.t
2010-10-28 23:40:38 +02:00
e2e_test: all prepare_test_server start_web_server launch_protractor stop_web_server
prepare_test_server:
@mkdir -p e2e-tests/conf/lock e2e-tests/conf/persistents/lock
2015-12-16 21:44:24 +01:00
@$(MAKE) install_webserver_conf \
RCONFDIR=e2e-tests/conf \
ERASECONFIG=1 \
VHOSTLISTEN='*:$(WEBSERVERPORT)' \
PORTALDIR=`pwd`/$(SRCPORTALDIR)/example \
MANAGERDIR=`pwd`/$(SRCMANAGERDIR)/site \
MANAGERPSGIDIR=`pwd`/e2e-tests \
DEFDOCDIR=`pwd`/doc \
FRDOCDIR=`pwd`/po-doc/fr
2015-12-16 21:44:24 +01:00
@cp e2e-tests/lmConf-1.js e2e-tests/lemonldap-ng.ini e2e-tests/env.conf e2e-tests/conf/
@perl -i -pe 'BEGIN{$$p=`pwd`;chomp $$p}s#__pwd__#$$p#;s/__port__/$(WEBSERVERPORT)/' e2e-tests/conf/lemonldap-ng.ini e2e-tests/conf/lmConf-1.js e2e-tests/conf/env.conf
2015-12-14 23:24:09 +01:00
e2e-tests/conf/apache2.pid: start_web_server
start_web_server: all prepare_test_server
2015-12-16 21:44:24 +01:00
# Clean old server if launched
-@[ -e e2e-tests/conf/apache2.pid ] && kill `cat e2e-tests/conf/apache2.pid` && sleep 1
# Start web server (designed for Debian, path may be broken else)
@LLNG_DEFAULTCONFFILE=`pwd`/e2e-tests/conf/lemonldap-ng.ini /usr/sbin/apache2 -d `pwd`/e2e-tests -f apache2.conf -k start
2015-12-15 20:05:50 +01:00
reload_web_server:
2015-12-14 06:50:27 +01:00
@if [ -e e2e-tests/conf/apache2.pid ]; then \
LLNG_DEFAULTCONFFILE=`pwd`/e2e-tests/conf/lemonldap-ng.ini /usr/sbin/apache2 -d `pwd`/e2e-tests -f apache2.conf -k graceful; \
else \
$(MAKE) start_web_server; \
fi
2015-12-14 23:24:09 +01:00
launch_protractor: all e2e-tests/conf/apache2.pid
# Start e2e tests
2015-12-13 08:25:39 +01:00
# NB: you must have protractor installed (using npm install -g protractor)
2015-12-16 21:44:24 +01:00
# and have run update-webdriver at least once and have a node.js > 4.0
@WEBSERVERPORT=$(WEBSERVERPORT) protractor e2e-tests/protractor-conf.js
stop_web_server:
# Stop web server
2015-12-14 23:24:09 +01:00
-@ [ -e e2e-tests/conf/apache2.pid ] && kill `cat e2e-tests/conf/apache2.pid`
# Clean
@rm -rf e2e-tests/conf
restart_web_server: start_web_server
#
# INSTALL
#
install: install_libs install_bin install_site
#
# Perl libraires install
#
install_libs: common_install_libs install_handler_libs install_portal_libs install_manager_libs
common_install_libs: common
@$(MAKE) -C ${SRCCOMMONDIR} install
install_handler_libs: handler
@$(MAKE) -C ${SRCHANDLERDIR} install
install_portal_libs: portal
@$(MAKE) -C ${SRCPORTALDIR} install
install_manager_libs: manager
@$(MAKE) -C ${SRCMANAGERDIR} install
example:
2010-01-08 07:41:37 +01:00
$(MAKE) install_site install_bin LMPREFIX=$(EXAMPLEROOT)
2010-01-08 07:41:37 +01:00
install_bin: install_conf_dir
# Binary install
@install -v -d $(RBINDIR)
2015-03-16 06:43:50 +01:00
@cp -f\
${SRCHANDLERDIR}/example/scripts/purgeLocalCache \
${SRCPORTALDIR}/example/scripts/purgeCentralCache \
${SRCPORTALDIR}/example/scripts/buildPortalWSDL \
2009-12-15 17:31:13 +01:00
${SRCCOMMONDIR}/scripts/convertConfig \
${SRCCOMMONDIR}/scripts/lmMigrateConfFiles2ini \
2015-06-05 16:33:36 +02:00
${SRCCOMMONDIR}/scripts/rotateOidcKeys \
2015-05-14 08:45:03 +02:00
${SRCMANAGERDIR}/scripts/lmConfigEditor \
${SRCMANAGERDIR}/scripts/lemonldap-ng-cli \
$(RBINDIR)
@if [ ! "$(APACHEUSER)" ]; then \
$(PERL) -i -pe 's#__APACHEUSER__#nobody#g;' $(RBINDIR)/lmConfigEditor; \
$(PERL) -i -pe 's#__APACHEUSER__#nobody#g;' $(RBINDIR)/lemonldap-ng-cli; \
else \
$(PERL) -i -pe 's#__APACHEUSER__#$(APACHEUSER)#g;' $(RBINDIR)/lmConfigEditor; \
$(PERL) -i -pe 's#__APACHEUSER__#$(APACHEUSER)#g;' $(RBINDIR)/lemonldap-ng-cli; \
fi
@if [ ! "$(APACHEGROUP)" ]; then \
$(PERL) -i -pe 's#__APACHEGROUP__#nobody#g;' $(RBINDIR)/lmConfigEditor; \
$(PERL) -i -pe 's#__APACHEGROUP__#nobody#g;' $(RBINDIR)/lemonldap-ng-cli; \
else \
$(PERL) -i -pe 's#__APACHEGROUP__#$(APACHEGROUP)#g;' $(RBINDIR)/lmConfigEditor; \
$(PERL) -i -pe 's#__APACHEGROUP__#$(APACHEGROUP)#g;' $(RBINDIR)/lemonldap-ng-cli; \
fi
2010-10-30 17:22:14 +02:00
@chmod +x $(RBINDIR)/*
#
# SITE INSTALL
#
install_site: install_manager_site install_portal_site install_handler_site install_test_site install_examples_site install_doc_site install_webserver_conf
# Site install
@install -v -d $(RCONFDIR)
2009-06-02 15:48:48 +02:00
# Check if erase is wanted
@if [ "$(ERASECONFIG)" -eq "1" ]; then \
2015-03-16 06:43:50 +01:00
cp -f _example/etc/for_etc_hosts $(RCONFDIR); \
fi
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)/for_etc_hosts
# Fix a lost of rights on the main directory
2015-05-14 08:45:03 +02:00
@chmod 755 $(RBINDIR) $(RDOCUMENTROOT) $(REXAMPLESDIR) $(RHANDLERDIR) $(RPORTALSKINSDIR) $(RMANAGERSITEDIR) $(RTOOLSDIR) $(RCONFDIR) $(RDATADIR)
@echo
2008-12-25 19:48:50 +01:00
@echo "LemonLDAP::NG v${VERSION} is installed with these parameters:"
@echo " - System configuration: ${CONFDIR}"
@echo " - DNS domain (for cookies and virtual hosts): ${DNSDOMAIN}"
@echo
@echo "To finish configuration:"
@echo
@echo "1 - Add this in your Apache $(APACHEVERSION) configuration file:"
@echo " include ${CONFDIR}/portal-apache$(APACHEVERSION).conf"
@echo " include ${CONFDIR}/handler-apache$(APACHEVERSION).conf"
@echo " include ${CONFDIR}/manager-apache$(APACHEVERSION).conf"
@echo " include ${CONFDIR}/test-apache$(APACHEVERSION).conf"
@echo
@echo "2 - Restart Apache:"
@echo " apache$(APACHEVERSION)ctl restart"
@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 - Try to connect to http://test1.${DNSDOMAIN}/ or http://test2.${DNSDOMAIN}/ with demonstration accounts:"
@echo " - rtyler/rtyler"
@echo " - msmith/msmith"
@echo " - dwho/dwho"
@echo
@echo "5 - Connect to Manager at http://manager.${DNSDOMAIN}/ to edit configuration"
@echo
@if [ ! "$(APACHEUSER)" ]; then \
2014-12-19 10:07:29 +01:00
echo;echo " Warning, since APACHEUSER was not set, $(APACHESESSIONFILEDIR), $(APACHEPSESSIONFILEDIR), $(CAPTCHADIR) and $(CONFDIR) have permissive permissions."; \
echo " Fix them by yourself to restrict their view to apache process only"; \
fi
@echo
install_webserver_conf:
@install -m 755 -v -d $(RCONFDIR)
@if [ "$(ERASECONFIG)" -eq "1" ]; then \
cp -f _example/etc/portal-apache$(APACHEVERSION).conf $(RCONFDIR); \
cp -f _example/etc/handler-apache$(APACHEVERSION).conf $(RCONFDIR); \
cp -f _example/etc/manager-apache$(APACHEVERSION).conf $(RCONFDIR); \
cp -f _example/etc/test-apache$(APACHEVERSION).conf $(RCONFDIR); \
cp -f _example/etc/handler-nginx.conf $(RCONFDIR); \
cp -f _example/etc/test-nginx.conf $(RCONFDIR); \
cp -f _example/etc/nginx-access-control $(RCONFDIR); \
cp -f _example/etc/nginx-http-accounting $(RCONFDIR); \
cp -f _example/etc/nginx-fcgi-accounting $(RCONFDIR); \
fi
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g; \
s#__PORTALDIR__#$(PORTALDIR)/#g; \
s#__MANAGERDIR__#$(MANAGERDIR)/#g; \
s#__MANAGERSTATICDIR__#$(MANAGERSTATICDIR)/#g; \
s#__MANAGERPSGIDIR__#$(MANAGERPSGIDIR)/#g; \
s#__TESTDIR__#$(TESTDIR)/#g; \
s#__VHOSTLISTEN__#$(VHOSTLISTEN)#g; \
s#__DEFDOCDIR__#$(DEFDOCDIR)/#g; \
s#__FRDOCDIR__#$(FRDOCDIR)/#g;' $(RCONFDIR)/*apache*.conf $(RCONFDIR)/*nginx*.conf
install_manager_site: install_conf_dir
# Manager install
@install -v -d ${RMANAGERDIR} $(RMANAGERSTATICDIR) $(RMANAGERPSGIDIR) \
$(RMANAGERTEMPLATESDIR)
@cp -pR $(SRCMANAGERDIR)/site/static/* $(RMANAGERSTATICDIR)
@for f in $(SRCMANAGERDIR)/site/templates/*.tpl; do \
./scripts/transform-templates jsminified $(JSCOMPRESS) cssminified $(CSSCOMPRESS) <$$f \
> $(RMANAGERTEMPLATESDIR)/`basename $$f`; \
done
@cp -pR $(SRCMANAGERDIR)/eg/* $(RMANAGERPSGIDIR)
# Clean svn files
@rm -rf $$(find ${RMANAGERDIR} ${RMANAGERSTATICDIR} $(RMANAGERPSGIDIR) \
$(RMANAGERTEMPLATESDIR) $(RCONFDIR) -type d -name .svn)
2015-06-10 22:40:29 +02:00
$(PERL) -i -pe 's#__MANAGERSTATICDIR__#$(MANAGERRELATIVESTATICDIR)#g' $(RCONFDIR)/$(CONFFILENAME)
$(PERL) -i -pe 's#__MANAGERTEMPLATESDIR__#$(MANAGERTEMPLATESDIR)#g' $(RCONFDIR)/$(CONFFILENAME)
install_portal_site: install_conf_dir
# Portal install
@install -v -d $(RPORTALDIR) $(RPORTALSKINSDIR) \
$(RPORTALDIR)/skins/ \
$(RCRONDIR) $(RCONFDIR)
@for skin in $$(ls $(SRCPORTALDIR)/example/skins/); do \
[ -h $(RPORTALDIR)/skins/$$skin ] && rm -f $(RPORTALDIR)/skins/$$skin; \
install -v -d $(RPORTALSKINSDIR)/$$skin; \
done
2015-03-16 06:43:50 +01:00
@cp -pR -f ${SRCPORTALDIR}/example/index_skin.pl ${RPORTALDIR}/index.pl
@cp -pR -f ${SRCPORTALDIR}/example/mail.pl ${RPORTALDIR}
@cp -pR -f ${SRCPORTALDIR}/example/metadata.pl ${RPORTALDIR}
2015-03-23 18:12:06 +01:00
@cp -pR -f ${SRCPORTALDIR}/example/openid-configuration.pl ${RPORTALDIR}
2015-03-16 06:43:50 +01:00
@cp -pR -f ${SRCPORTALDIR}/example/cdc.pl ${RPORTALDIR}
@cp -pR -f ${SRCPORTALDIR}/example/register.pl ${RPORTALDIR}
2010-10-30 17:22:14 +02:00
@tar -cf - -C ${SRCPORTALDIR}/example/skins/ $$(ls ${SRCPORTALDIR}/example/skins/) |tar -xf - -C $(RPORTALSKINSDIR)
2016-01-18 13:13:16 +01:00
@for f in `find $(RPORTALSKINSDIR) -type f -name '*.tpl'`; do \
./scripts/transform-templates jsminified $(JSCOMPRESS) cssminified $(CSSCOMPRESS) <$$f >$$f.tmp; \
mv -f $$f.tmp $$f; \
done
@if [ "$(PORTALDIR)/skins/" != "$(PORTALSKINSDIR)/" ]; then \
for skin in $$(ls $(SRCPORTALDIR)/example/skins/); do \
rm -rf $(RPORTALDIR)/skins/$$skin/; \
ln -s $(PORTALSKINSDIR)/$$skin $(RPORTALDIR)/skins/$$skin; \
done; \
fi
# Cron files
@cp -f $(SRCPORTALDIR)/example/scripts/purgeCentralCache.cron.d $(RCRONDIR)/lemonldap-ng-portal
2009-06-22 16:19:06 +02:00
@if [ ! "$(APACHEUSER)" ]; then \
$(PERL) -i -pe 's#__APACHEUSER__#nobody#g;' $(RCRONDIR)/lemonldap-ng-portal; \
2009-06-22 16:19:06 +02:00
else \
$(PERL) -i -pe 's#__APACHEUSER__#$(APACHEUSER)#g;' $(RCRONDIR)/lemonldap-ng-portal; \
2009-06-22 16:19:06 +02:00
fi
@$(PERL) -i -pe 's#__BINDIR__#$(BINDIR)#g;' $(RCRONDIR)/lemonldap-ng-portal
# Clean SVN files
@rm -rf $$(find ${RPORTALDIR} $(RPORTALSKINSDIR) $(RCRONDIR) $(RCONFDIR) -type d -name .svn)
install_handler_site: install_conf_dir
# Handler install
@install -v -d ${RHANDLERDIR}
@cp -f $(SRCHANDLERDIR)/example/scripts/purgeLocalCache.cron.d $(RCRONDIR)/lemonldap-ng-handler
@if [ ! "$(APACHEUSER)" ]; then \
$(PERL) -i -pe 's#__APACHEUSER__#nobody#g;' $(RCRONDIR)/lemonldap-ng-handler; \
else \
$(PERL) -i -pe 's#__APACHEUSER__#$(APACHEUSER)#g;' $(RCRONDIR)/lemonldap-ng-handler; \
fi
@$(PERL) -i -pe 's#__BINDIR__#$(BINDIR)#g;' $(RCRONDIR)/lemonldap-ng-handler
@rm -rf $$(find $(RHANDLERDIR) -type d -name .svn)
install_test_site:
# Test site install
@install -v -d $(RTESTDIR)
2015-03-16 06:43:50 +01:00
@cp -pR -f _example/test/* $(RTESTDIR)
@rm -rf $$(find $(RTESTDIR) -type d -name .svn)
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RTESTDIR)/index.pl
@rm -rf $$(find $(RTESTDIR) -type d -name .svn)
install_examples_site:
# Examples install
@install -v -d $(REXAMPLESDIR)
@for i in manager portal handler; do \
2015-03-16 06:43:50 +01:00
cp -a -f lemonldap-ng-$$i/example $(REXAMPLESDIR)/$$i; \
done
@rm -rf $(REXAMPLESDIR)/portal/skins \
2009-12-11 19:17:00 +01:00
$(REXAMPLESDIR)/manager/skins \
@rm -rf $$(find $(REXAMPLESDIR) -type d -name .svn)
@$(PERL) -i -pe 's#__SESSIONDIR__#$(APACHESESSIONFILEDIR)/#g;' $(REXAMPLESDIR)/portal/*.pl
@$(PERL) -i -pe 's#__PSESSIONDIR__#$(APACHEPSESSIONFILEDIR)/#g;' $(REXAMPLESDIR)/portal/*.pl
install_doc_site:
# Offline documentation install
2014-04-18 12:17:08 +02:00
@rm -rf $(RDEFDOCDIR)
@install -v -d $(RDEFDOCDIR)
2015-03-16 06:43:50 +01:00
@cp -a -f doc/* $(RDEFDOCDIR)
install_conf_dir: install_sessions_dir install_notif_dir install_captcha_dir
# Configuration files install
@install -v -d $(RCONFDIR) $(RFILECONFIGDIR) $(RTOOLSDIR)
2009-06-02 15:48:48 +02:00
@if [ "$(ERASECONFIG)" -eq "1" ]; then \
2015-03-16 06:43:50 +01:00
cp -f $(SRCCOMMONDIR)/$(CONFFILENAME) $(RCONFDIR); \
$(PERL) -i -pe 's#^dirName\s*=\s*.*#dirName = $(FILECONFIGDIR)#g' $(RCONFDIR)/$(CONFFILENAME); \
2009-06-02 15:48:48 +02:00
fi
@cp _example/conf/lmConf-1.js $(RFILECONFIGDIR)
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g;\
2012-08-31 09:48:54 +02:00
s#__SESSIONDIR__#$(APACHESESSIONFILEDIR)#g;\
s#__PSESSIONDIR__#$(APACHEPSESSIONFILEDIR)#g;\
s#__NOTIFICATIONDIR__#$(APACHEFILENOTIFDIR)#g;' $(RFILECONFIGDIR)/lmConf-1.js
@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 $(SRCCOMMONDIR)/tools/lmConfig.* $(SRCCOMMONDIR)/tools/apache-session-mysql.sql $(RTOOLSDIR)
@cp $(SRCCOMMONDIR)/tools/sso.schema $(RTOOLSDIR)
$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)/$(CONFFILENAME)
@rm -rf $$(find $(RCONFDIR) $(RFILECONFIGDIR) $(RTOOLSDIR) -type d -name .svn)
install_sessions_dir:
@install -m 777 -v -d $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR) $(RAPACHEPSESSIONFILEDIR) $(RAPACHEPSESSIONFILELOCKDIR)
# Fix Apache::Session directories permissions
@if [ "$(APACHEUSER)" != "" ]; then \
chown $(APACHEUSER) $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR) $(RAPACHEPSESSIONFILEDIR) $(RAPACHEPSESSIONFILELOCKDIR) || exit 1; \
if [ "$(APACHEGROUP)" != "" ]; then \
chgrp $(APACHEGROUP) $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR) $(RAPACHEPSESSIONFILEDIR) $(RAPACHEPSESSIONFILELOCKDIR) || exit 1; \
fi; \
chmod 770 $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR) $(RAPACHEPSESSIONFILEDIR) $(RAPACHEPSESSIONFILELOCKDIR); \
else \
chmod 777 $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR) $(RAPACHEPSESSIONFILEDIR) $(RAPACHEPSESSIONFILELOCKDIR); \
fi
install_notif_dir:
@install -m 777 -v -d $(RFILENOTIFDIR)
# Fix notifications directory permissions
@if [ "$(APACHEUSER)" != "" ]; then \
chown $(APACHEUSER) $(RFILENOTIFDIR) || exit 1; \
if [ "$(APACHEGROUP)" != "" ]; then \
chgrp $(APACHEGROUP) $(RFILENOTIFDIR) || exit 1; \
fi; \
chmod 770 $(RFILENOTIFDIR); \
else \
chmod 777 $(RFILENOTIFDIR); \
fi
install_captcha_dir:
2014-12-19 10:07:29 +01:00
@install -m 777 -v -d $(RCAPTCHADIR)
# Fix captcha directory permissions
@if [ "$(APACHEUSER)" != "" ]; then \
2014-12-19 10:07:29 +01:00
chown $(APACHEUSER) $(RCAPTCHADIR) || exit 1; \
if [ "$(APACHEGROUP)" != "" ]; then \
2014-12-19 10:07:29 +01:00
chgrp $(APACHEGROUP) $(RCAPTCHADIR) || exit 1; \
fi; \
2014-12-19 10:07:29 +01:00
chmod 770 $(RCAPTCHADIR); \
else \
2014-12-19 10:07:29 +01:00
chmod 777 $(RCAPTCHADIR); \
fi
postconf_hosts:
2010-11-03 16:27:10 +01:00
@cat ${CONFDIR}/for_etc_hosts >> /etc/hosts
@echo "/etc/hosts was updated"
postconf: postconf_hosts
@echo "Post configuration done"
uninstall: configure handler_uninstall portal_uninstall manager_uninstall
common_uninstall: common
@$(MAKE) -C ${SRCCOMMONDIR} uninstall
@rm -vf common_uninstall
handler_uninstall: handler
@$(MAKE) -C ${SRCHANDLERDIR} uninstall
@rm -vf handler_uninstall
portal_uninstall: portal
@$(MAKE) -C ${SRCPORTALDIR} uninstall
@rm -vf portal_uninstall
manager_uninstall: manager
@$(MAKE) -C ${SRCMANAGERDIR} uninstall
@rm -vf manager_uninstall
dist: clean
@mkdir -p lemonldap-ng-$(VERSION)
@cp -pRH $$(find * -maxdepth 0|grep -v -e "\(lemonldap-ng-$(VERSION)\|debian\|rpm\)") lemonldap-ng-$(VERSION)
@rm -rf $$(find lemonldap-ng-$(VERSION) -name .svn -print)
@rm -rf lemonldap-ng-$(VERSION)/po-doc/fr/*
@find $$dir -name '*.bak' -delete
@rm -rf lemonldap-ng-$(VERSION)/lemonldap-ng-$(VERSION)
@$(COMPRESS) lemonldap-ng-$(VERSION).$(COMPRESSSUFFIX) lemonldap-ng-$(VERSION)
@rm -rf lemonldap-ng-$(VERSION)
rpm-dist: clean
@mkdir -p lemonldap-ng-$(VERSION)
2013-11-10 06:58:26 +01:00
@cp -pRH $$(find * -maxdepth 0|grep -v -e "\(lemonldap-ng-$(VERSION)\|debian\)") lemonldap-ng-$(VERSION)
@rm -rf $$(find lemonldap-ng-$(VERSION) -name .svn -print)
@find $$dir -name '*.bak' -delete
@rm -rf lemonldap-ng-$(VERSION)/lemonldap-ng-$(VERSION)
2010-01-08 07:41:37 +01:00
@$(COMPRESS) lemonldap-ng-$(VERSION).$(COMPRESSSUFFIX) lemonldap-ng-$(VERSION)
@rm -rf lemonldap-ng-$(VERSION)
debian-dist: clean
@mkdir -p lemonldap-ng-$(VERSION)
@cp -pRH $$(find * -maxdepth 0|grep -v -e "\(lemonldap-ng-$(VERSION)\|rpm\)") lemonldap-ng-$(VERSION)
@rm -rf $$(find lemonldap-ng-$(VERSION) -name .svn -print)
@find $$dir -name '*.bak' -delete
@cp lemonldap-ng-$(VERSION)/_example/etc/handler-apache2.X.conf lemonldap-ng-$(VERSION)/_example/etc/handler-apache2.conf
@cp lemonldap-ng-$(VERSION)/_example/etc/manager-apache2.X.conf lemonldap-ng-$(VERSION)/_example/etc/manager-apache2.conf
@cp lemonldap-ng-$(VERSION)/_example/etc/portal-apache2.X.conf lemonldap-ng-$(VERSION)/_example/etc/portal-apache2.conf
@cp lemonldap-ng-$(VERSION)/_example/etc/test-apache2.X.conf lemonldap-ng-$(VERSION)/_example/etc/test-apache2.conf
@rm -rf lemonldap-ng-$(VERSION)/lemonldap-ng-$(VERSION)
@$(COMPRESS) lemonldap-ng_$(VERSION).orig.$(COMPRESSSUFFIX) lemonldap-ng-$(VERSION)
@rm -rf lemonldap-ng-$(VERSION)
2010-01-08 07:41:37 +01:00
zip-dist:
$(MAKE) dist "COMPRESS=zip -r" COMPRESSSUFFIX=zip
2010-01-23 13:48:18 +01:00
manifest: configure
@for i in ${SRCCOMMONDIR} ${SRCHANDLERDIR} ${SRCPORTALDIR} ${SRCMANAGERDIR}; do \
cd $$i; \
make manifest; \
rm -vf MANIFEST.*; \
cd -; \
done
cpan: clean configure common_cpan handler_cpan portal_cpan manager_cpan
2010-11-22 14:36:16 +01:00
for i in Common Portal Handler Manager; do \
2010-01-08 07:41:37 +01:00
$(UNCOMPRESS) Lemonldap-NG-$$i-*.$(COMPRESSSUFFIX) \
2010-11-22 14:36:16 +01:00
$$($(LISTCOMPRESSED) Lemonldap-NG-$$i-*.$(COMPRESSSUFFIX) |grep META.yml); \
mv Lemonldap-NG-$$i-*/META.yml lemonldap-ng-$$($(PERL) -e "print lc('$$i')")/; \
2010-02-21 15:00:53 +01:00
rm -rf Lemonldap-NG-$$i*/; \
2009-02-19 09:26:22 +01:00
done
common_cpan: common_conf
@$(MAKE) -C ${SRCCOMMONDIR} dist
@mv ${SRCCOMMONDIR}/Lemonldap*.gz .
handler_cpan: handler_conf
@$(MAKE) -C ${SRCHANDLERDIR} dist
@mv ${SRCHANDLERDIR}/Lemonldap*.gz .
portal_cpan: portal_conf
@$(MAKE) -C ${SRCPORTALDIR} dist
@mv ${SRCPORTALDIR}/Lemonldap*.gz .
manager_cpan: manager_conf
@$(MAKE) -C ${SRCMANAGERDIR} dist
@mv ${SRCMANAGERDIR}/Lemonldap*.gz .
documentation:
@cd doc/ && ../scripts/doc.pl
doxygen: clean
$(PERL) -i -pe 's/^(PROJECT_NUMBER\s*=\s*)\d.*$$/$${1}'$(VERSION)'/' Doxyfile
COLLABORATIVE_GRAPH=1 doxygen Doxyfile
mkdir doc/devel/tmp
mv doc/devel/html/inherit* doc/devel/tmp/
COLLABORATIVE_GRAPH=0 doxygen Doxyfile
mv -f doc/devel/tmp/* doc/devel/html/
rm -rf doc/devel/tmp
$(PERL) -i -pe 's/Graphical Class Hierarchy/Class Collaboration Graph/' doc/devel/html/inherits.html doc/devel/html/tree.html
# Some files are not generated
for i in doc/devel/html/*dot; do dot -T png -o $${i/.dot/.png} $$i; rm -f $$i; done
distclean: clean
2015-12-14 23:24:09 +01:00
clean: common_clean handler_clean portal_clean manager_clean omegat-clean omegat-fr-clean stop_web_server
2009-11-07 14:05:50 +01:00
@rm -f $$(find */ -name '*bak' -delete)
@rm -rf $(EXAMPLEROOT) example/ doc/devel
2010-01-08 07:41:37 +01:00
@rm -vf *gz *zip
2010-10-07 13:05:36 +02:00
@rm -rf lemonldap-ng-$(VERSION)
2010-01-08 07:41:37 +01:00
@echo "Cleaned"
common_clean:
2010-01-08 07:41:37 +01:00
@if test -e ${SRCCOMMONDIR}/Makefile;then $(MAKE) -C ${SRCCOMMONDIR} distclean;fi
@rm -vf common*
handler_clean:
2010-01-08 07:41:37 +01:00
@if test -e ${SRCHANDLERDIR}/Makefile;then $(MAKE) -C ${SRCHANDLERDIR} distclean;fi
@rm -vf handler*
portal_clean:
2010-01-08 07:41:37 +01:00
@if test -e ${SRCPORTALDIR}/Makefile;then $(MAKE) -C ${SRCPORTALDIR} distclean;fi
@rm -vf portal*
manager_clean:
2010-01-08 07:41:37 +01:00
@if test -e ${SRCMANAGERDIR}/Makefile;then $(MAKE) -C ${SRCMANAGERDIR} distclean;fi
@rm -vf manager*
debian-local-packages: debian-dist
2010-01-08 07:41:37 +01:00
mv lemonldap-ng_$(VERSION).orig.$(COMPRESSSUFFIX) /tmp/
version=$(VERSION) && \
cd /tmp/ && \
2009-12-03 11:08:33 +01:00
rm -rf lemonldap-ng-$$version && \
2010-01-08 07:41:37 +01:00
$(UNCOMPRESS) lemonldap-ng_$$version.orig.$(COMPRESSSUFFIX) && \
cd lemonldap-ng-$$version && \
2016-01-18 12:14:31 +01:00
debuild -us -uc -b --lintian-opts -i \
2014-01-28 21:29:40 +01:00
--lintian-opts -v --lintian-opts -I --lintian-opts -E \
--lintian-opts --color --lintian-opts auto --lintian-opts -L \
--lintian-opts +=pedantic
2010-01-01 20:01:27 +01:00
debian-packages: debian-dist
mv lemonldap-ng_$(VERSION).orig.$(COMPRESSSUFFIX) /tmp/
version=$(VERSION) && \
cd /tmp/ && \
rm -rf lemonldap-ng-$$version && \
$(UNCOMPRESS) lemonldap-ng_$$version.orig.$(COMPRESSSUFFIX) && \
cd lemonldap-ng-$$version && \
debuild -us -uc -b --lintian-opts -i \
--lintian-opts -v --lintian-opts -I --lintian-opts -E \
--lintian-opts --color --lintian-opts auto --lintian-opts -L \
--lintian-opts +=pedantic
debian-install: debian-local-packages
2010-01-01 20:01:27 +01:00
cd /tmp/lemonldap-ng-$(VERSION) && \
2010-01-08 07:41:37 +01:00
$(SU) debi
ubuntu-install:
$(MAKE) debian-install SU=sudo
diff: debian-diff
2009-12-17 11:26:59 +01:00
2010-01-08 07:41:37 +01:00
debian-diff:
2009-12-17 11:26:59 +01:00
@# Portal
@$(DIFF) $(SRCPORTALDIR)/lib/Lemonldap/NG/Portal $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Portal ||true
@$(DIFF) $(SRCPORTALDIR)/example/scripts/purgeCentralCache $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/purgeCentralCache ||true
@$(DIFF) $(SRCPORTALDIR)/example/scripts/buildPortalWSDL $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/buildPortalWSDL ||true
2009-12-17 11:26:59 +01:00
@for i in $(PORTALSKINS); do \
$(DIFF) -x 'jquery*' $(SRCPORTALDIR)/example/skins/$$i $(DIFFPREFIX)/usr/share/lemonldap-ng/portal-skins/$$i; \
2009-12-17 11:26:59 +01:00
done ||true
@$(DIFF) $(SRCPORTALDIR)/example/index_skin.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/index.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/mail.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/mail.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/metadata.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/metadata.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/openid-configuration.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/openid-configuration.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/cdc.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/cdc.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/register.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/register.pl ||true
2009-12-17 11:26:59 +01:00
@# Handler
@$(DIFF) $(SRCHANDLERDIR)/lib/Lemonldap/NG/Handler $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Handler ||true
@$(DIFF) $(SRCHANDLERDIR)/example/scripts/purgeLocalCache $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/purgeLocalCache ||true
2009-12-17 11:26:59 +01:00
@# Common
@$(DIFF) $(SRCCOMMONDIR)/lib/Lemonldap/NG/Common $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Common ||true
@$(DIFF) $(SRCCOMMONDIR)/lib/Lemonldap/NG/Common.pm $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Common.pm ||true
@$(DIFF) $(SRCCOMMONDIR)/scripts/lmMigrateConfFiles2ini $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/lmMigrateConfFiles2ini ||true
@$(DIFF) $(SRCCOMMONDIR)/scripts/convertConfig $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/convertConfig ||true
@$(DIFF) $(SRCCOMMONDIR)/scripts/rotateOidcKeys $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/rotateOidcKeys ||true
2009-12-17 11:26:59 +01:00
@# Manager
@$(DIFF) $(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Manager ||true
@$(DIFF) $(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager.pm $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Manager.pm ||true
@$(DIFF) $(SRCMANAGERDIR)/eg $(DIFFPREFIX)/var/lib/lemonldap-ng/manager/psgi ||true
@$(DIFF) $(SRCMANAGERDIR)/site/static $(DIFFPREFIX)/var/lib/lemonldap-ng/manager/static ||true
@$(DIFF) $(SRCMANAGERDIR)/site/templates $(DIFFPREFIX)/var/lib/lemonldap-ng/manager/templates ||true
@$(DIFF) --ignore-matching-lines='set.*get.*\[2\]' $(SRCMANAGERDIR)/scripts/lmConfigEditor $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/lmConfigEditor ||true
@$(DIFF) --ignore-matching-lines='giveUpPrivileges' $(SRCMANAGERDIR)/scripts/lemonldap-ng-cli $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/lemonldap-ng-cli ||true
2009-12-17 11:26:59 +01:00
default-diff:
@# Portal
@$(DIFF) $(SRCPORTALDIR)/lib/Lemonldap/NG/Portal /usr/local/share/perl/$(PERLVERSION)/Lemonldap/NG/Portal ||true
@$(DIFF) $(SRCPORTALDIR)/example/scripts/purgeCentralCache $(LMPREFIX)/bin/purgeCentralCache ||true
@$(DIFF) $(SRCPORTALDIR)/example/scripts/buildPortalWSDL $(LMPREFIX)/bin/buildPortalWSDL ||true
@$(DIFF) $(SRCPORTALDIR)/example/skins $(LMPREFIX)/htdocs/portal/skins ||true
@$(DIFF) $(SRCPORTALDIR)/example/index_skin.pl $(LMPREFIX)/htdocs/portal/index.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/mail.pl $(LMPREFIX)/htdocs/portal/mail.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/register.pl $(LMPREFIX)/htdocs/portal/register.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/metadata.pl $(LMPREFIX)/htdocs/portal/metadata.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/openid-configuration.pl $(LMPREFIX)/htdocs/portal/openid-configuration.pl ||true
@$(DIFF) $(SRCPORTALDIR)/example/cdc.pl $(LMPREFIX)/htdocs/portal/cdc.pl ||true
@# Handler
@$(DIFF) $(SRCHANDLERDIR)/lib/Lemonldap/NG/Handler /usr/local/share/perl/$(PERLVERSION)/Lemonldap/NG/Handler ||true
@$(DIFF) $(SRCHANDLERDIR)/example/scripts/purgeLocalCache $(LMPREFIX)/bin/purgeLocalCache ||true
@# Common
@$(DIFF) $(SRCCOMMONDIR)/lib/Lemonldap/NG/Common /usr/local/share/perl/$(PERLVERSION)/Lemonldap/NG/Common ||true
@$(DIFF) $(SRCCOMMONDIR)/lib/Lemonldap/NG/Common.pm /usr/local/share/perl/$(PERLVERSION)/Lemonldap/NG/Common.pm ||true
@$(DIFF) $(SRCCOMMONDIR)/scripts/lmMigrateConfFiles2ini $(LMPREFIX)/bin/lmMigrateConfFiles2ini ||true
@$(DIFF) $(SRCCOMMONDIR)/scripts/convertConfig $(LMPREFIX)/bin/convertConfig ||true
@$(DIFF) $(SRCCOMMONDIR)/scripts/rotateOidcKeys $(LMPREFIX)/bin/rotateOidcKeys ||true
@# Manager
@$(DIFF) $(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager /usr/local/share/perl/$(PERLVERSION)/Lemonldap/NG/Manager ||true
@$(DIFF) $(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager.pm /usr/local/share/perl/$(PERLVERSION)/Lemonldap/NG/Manager.pm ||true
@$(DIFF) $(SRCMANAGERDIR)/eg $(LMPREFIX)/htdocs/manager/psgi ||true
@$(DIFF) $(SRCMANAGERDIR)/site/static $(LMPREFIX)/htdocs/manager/static ||true
@$(DIFF) $(SRCMANAGERDIR)/site/templates $(LMPREFIX)/htdocs/manager/templates ||true
@$(DIFF) --ignore-matching-lines='set.*get.*\[2\]' $(SRCMANAGERDIR)/scripts/lmConfigEditor $(LMPREFIX)/bin/lmConfigEditor ||true
@$(DIFF) --ignore-matching-lines='giveUpPrivileges' $(SRCMANAGERDIR)/scripts/lemonldap-ng-cli $(LMPREFIX)/bin/lemonldap-ng-cli ||true
2010-03-01 21:32:28 +01:00
tidy: clean
2010-05-12 06:04:10 +02:00
find lemon*/ -type f \( -name '*.pm' -or -name '*.pl' -or -name '*.t' \) -print -exec perltidy -b {} \;
2010-03-01 21:32:28 +01:00
find lemon*/ -name '*.bak' -delete
2013-10-30 20:44:09 +01:00
tidy-js: clean
find $(SRCMANAGERDIR)/site/static/js/ e2e-tests/ $(SRCPORTALDIR)/example \
-type f \
-name '*.js' \
! -name 'jq*' \
! -name 'bootstrap*' \
! -name '*.min.js' \
! -name conftree.js \
-print \
-exec js_beautify -o -s=2 {} \;
2013-10-30 20:44:09 +01:00
# TRANSLATION TARGETS #
# 1. Internal targets
2014-12-18 17:52:16 +01:00
language_code:
perl -e ' \
2015-12-19 12:18:25 +01:00
print { \
fr=> "FR-FR", \
}->{$(1)}'
test_omegat_%_dir:
@if [ ! -d omegat.files/$* ]; then \
echo "omegat.files/$* does not exist"; \
exit 1; \
fi
2013-11-09 13:03:47 +01:00
omegat-configuration-file:
perl -pe 'BEGIN{$$p=`pwd`;chomp $$p;}s/__LANG__/$(OMEGATCODE)/;s/__PWD__/$$p/o;' omegat.files/_base.project >omegat.files/$(LANGCODE)/omegat.project
2013-11-09 13:03:47 +01:00
translation: omegat-configuration-file
2015-12-19 12:18:25 +01:00
omegat omegat.files/$(LANGCODE) --no-team --quiet
2013-11-09 13:03:47 +01:00
translated-doc: omegat-configuration-file
omegat omegat.files/$(LANGCODE) --mode=console-translate --quiet 2>/dev/null
cd po-doc/$(LANGCODE)/pages/documentation && rm -rf current && ln -s $$(find * -maxdepth 0 -type d) current
2013-11-09 13:03:47 +01:00
# 2. Public targets
%-translation: test_omegat_%_dir omegat-%-clean
$(eval CODE = $(call language_code,$*))
2015-12-19 12:18:25 +01:00
$(MAKE) translation LANGCODE=$* OMEGATCODE=`$(call language_code,$*)`
2013-11-09 13:03:47 +01:00
%-doc: test_omegat_%_dir omegat-%-clean
2015-07-22 18:51:55 +02:00
mkdir -p po-doc/$*
$(eval CODE = $(call language_code,$*))
2015-12-19 12:18:25 +01:00
$(MAKE) translated-doc LANGCODE=$* OMEGATCODE=`$(call language_code,$*)`
omegat-clean:
rm -rf omegat.files/*/omegat.project omegat.files/*/omegat/project_save*.bak
omegat-%-clean:
2015-07-22 18:51:55 +02:00
rm -rf po-doc/$*
2015-07-22 18:51:55 +02:00
install_%_doc_site:
2014-04-18 12:17:08 +02:00
@rm -rf $(RDOCDIR)/$*-doc || true
@install -v -d $(RDOCDIR)/$*-doc
2015-03-16 06:43:50 +01:00
@cp -dR -f po-doc/$*/* $(RDOCDIR)/$*-doc