lemonldap-ng/Makefile

1152 lines
43 KiB
Makefile
Raw Normal View History

#!/usr/bin/make
2016-02-19 13:33:16 +01:00
# This Makefile contains 2 main sections
# - Variables
# - targets
# ---------
# VARIABLES
# ---------
# Prefix for packaging
DESTDIR=
# Flag for optimizations
USEDEBIANLIBS=no
PROD=$(USEDEBIANLIBS)
2016-01-23 09:14:39 +01:00
USEEXTERNALLIBS=no
2016-02-19 13:33:16 +01:00
# Perl options
#PERLOPTIONS="INSTALLDIRS=vendor"
PERLOPTIONS=
# Compression
JSCOMPRESS=$(PROD)
CSSCOMPRESS=$(PROD)
2016-02-19 13:33:16 +01:00
# External commands
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
2016-01-26 17:15:46 +01:00
NGINX=/usr/sbin/nginx
# Default directories install
2016-02-19 13:33:16 +01:00
# ---------------------------
# Common dirs
PREFIX=/usr/local
LMPREFIX=$(PREFIX)/lemonldap-ng
# BIN dirs
BINDIR=$(LMPREFIX)/bin
2016-02-04 23:10:17 +01:00
SBINDIR=$(LMPREFIX)/sbin
INITDIR=$(LMPREFIX)/etc/init.d
ETCDEFAULTDIR=$(LMPREFIX)/etc/default
DATADIR=$(LMPREFIX)/data
# Document roots for Apache VirtualHosts
DOCUMENTROOT=$(LMPREFIX)/htdocs
PORTALDIR=$(DOCUMENTROOT)/portal
2017-02-28 21:40:29 +01:00
PORTALSITEDIR=$(PORTALDIR)/htdocs
PORTALSTATICDIR=$(PORTALSITEDIR)/static
2017-01-03 18:23:38 +01:00
PORTALRELATIVESTATICDIR=/static
2017-02-28 21:40:29 +01:00
PORTALTEMPLATESDIR=$(PORTALDIR)/templates
2017-01-03 18:23:38 +01:00
MANAGERDIR=$(DOCUMENTROOT)/manager
2017-02-28 21:40:29 +01:00
MANAGERSITEDIR=$(MANAGERDIR)/htdocs
MANAGERSTATICDIR=$(MANAGERSITEDIR)/static
2015-06-10 22:40:29 +02:00
MANAGERRELATIVESTATICDIR=/static
MANAGERTEMPLATESDIR=$(MANAGERSITEDIR)/templates
2014-04-18 12:17:08 +02:00
DOCDIR=$(DOCUMENTROOT)
DEFDOCDIR=$(DOCUMENTROOT)/doc
FRDOCDIR=$(DOCUMENTROOT)/fr-doc
TESTDIR=$(DOCUMENTROOT)/test
EXAMPLESDIR=$(LMPREFIX)/examples
TOOLSDIR=$(LMPREFIX)/tools
# Handler dir
HANDLERDIR=$(LMPREFIX)/handler
# Configuration dir
CONFDIR=$(LMPREFIX)/etc
CRONDIR=$(LMPREFIX)/etc/cron.d
CONFFILENAME=lemonldap-ng.ini
STORAGECONFFILE=$(CONFDIR)/$(CONFFILENAME)
# LL::NG configuration storage dir
FILECONFIGDIR=$(DATADIR)/conf
# LL::NG sessions storage dir
APACHESESSIONFILEDIR=$(DATADIR)/sessions
APACHESESSIONFILELOCKDIR=$(APACHESESSIONFILEDIR)/lock
# LL::NG persistent sessions storage dir
APACHEPSESSIONFILEDIR=$(DATADIR)/psessions
APACHEPSESSIONFILELOCKDIR=$(APACHEPSESSIONFILEDIR)/lock
# LL::NG notifications storage dir
2012-08-31 09:48:54 +02:00
APACHEFILENOTIFDIR=$(DATADIR)/notifications
2014-12-19 10:07:29 +01:00
# LL::NG captcha dir
CAPTCHADIR=$(DATADIR)/captcha
# Apache user/group
APACHEUSER=
APACHEGROUP=
2016-02-15 19:06:20 +01:00
# FastCGI
FASTCGISOCKDIR=$(PREFIX)/run
2016-02-04 23:10:17 +01:00
FASTCGIUSER=$(APACHEUSER)
FASTCGIGROUP=$(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, ...)
2016-01-28 07:43:48 +01:00
PORT=80
VHOSTLISTEN="*:$(PORT)"
2016-01-28 23:25:44 +01:00
TESTWEBSERVER=apache
2016-01-28 07:43:48 +01:00
TESTWEBSERVERPORT=19876
# LDAP backend test
LLNGTESTLDAP_SLAPD_BIN:=/usr/sbin/slapd
LLNGTESTLDAP_SLAPADD_BIN:=/usr/sbin/slapdadd
LLNGTESTLDAP_SCHEMA_DIR:=/etc/slapd/schema
# Other
SRCCOMMONDIR=lemonldap-ng-common
SRCHANDLERDIR=lemonldap-ng-handler
SRCPORTALDIR=lemonldap-ng-portal
SRCMANAGERDIR=lemonldap-ng-manager
2016-02-19 13:33:16 +01:00
ERASECONFIG=1 # Set to 0 if you do not want to replace your configuration
# INTERNAL VARIABLES
# Internal variables used to install in $(DESTDIR)
RLMPREFIX=$(DESTDIR)/$(LMPREFIX)
RBINDIR=$(DESTDIR)/$(BINDIR)
RSBINDIR=$(DESTDIR)/$(SBINDIR)
RINITDIR=$(DESTDIR)/$(INITDIR)
RETCDEFAULTDIR=$(DESTDIR)/$(ETCDEFAULTDIR)
RDATADIR=$(DESTDIR)/$(DATADIR)
RPORTALDIR=$(DESTDIR)/$(PORTALDIR)
RPORTALSITEDIR=$(DESTDIR)/$(PORTALSITEDIR)
RPORTALSTATICDIR=$(DESTDIR)/$(PORTALSTATICDIR)
RPORTALTEMPLATESDIR=$(DESTDIR)/$(PORTALTEMPLATESDIR)
2016-02-19 13:33:16 +01:00
RMANAGERDIR=$(DESTDIR)/$(MANAGERDIR)
RMANAGERSITEDIR=$(DESTDIR)/$(MANAGERSITEDIR)
RMANAGERSTATICDIR=$(DESTDIR)/$(MANAGERSTATICDIR)
RMANAGERTEMPLATESDIR=$(DESTDIR)/$(MANAGERTEMPLATESDIR)
RDOCDIR=$(DESTDIR)/$(DOCDIR)
RDEFDOCDIR=$(DESTDIR)/$(DEFDOCDIR)
RTESTDIR=$(DESTDIR)/$(TESTDIR)
REXAMPLESDIR=$(DESTDIR)/$(EXAMPLESDIR)
RTOOLSDIR=$(DESTDIR)/$(TOOLSDIR)
RHANDLERDIR=$(DESTDIR)/$(HANDLERDIR)
RCONFDIR=$(DESTDIR)/$(CONFDIR)
RCRONDIR=$(DESTDIR)/$(CRONDIR)
RFILECONFIGDIR=$(DESTDIR)/$(FILECONFIGDIR)
RAPACHESESSIONFILEDIR=$(DESTDIR)/$(APACHESESSIONFILEDIR)
RAPACHESESSIONFILELOCKDIR=$(DESTDIR)/$(APACHESESSIONFILELOCKDIR)
RAPACHEPSESSIONFILEDIR=$(DESTDIR)/$(APACHEPSESSIONFILEDIR)
RAPACHEPSESSIONFILELOCKDIR=$(DESTDIR)/$(APACHEPSESSIONFILELOCKDIR)
RFILENOTIFDIR=$(DESTDIR)/$(APACHEFILENOTIFDIR)
RCAPTCHADIR=$(DESTDIR)/$(CAPTCHADIR)
RFASTCGISOCKDIR=$(DESTDIR)/$(FASTCGISOCKDIR)
VERSION=`head -n1 changelog |sed -e 's/lemonldap-ng (//' -e 's/).*$$//'`
2016-05-25 07:13:38 +02:00
PORTALSKINS=`ls $(SRCPORTALDIR)/site/templates/`
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=
MANAGERLIBSTOREMOVEFORDEBIAN=$(RMANAGERSTATICDIR)/bwr/jquery/ \
$(RMANAGERSTATICDIR)/bwr/angular/ \
$(RMANAGERSTATICDIR)/bwr/angular-animate/ \
$(RMANAGERSTATICDIR)/bwr/angular-cookie/ \
$(RMANAGERSTATICDIR)/bwr/bootstrap/ \
$(RMANAGERSTATICDIR)/bwr/es5-shim/
2017-01-03 18:23:38 +01:00
PORTALLIBSTOREMOVEFORDEBIAN=$(RPORTALSTATICDIR)/bwr/bootstrap/ \
$(RPORTALSTATICDIR)/bwr/jquery-ui \
$(RPORTALSTATICDIR)/bwr/jquery.cookie \
$(RPORTALSTATICDIR)/bwr/jquery
2016-12-11 11:45:59 +01:00
DOCLIBSTOREMOVEFORDEBIAN=pages/documentation/current/lib/tpl/bootstrap3 \
pages/documentation/current/lib/scripts/jquery-ui*.js \
pages/documentation/current/bootswatch/3.3.4/flatly/bootstrap.min.css
2016-10-24 21:57:35 +02:00
DOCEXTERNALLIBS=$(DOCLIBSTOREMOVEFORDEBIAN)
2016-01-23 09:14:39 +01:00
MANAGEREXTERNALLIBS=$(RMANAGERSTATICDIR)/bwr/
2017-01-03 18:23:38 +01:00
PORTALEXTERNALLIBS=$(PORTALLIBSTOREMOVEFORDEBIAN)
2016-02-19 13:33:16 +01:00
# GENERATED SRC FILES
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 \
2017-04-12 18:45:49 +02:00
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build/CTrees.pm \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Conf/Zero.pm
MANAGERJSONDST=$(SRCMANAGERDIR)/site/htdocs/static/struct.json \
$(SRCMANAGERDIR)/site/htdocs/static/js/conftree.js \
2015-12-27 08:19:10 +01:00
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Attributes.pm \
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/ReConstants.pm \
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm \
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/Constants.pm \
_example/conf/lmConf-1.json
# Javascript and CSS to minify
JSSRCFILES:=$(shell find */site/htdocs/static/js $(SRCPORTALDIR)/site/htdocs/static -type f -name '*.js' ! -name '*.min.js') \
$(SRCMANAGERDIR)/site/htdocs/static/bwr/file-saver.js/FileSaver.js
2017-09-11 12:02:56 +02:00
CSSSRCFILES:=$(shell find $(SRCMANAGERDIR)/site/htdocs/static $(SRCPORTALDIR)/site/htdocs/static -type f -name '*.css' ! -name '*.min.css')
2016-03-14 23:22:09 +01:00
# Coffee files
2016-05-20 19:09:32 +02:00
MANAGERCOFFEESRCFILES:=$(shell find lemonldap-ng-manager/site/coffee -type f -name '*.coffee')
PORTALCOFFEESRCFILES:=$(shell find lemonldap-ng-portal/site/coffee -type f -name '*.coffee')
COFFEESRCFILES=$(MANAGERCOFFEESRCFILES) $(PORTALCOFFEESRCFILES)
MANAGERCOFFEEDSTFILES:=$(subst coffee/,htdocs/static/js/,$(MANAGERCOFFEESRCFILES:.coffee=.js))
2016-05-20 19:09:32 +02:00
PORTALCOFFEEDSTFILES:=$(subst coffee/,htdocs/static/common/js/,$(PORTALCOFFEESRCFILES:.coffee=.js))
COFFEEDSTFILES:=$(MANAGERCOFFEEDSTFILES) $(PORTALCOFFEEDSTFILES)
2016-03-14 23:22:09 +01:00
# Minified files
JSDSTFILES=$(JSSRCFILES:.js=.min.js)
CSSDSTFILES=$(CSSSRCFILES:.css=.min.css)
2016-02-19 13:33:16 +01:00
# -------
# TARGETS
# -------
# Targets section contains the following subsections:
2016-02-25 09:17:01 +01:00
# - 'all' that must be defined at first
2016-02-19 13:33:16 +01:00
# - configure targets
# - make targets
# - test targets
# - end-to-end tests
# - install targets
# - cleaning targets
# - Perl libraries uninstall targets
# - packaging targets
# - developper corner
2016-02-25 09:17:01 +01:00
all: configure common handler manager portal
@echo
@echo "Building succeed. Now run :"
@echo " - 'make test' to verify your installation"
@echo " - 'make install PROD=yes' to install all"
@echo
@echo " MAKE INSTALL OPTIONS:"
@echo " - PROD=yes : use js/css minified files"
@echo " - USEDEBIANLIBS=yes : use some Debian shared js/css files"
@echo " - USEEXTERNALLIBS=yes : use external links for some js/css files"
@echo
@echo 'Other targets :'
@echo " * Partial build :"
@echo " - portal, manager, handler"
@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 " * FastCGI server install (required for Nginx)"
@echo " - install_fastcgi_server ($(SBINDIR))"
@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 :"
@echo " - install_doc_site ($(DEFDOCDIR))"
@echo " - install_examples_site ($(EXAMPLESDIR))"
@echo
@echo "Other languages documentation (fr only for now)"
@echo " - fr-doc (needs OmegaT)"
@echo " - install_fr_doc_site"
@echo
2016-02-19 13:33:16 +01:00
# Configure targets
# -----------------
configure: json common_conf handler_conf portal_conf manager_conf
2016-03-21 18:52:43 +01:00
js: $(COFFEEDSTFILES)
minify: js $(JSDSTFILES) $(CSSDSTFILES)
2016-02-19 13:33:16 +01:00
2016-05-20 19:09:32 +02:00
$(SRCPORTALDIR)/site/htdocs/static/common/js/%.js: $(SRCPORTALDIR)/site/coffee/%.coffee
2016-03-30 22:57:48 +02:00
@if which coffee >/dev/null; then \
echo "Compiling $(SRCPORTALDIR)/site/coffee/$*.coffee"; \
2016-05-20 19:09:32 +02:00
coffee -c -o $(SRCPORTALDIR)/site/htdocs/static/common/js/ $(SRCPORTALDIR)/site/coffee/$*.coffee; \
2016-03-30 22:57:48 +02:00
fi
2017-03-12 23:11:26 +01:00
$(SRCMANAGERDIR)/site/htdocs/static/js/%.js: $(SRCMANAGERDIR)/site/coffee/%.coffee
2016-03-14 23:22:09 +01:00
@if which coffee >/dev/null; then \
echo "Compiling $(SRCMANAGERDIR)/site/coffee/$*.coffee"; \
coffee -c -o $(SRCMANAGERDIR)/site/htdocs/static/js/ $(SRCMANAGERDIR)/site/coffee/$*.coffee; \
2016-03-14 23:22:09 +01:00
fi
2016-02-19 13:33:16 +01:00
%.min.css: %.css
@echo "Compressing $*.css"
@yui-compressor $*.css > $*.min.css
%.min.js: %.js
@echo "Compressing $*.js"
@yui-compressor $*.js > $*.min.js
fastcgi-server/man/llng-fastcgi-server.1p: fastcgi-server/sbin/llng-fastcgi-server
2016-06-14 10:26:00 +02:00
@echo Update FastCGI server man page
2016-02-19 13:33:16 +01:00
@pod2man -name llng-fastcgi-server fastcgi-server/sbin/llng-fastcgi-server >fastcgi-server/man/llng-fastcgi-server.1p
# Perl libraries configuration
json: $(MANAGERJSONDST) fastcgi-server/man/llng-fastcgi-server.1p
2016-03-14 23:22:09 +01:00
@if which yui-compressor >/dev/null; then $(MAKE) minify; fi
2016-02-19 13:33:16 +01:00
$(MANAGERJSONDST): $(MANAGERJSONSRC)
./scripts/jsongenerator.pl
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)
# Make targets
# ------------
common: common_conf
@$(MAKE) -C ${SRCCOMMONDIR}
2016-01-24 10:15:48 +01:00
handler: handler_conf common
@$(MAKE) -C ${SRCHANDLERDIR}
2016-05-24 18:53:39 +02:00
portal: portal_conf handler
@$(MAKE) -C ${SRCPORTALDIR}
2016-01-24 10:15:48 +01:00
manager: manager_conf handler
$(MAKE) -C ${SRCMANAGERDIR}
2016-02-19 13:33:16 +01:00
# Test targets
# ------------
2016-06-09 13:17:14 +02:00
test: all common_test handler_test portal_test manager_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/"
2016-01-26 14:15:51 +01:00
# End-to-end tests
2016-02-19 13:33:16 +01:00
# ----------------
e2e_test: all prepare_test_server start_web_server launch_protractor stop_web_server
nox_full_test: test prepare_test_server start_web_server
X -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./e2e-tests/conf/X.log -config ./e2e-tests/xorg.conf :11 & \
echo $$! > e2e-tests/conf/X.pid
-DISPLAY=:11 $(MAKE) launch_protractor
kill $$(cat e2e-tests/conf/X.pid)
$(MAKE) stop_web_server
prepare_test_server:
2017-06-09 12:45:39 +02:00
-@mkdir -p e2e-tests/conf/sessions/lock e2e-tests/conf/persistents/lock
-@mkdir e2e-tests/conf/manager e2e-tests/conf/portal
2016-02-24 07:54:18 +01:00
$(MAKE) install_webserver_conf install_test_site install_fastcgi_server \
CONFDIR=`pwd`/e2e-tests/conf \
RCONFDIR=e2e-tests/conf \
ERASECONFIG=1 \
2016-01-28 07:43:48 +01:00
VHOSTLISTEN='*:$(TESTWEBSERVERPORT)' \
PORT=$(TESTWEBSERVERPORT) \
2016-02-15 22:12:56 +01:00
FASTCGISOCKDIR=`pwd`/e2e-tests/conf \
2017-03-04 08:11:13 +01:00
PORTALSITEDIR=`pwd`/e2e-tests/conf/portal \
PORTALSTATICDIR=`pwd`/$(SRCPORTALDIR)/site/htdocs/static \
MANAGERSITEDIR=`pwd`/e2e-tests/conf/manager \
MANAGERSTATICDIR=`pwd`/$(SRCMANAGERDIR)/site/htdocs/static \
2016-02-02 07:17:08 +01:00
TESTDIR=`pwd`/e2e-tests/conf/site \
DEFDOCDIR=`pwd`/doc \
2016-02-21 07:43:01 +01:00
FRDOCDIR=`pwd`/po-doc/fr \
SBINDIR=`pwd`/e2e-tests/conf/sbin \
INITDIR=`pwd`/e2e-tests/conf/init \
ETCDEFAULTDIR=`pwd`/e2e-tests/conf/def
#@cp -f e2e-tests/index.* e2e-tests/conf/
2017-07-17 19:57:29 +02:00
@perl -i -pe 's/example\.com/example.com:19876/g' e2e-tests/conf/site/index.pl
@cp -f $(SRCMANAGERDIR)/site/htdocs/manager* e2e-tests/conf/manager
@cp -f $(SRCPORTALDIR)/site/htdocs/index* e2e-tests/conf/portal
@for f in $$(find e2e-tests/conf -name '*.fcgi'); do \
perl -i -pe 'if($$.==2){print "BEGIN{\n"; print qq(use lib q('`pwd`'/lemonldap-ng-$$_/blib/lib);\n) foreach qw(common handler portal manager); print "}\n"; }' $$f; \
done
2017-02-26 09:04:35 +01:00
@cp e2e-tests/lmConf-1.json e2e-tests/lemonldap-ng*.ini e2e-tests/env.conf e2e-tests/test-nginx.conf e2e-tests/conf/
2016-02-18 06:33:49 +01:00
@cp e2e-tests/form.html e2e-tests/conf/site
2016-02-16 07:21:35 +01:00
@perl -i -pe 'BEGIN{$$p=`pwd`;chomp $$p}s#__pwd__#$$p#;s#__port__#$(TESTWEBSERVERPORT)#;s#__FASTCGISOCKDIR__#$(FASTCGISOCKDIR)#;' \
2017-02-26 09:04:35 +01:00
e2e-tests/conf/lemonldap-ng*.ini \
e2e-tests/conf/lmConf-1.json \
e2e-tests/conf/env.conf \
e2e-tests/conf/test-nginx.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
2017-02-26 13:40:21 +01:00
@if test "$(TESTBACKEND)" = "DBI"; then \
2017-02-26 09:04:35 +01:00
echo 'create table lmConfig (cfgNum int, data text);'|sqlite3 e2e-tests/conf/config.db; \
echo 'create table sessions (id text, a_session text, LastUpdated int);'|sqlite3 e2e-tests/conf/sessions.db; \
perl -Ilemonldap-ng-common/blib/lib ./lemonldap-ng-common/scripts/convertConfig \
--current=e2e-tests/conf/lemonldap-ng.ini \
--new=e2e-tests/conf/lemonldap-ng-sql.ini; \
mv e2e-tests/conf/lemonldap-ng-sql.ini e2e-tests/conf/lemonldap-ng.ini; \
2017-02-26 09:04:39 +01:00
LLNG_DEFAULTCONFFILE=e2e-tests/conf/lemonldap-ng.ini \
perl -Ilemonldap-ng-common/blib/lib -Ilemonldap-ng-manager/blib/lib -Ilemonldap-ng-handler/blib/lib \
lemonldap-ng-common/scripts/lemonldap-ng-cli --yes 1 \
set globalStorage Apache::Session::SQLite3; \
LLNG_DEFAULTCONFFILE=e2e-tests/conf/lemonldap-ng.ini \
perl -Ilemonldap-ng-common/blib/lib -Ilemonldap-ng-manager/blib/lib -Ilemonldap-ng-handler/blib/lib \
lemonldap-ng-common/scripts/lemonldap-ng-cli --yes 1 \
addKey globalStorageOptions DataSource 'dbi:SQLite:dbname='`pwd`'/e2e-tests/conf/sessions.db'; \
2017-02-26 09:04:35 +01:00
fi
2017-07-11 18:15:06 +02:00
@# Debian: make start_web_server TESTBACKEND=LDAP LLNGTESTLDAP_SCHEMA_DIR=/etc/ldap/schema LLNGTESTLDAP_SLAPADD_BIN=/usr/sbin/slapadd
@if test "$(TESTBACKEND)" = "LDAP"; then \
2017-07-11 18:15:06 +02:00
cp lemonldap-ng-portal/t/testslapd/slapd.ldif e2e-tests/conf/; \
mkdir e2e-tests/conf/slapd.d; \
mkdir e2e-tests/conf/data; \
sed -i 's:__SCHEMA_DIR__:${LLNGTESTLDAP_SCHEMA_DIR}:' e2e-tests/conf/slapd.ldif; \
sed -i 's|olcDbDirectory.*|olcDbDirectory: e2e-tests/conf/data|' e2e-tests/conf/slapd.ldif; \
sed -i 's|olcPidFile.*|olcPidFile: e2e-tests/conf/slapd.pid|' e2e-tests/conf/slapd.ldif; \
${LLNGTESTLDAP_SLAPADD_BIN} -F e2e-tests/conf/slapd.d -n 0 -l e2e-tests/conf/slapd.ldif; \
${LLNGTESTLDAP_SLAPADD_BIN} -F e2e-tests/conf/slapd.d -n 1 -l lemonldap-ng-portal/t/testslapd/confs-sessions.ldif; \
${LLNGTESTLDAP_SLAPD_BIN} -s 511 -h "ldap://127.0.0.1:20389/" -F e2e-tests/conf/slapd.d; \
perl -Ilemonldap-ng-common/blib/lib ./lemonldap-ng-common/scripts/convertConfig \
--current=e2e-tests/conf/lemonldap-ng.ini \
--new=e2e-tests/conf/lemonldap-ng-ldap.ini; \
mv e2e-tests/conf/lemonldap-ng-ldap.ini e2e-tests/conf/lemonldap-ng.ini; \
2017-07-11 18:15:06 +02:00
fi
-@[ -e e2e-tests/conf/apache2.pid ] && kill `cat e2e-tests/conf/apache2.pid` || true
-@[ -e e2e-tests/conf/nginx.pid ] && kill `cat e2e-tests/conf/nginx.pid` || true
2016-02-21 07:43:01 +01:00
-@[ -e e2e-tests/conf/llng-fastcgi.pid ] && kill `cat e2e-tests/conf/llng-fastcgi.pid` && rm -f e2e-tests/conf/llng-fastcgi.pid || true
# Start web server (designed for Debian, path may be broken else)
2016-01-29 12:09:51 +01:00
@if test "$(TESTWEBSERVER)" = "apache"; then \
2016-01-28 23:25:44 +01:00
LLNG_DEFAULTCONFFILE=`pwd`/e2e-tests/conf/lemonldap-ng.ini /usr/sbin/apache2 -d `pwd`/e2e-tests -f apache2.conf -k start; \
elif test "$(TESTWEBSERVER)" = "nginx"; then \
2016-01-30 13:26:14 +01:00
echo "Testing nginx conf"; \
$(NGINX) -t -p `pwd`/e2e-tests \
-g 'error_log '`pwd`'/e2e-tests/conf/nginx.log;' \
-c `pwd`/e2e-tests/nginx.conf \
2>&1 | grep -v 'Permission denied' || true; \
echo "Launching nginx"; \
$(NGINX) -p `pwd`/e2e-tests \
-g 'error_log '`pwd`'/e2e-tests/conf/nginx.log;' \
2016-01-28 23:25:44 +01:00
-c `pwd`/e2e-tests/nginx.conf \
2>&1 | grep -v 'Permission denied' || true; \
echo "Launching plackup"; \
2016-01-29 12:09:53 +01:00
$(MAKE) plackup; \
2016-01-28 23:25:44 +01:00
else \
echo "!!!!! Unknown test server: $(TESTWEBSERVER) !!!!!" >&2; \
exit 1; \
fi
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 \
2016-01-29 12:09:56 +01:00
LLNG_DEFAULTCONFFILE=`pwd`/e2e-tests/conf/lemonldap-ng.ini \
/usr/sbin/apache2 -d `pwd`/e2e-tests -f apache2.conf -k graceful; \
2016-01-28 23:25:44 +01:00
elif [ -e e2e-tests/conf/nginx.pid ]; then \
kill -HUP `cat e2e-tests/conf/nginx.pid`; \
2016-02-21 07:43:01 +01:00
kill `cat e2e-tests/conf/llng-fastcgi.pid` || true; \
2016-01-29 12:09:53 +01:00
$(MAKE) plackup; \
2015-12-14 06:50:27 +01:00
else \
$(MAKE) start_web_server; \
fi
2017-03-16 13:06:55 +01:00
launch_protractor:
# 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
2016-01-28 07:43:48 +01:00
@TESTWEBSERVERPORT=$(TESTWEBSERVERPORT) protractor e2e-tests/protractor-conf.js
stop_web_server:
# Stop web server
-@[ -e e2e-tests/conf/apache2.pid ] && kill `cat e2e-tests/conf/apache2.pid` || true
-@[ -e e2e-tests/conf/nginx.pid ] && kill `cat e2e-tests/conf/nginx.pid` ||true
2016-02-21 07:43:01 +01:00
-@[ -e e2e-tests/conf/llng-fastcgi.pid ] && kill `cat e2e-tests/conf/llng-fastcgi.pid` && rm -f e2e-tests/conf/llng-fastcgi.pid || true
-@[ -e e2e-tests/conf/slapd.pid ] && kill `cat e2e-tests/conf/slapd.pid` || true
# Clean
@rm -rf e2e-tests/conf
restart_web_server: start_web_server
2016-01-29 12:09:53 +01:00
plackup:
2016-01-29 12:09:56 +01:00
@LLNG_DEFAULTCONFFILE=`pwd`/e2e-tests/conf/lemonldap-ng.ini \
2016-10-25 22:40:46 +02:00
perl -I . -I`pwd`/lemonldap-ng-common/blib/lib/ \
2016-02-21 07:43:01 +01:00
-I`pwd`/lemonldap-ng-handler/blib/lib/ \
-I`pwd`/lemonldap-ng-portal/blib/lib/ \
-I`pwd`/lemonldap-ng-manager/blib/lib/ \
e2e-tests/conf/sbin/llng-fastcgi-server \
2016-02-28 12:51:31 +01:00
-f e2e-tests/custom.pm \
2016-02-21 07:43:01 +01:00
-F >e2e-tests/conf/fastcgi.log 2>&1 &
2016-01-29 12:09:53 +01:00
2016-02-16 12:19:25 +01:00
install_test:
@TESTWEBSERVERPORT=$(PORT) protractor e2e-tests/protractor-conf.js
2016-02-19 13:33:16 +01:00
# Install targets
# ---------------
2016-02-07 09:32:40 +01:00
install: install_libs install_bin install_fastcgi_server install_site
# Perl libraires install
2016-02-19 13:33:16 +01:00
2016-02-07 09:32:40 +01:00
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
2010-01-08 07:41:37 +01:00
install_bin: install_conf_dir
# Binary install
@install -v -d $(RBINDIR)
@cp -f\
${SRCHANDLERDIR}/example/scripts/purgeLocalCache \
2016-05-25 07:13:38 +02:00
${SRCPORTALDIR}/site/cron/purgeCentralCache \
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 \
2016-02-06 13:22:10 +01:00
${SRCCOMMONDIR}/scripts/lemonldap-ng-cli \
$(RBINDIR)
@if [ ! "$(APACHEUSER)" ]; then \
$(PERL) -i -pe 's#__APACHEUSER__#nobody#g;' $(RBINDIR)/lmConfigEditor $(RBINDIR)/lemonldap-ng-cli; \
else \
$(PERL) -i -pe 's#__APACHEUSER__#$(APACHEUSER)#g;' $(RBINDIR)/lmConfigEditor $(RBINDIR)/lemonldap-ng-cli; \
fi
@if [ ! "$(APACHEGROUP)" ]; then \
$(PERL) -i -pe 's#__APACHEGROUP__#nobody#g;' $(RBINDIR)/lmConfigEditor $(RBINDIR)/lemonldap-ng-cli; \
else \
$(PERL) -i -pe 's#__APACHEGROUP__#$(APACHEGROUP)#g;' $(RBINDIR)/lmConfigEditor $(RBINDIR)/lemonldap-ng-cli; \
fi
2010-10-30 17:22:14 +02:00
@chmod +x $(RBINDIR)/*
2016-02-04 23:10:17 +01:00
install_fastcgi_server:
2016-02-15 19:06:20 +01:00
@install -v -d $(RSBINDIR) $(RINITDIR) $(RETCDEFAULTDIR) $(RFASTCGISOCKDIR)
@cp -f fastcgi-server/sbin/llng-fastcgi-server $(RSBINDIR)
2016-02-21 07:43:01 +01:00
@chmod +x $(RSBINDIR)/llng-fastcgi-server
@cp -f fastcgi-server/rc/llng-fastcgi-server $(RINITDIR)
@cp -f fastcgi-server/default/llng-fastcgi-server $(RETCDEFAULTDIR)
@$(PERL) -pi -e 's#__SBINDIR__#$(SBINDIR)#;s#__DEFAULTDIR__#$(ETCDEFAULTDIR)#;s#__FASTCGISOCKDIR__#$(FASTCGISOCKDIR)#g;' \
2016-02-15 19:06:20 +01:00
$(RETCDEFAULTDIR)/llng-fastcgi-server \
$(RSBINDIR)/llng-fastcgi-server \
$(RINITDIR)/llng-fastcgi-server
2016-02-04 23:10:17 +01:00
@if [ ! "$(FASTCGIUSER)" ]; then \
$(PERL) -pi -e 's#__USER__#nobody#' $(RETCDEFAULTDIR)/llng-fastcgi-server; \
else \
$(PERL) -pi -e 's#__USER__#$(FASTCGIUSER)#' $(RETCDEFAULTDIR)/llng-fastcgi-server; \
fi
@if [ ! "$(FASTCGIGROUP)" ]; then \
$(PERL) -pi -e 's#__GROUP__#nobody#' $(RETCDEFAULTDIR)/llng-fastcgi-server; \
2016-02-04 23:10:17 +01:00
else \
$(PERL) -pi -e 's#__GROUP__#$(FASTCGIGROUP)#' $(RETCDEFAULTDIR)/llng-fastcgi-server; \
2016-02-04 23:10:17 +01:00
fi
2016-02-21 07:43:01 +01:00
@if [ "$(FASTCGIUSER)" != "" ]; then \
2016-02-15 19:06:20 +01:00
chown $(FASTCGIUSER) $(RFASTCGISOCKDIR) || exit 1; \
if [ "$(FASTCGIGROUP)" != "" ]; then \
chgrp $(FASTCGIGROUP) $(RFASTCGISOCKDIR) || exit 1; \
fi; \
chmod 770 $(RFASTCGISOCKDIR); \
else \
chmod 777 $(RFASTCGISOCKDIR); \
fi
2016-02-04 23:10:17 +01:00
2016-02-19 13:33:16 +01:00
# 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 \
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
2017-01-03 18:23:38 +01:00
@chmod 755 $(RBINDIR) $(RDOCUMENTROOT) $(REXAMPLESDIR) $(RHANDLERDIR) $(RPORTALSTATICDIR) $(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/*nginx*.conf $(RCONFDIR); \
fi
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g; \
s#__PORTALDIR__#$(PORTALDIR)/#g; \
2017-03-02 20:06:50 +01:00
s#__PORTALSITEDIR__#$(PORTALSITEDIR)/#g; \
2017-01-03 18:23:38 +01:00
s#__PORTALSTATICDIR__#$(PORTALSTATICDIR)/#g; \
s#__MANAGERDIR__#$(MANAGERDIR)/#g; \
2017-03-02 20:06:50 +01:00
s#__MANAGERSITEDIR__#$(MANAGERSITEDIR)/#g; \
s#__MANAGERSTATICDIR__#$(MANAGERSTATICDIR)/#g; \
s#__TESTDIR__#$(TESTDIR)/#g; \
2016-01-28 07:43:48 +01:00
s#__PORT__#$(PORT)#g; \
2016-02-24 07:54:18 +01:00
s#__CONFDIR__#$(CONFDIR)#g; \
2016-02-15 22:12:56 +01:00
s#__FASTCGISOCKDIR__#$(FASTCGISOCKDIR)#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) \
$(RMANAGERTEMPLATESDIR)
2017-02-28 21:40:29 +01:00
@cp -pR -f $(SRCMANAGERDIR)/site/htdocs/manager.* $(RMANAGERSITEDIR)
@cp -pR $(SRCMANAGERDIR)/site/htdocs/static/* $(RMANAGERSTATICDIR)
@for f in $(SRCMANAGERDIR)/site/templates/*.tpl; do \
2016-01-23 09:14:39 +01:00
./scripts/transform-templates \
usedebianlibs $(USEDEBIANLIBS) \
useexternallibs $(USEEXTERNALLIBS) \
jsminified $(JSCOMPRESS) \
cssminified $(CSSCOMPRESS) <$$f \
> $(RMANAGERTEMPLATESDIR)/`basename $$f`; \
done
2016-01-23 09:14:39 +01:00
@if test "$(USEEXTERNALLIBS)" = "yes"; then \
2016-01-27 18:49:49 +01:00
rm -rvf $(MANAGEREXTERNALLIBS); \
2016-01-23 09:14:39 +01:00
elif test "$(USEDEBIANLIBS)" = "yes"; then \
rm -rvf $(MANAGERLIBSTOREMOVEFORDEBIAN); \
fi
# Clean svn files
@rm -rf $$(find ${RMANAGERSTATICDIR} \
$(RMANAGERTEMPLATESDIR) $(RCONFDIR) -type d -name .svn)
2017-01-09 22:54:06 +01: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
2017-01-03 18:23:38 +01:00
@install -v -d $(RPORTALDIR) $(RPORTALSTATICDIR) \
2017-02-23 13:58:52 +01:00
$(RPORTALTEMPLATESDIR) \
$(RCRONDIR) $(RCONFDIR)
2017-02-28 21:40:29 +01:00
@cp -pR -f $(SRCPORTALDIR)/site/htdocs/index.* $(RPORTALSITEDIR)
2017-01-03 18:23:38 +01:00
@cp -pR -f $(SRCPORTALDIR)/site/htdocs/static/* $(RPORTALSTATICDIR)
2017-02-23 13:58:52 +01:00
cd $(SRCPORTALDIR)/site/templates; for f in `find * -type f -name '*.tpl'`; do \
echo "$$f => $(RPORTALTEMPLATESDIR)/$$f"; \
mkdir -p $(RPORTALTEMPLATESDIR)/`dirname $$f`; \
2017-04-11 11:00:40 +02:00
../../../scripts/transform-templates \
2016-02-16 12:38:08 +01:00
usedebianlibs $(USEDEBIANLIBS) \
useexternallibs $(USEEXTERNALLIBS) \
jsminified $(JSCOMPRESS) \
cssminified $(CSSCOMPRESS) <$$f \
2017-02-23 13:58:52 +01:00
>$(RPORTALTEMPLATESDIR)/$$f; \
done; cd -
cd $(SRCPORTALDIR)/site/templates; for l in `find * -type l`; do \
2017-02-28 21:21:59 +01:00
echo link to do $$l `readlink $$l`; \
2017-02-23 13:58:52 +01:00
target=`readlink $$l`; \
cd $(RPORTALTEMPLATESDIR); \
ln -s $$target $$l; \
cd -; \
2016-01-18 13:13:16 +01:00
done
2017-02-28 21:21:59 +01:00
if test "$(USEEXTERNALLIBS)" = "yes"; then \
2016-01-27 18:49:49 +01:00
rm -rvf $(PORTALEXTERNALLIBS); \
2016-01-23 09:14:39 +01:00
elif test "$(USEDEBIANLIBS)" = "yes"; then \
rm -rvf $(PORTALLIBSTOREMOVEFORDEBIAN); \
fi
# Cron files
2016-05-25 07:13:38 +02:00
@cp -f $(SRCPORTALDIR)/site/cron/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)
2017-04-10 20:55:54 +02:00
@$(PERL) -i -pe 's#__PORTALSTATICDIR__#$(PORTALRELATIVESTATICDIR)#g' $(RCONFDIR)/$(CONFFILENAME)
@$(PERL) -i -pe 's#__PORTALTEMPLATESDIR__#$(PORTALTEMPLATESDIR)#g' $(RCONFDIR)/$(CONFFILENAME)
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)
@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)
2016-05-25 07:13:38 +02:00
@for i in handler; do \
cp -a -f lemonldap-ng-$$i/example $(REXAMPLESDIR)/$$i; \
done
2016-05-25 07:13:38 +02:00
@for i in portal manager; do \
cp -a -f lemonldap-ng-$$i/eg $(REXAMPLESDIR)/$$i; \
2016-02-15 19:06:20 +01:00
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)
install_doc_site:
# Offline documentation install
2014-04-18 12:17:08 +02:00
@rm -rf $(RDEFDOCDIR)
2016-10-20 11:02:30 +02:00
# Install doc directories
@install -v -d -m 755 $(RDEFDOCDIR)
@cd doc && find * -type d |(cd $(RDEFDOCDIR); xargs install -v -d -m 755) && cd -
# Install HTML files
@cd doc && for f in `find * -type f -name '*.html'`; do \
echo "Installing $$f"; \
../scripts/transform-templates \
usedebianlibs $(USEDEBIANLIBS) \
useexternallibs $(USEEXTERNALLIBS) \
jsminified $(JSCOMPRESS) \
cssminified $(CSSCOMPRESS) <$$f \
> $(RDEFDOCDIR)/$$f; \
done && cd -
# Install other files
@cd doc && for f in `find * -type f ! -name '*.html'`; do \
install -v -m 644 $$f $(RDEFDOCDIR)/$$f; \
done && cd -
# Install symlinks
@cd doc && tar cf - `find * -type l` | tar xvf - -C $(RDEFDOCDIR) && cd -
2016-10-24 21:57:35 +02:00
# Remove js
2016-11-27 09:06:19 +01:00
@cd $(RDEFDOCDIR) && if test "$(USEEXTERNALLIBS)" = "yes"; then \
2016-10-24 21:57:35 +02:00
rm -rvf $(DOCEXTERNALLIBS); \
elif test "$(USEDEBIANLIBS)" = "yes"; then \
rm -rvf $(DOCLIBSTOREMOVEFORDEBIAN); \
2016-11-27 09:06:19 +01:00
fi && cd -
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 \
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.json $(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.json
@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"
2016-02-19 13:33:16 +01:00
debian-install:
@echo "You have now to choose between:"
@echo " - make debian-install-for-apache"
@echo " - make ubuntu-install-for-apache"
@echo " - make debian-install-for-nginx"
@echo " - make ubuntu-install-for-nginx"
@echo
@echo "All packages will be built in /tmp/ but only those needed by the"
@echo "server you will choose will be installed"
@exit 1
debian-install-for-apache: debian-packages
perl -i -ne 'next if/fastcgi.*deb$$/;s/lemonldap-ng-fastcgi-server//;print' /tmp/lemonldap-ng_$(VERSION)*.changes
cd /tmp/lemonldap-ng-$(VERSION) && \
$(SU) debi
debian-install-for-nginx: debian-packages
cd /tmp/lemonldap-ng-$(VERSION) && \
$(SU) debi
ubuntu-install: debian-install
ubuntu-install-for-apache:
$(MAKE) debian-install-for-apache SU=sudo
ubuntu-install-for-nginx:
$(MAKE) debian-install-for-nginx SU=sudo
# Cleaning targets
# ----------------
distclean: clean
clean: common_clean handler_clean portal_clean manager_clean omegat-clean stop_web_server
@rm -f $$(find */ -name '*bak' -delete)
@rm -rf doc/devel
@rm -vf *gz *zip
@rm -rf lemonldap-ng-$(VERSION)
@echo "Cleaned"
common_clean:
2016-04-05 12:09:57 +02:00
-@if test -e ${SRCCOMMONDIR}/Makefile;then $(MAKE) -C ${SRCCOMMONDIR} distclean;fi
2016-02-19 13:33:16 +01:00
@rm -vf common*
handler_clean:
2016-04-05 12:09:57 +02:00
-@if test -e ${SRCHANDLERDIR}/Makefile;then $(MAKE) -C ${SRCHANDLERDIR} distclean;fi
2016-02-19 13:33:16 +01:00
@rm -vf handler*
portal_clean:
2016-04-05 12:09:57 +02:00
-@if test -e ${SRCPORTALDIR}/Makefile;then $(MAKE) -C ${SRCPORTALDIR} distclean;fi
2016-02-19 13:33:16 +01:00
@rm -vf portal*
manager_clean:
2016-04-05 12:09:57 +02:00
-@if test -e ${SRCMANAGERDIR}/Makefile;then $(MAKE) -C ${SRCMANAGERDIR} distclean;fi
2016-02-19 13:33:16 +01:00
@rm -vf manager*
# Perl libraries uninstall targets
# --------------------------------
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
2016-02-19 13:33:16 +01:00
# Packaging target
# ----------------
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)
@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)
2016-02-10 11:18:31 +01:00
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; \
2016-06-02 23:20:36 +02:00
rm -vf MANIFEST*; \
2010-01-23 13:48:18 +01:00
make 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
2016-02-19 13:33:16 +01:00
debian-local-packages: debian-packages
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 && \
2017-02-24 13:28:55 +01:00
debuild -us -uc
2016-02-19 13:33:16 +01:00
# Developper corner
# -----------------
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
2010-01-08 07:41:37 +01:00
diff: debian-diff
2009-12-17 11:26:59 +01:00
2017-01-03 18:23:38 +01:00
# TODO: change this
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/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)/site/htdocs/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
2016-02-26 12:17:33 +01:00
@$(DIFF) --ignore-matching-lines='set.*get.*' $(SRCCOMMONDIR)/scripts/lemonldap-ng-cli $(LMPREFIX)/bin/lemonldap-ng-cli ||true
2016-01-29 12:09:58 +01:00
test-diff:
@for file in `find lemonldap-ng-*/lib -type f`; do \
2016-01-29 12:09:58 +01:00
$(DIFF) $$file `echo $$file|sed -e s/lib/blib\\\/lib/`; \
done
2010-03-01 21:32:28 +01:00
tidy: clean
2017-01-30 17:22:39 +01:00
find lemon*/ -type f \( -name '*.pm' -or -name '*.pl' -or -name '*.fcgi' -or -name '*.t' \) -print -exec perltidy -b {} \;
2010-03-01 21:32:28 +01:00
find lemon*/ -name '*.bak' -delete
$(MAKE) json
2010-03-01 21:32:28 +01:00
2013-10-30 20:44:09 +01:00
tidy-js: clean
2016-05-25 07:13:38 +02:00
@find e2e-tests/ \
-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
2016-02-19 13:33:16 +01:00
# Translation targets
# -------------------
2016-02-29 07:23:40 +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:
2016-11-25 12:11:37 +01:00
@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
2016-11-25 12:11:37 +01:00
@omegat omegat.files/$(LANGCODE) --no-team --quiet
2013-11-09 13:03:47 +01:00
translated-doc: omegat-configuration-file
2016-11-25 12:11:37 +01:00
@omegat omegat.files/$(LANGCODE) --mode=console-translate --quiet 2>/dev/null
2013-11-09 13:03:47 +01:00
# 2. Public targets
%-translation: test_omegat_%_dir omegat-%-clean
2016-11-25 12:11:37 +01:00
@$(MAKE) translation LANGCODE=$* OMEGATCODE=`$(call language_code,$*)`
2013-11-09 13:03:47 +01:00
%-doc: test_omegat_%_dir omegat-%-clean
2016-11-25 12:11:37 +01:00
@mkdir -p po-doc/$*
@$(MAKE) translated-doc LANGCODE=$* OMEGATCODE=`$(call language_code,$*)`
omegat-clean:
2016-11-25 12:11:37 +01:00
@rm -rf omegat.files/*/omegat.project omegat.files/*/omegat/project_save*.bak
omegat-%-clean:
2016-11-25 12:11:37 +01: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
2016-11-27 09:06:19 +01:00
# Install doc directories
@install -v -d -m 755 $(RDOCDIR)/$*-doc
@cd po-doc/$* && find * -type d |(cd $(RDOCDIR)/$*-doc; xargs install -v -d -m 755) && cd -
# Install HTML files
@cd po-doc/$* && for f in `find * -type f -name '*.html'`; do \
echo "Installing $$f"; \
../../scripts/transform-templates \
usedebianlibs $(USEDEBIANLIBS) \
useexternallibs $(USEEXTERNALLIBS) \
jsminified $(JSCOMPRESS) \
cssminified $(CSSCOMPRESS) <$$f \
> $(RDOCDIR)/$*-doc/$$f; \
done && cd -
# Install other files
@cd po-doc/$* && for f in `find * -type f ! -name '*.html'`; do \
install -v -m 644 $$f $(RDOCDIR)/$*-doc/$$f; \
done && cd -
# Install symlinks (no symlinks)
@#cd po-doc/$* && tar cf - `find * -type l` | tar xvf - -C $(RDOCDIR)/$*-doc && cd -
# Remove js
@cd $(RDOCDIR)/$*-doc && if test "$(USEEXTERNALLIBS)" = "yes"; then \
rm -rvf $(DOCEXTERNALLIBS); \
elif test "$(USEDEBIANLIBS)" = "yes"; then \
rm -rvf $(DOCLIBSTOREMOVEFORDEBIAN); \
fi && cd -
2017-02-07 15:46:28 +01:00
html_spelling:
@for i in $$(find doc/ -type f -name '*.html'); do \
text=$$(html2text $$i|spellintian --picky); \
if [ "$$text" != "" ]; then echo "### $$i ###"; echo $$text; fi \
done
spelling:
@for i in $$(find * -type f -name '*.pm'); do \
if grep '=head1' $$i >/dev/null; then \
text=$$(pod2text $$i|spellintian --picky); \
if [ "$$text" != "" ]; then echo "### $$i ###"; echo $$text; fi \
fi \
done