Makefile 16 KB
Newer Older
1 2
#!/usr/bin/make

3 4 5
# Prefix for packaging
DESTDIR=

6
PERL=$$(which perl)
7 8 9 10 11
# Perl options
#PERLOPTIONS="INSTALLDIRS=vendor"
PERLOPTIONS=

# Default directories install
12 13 14
PREFIX=/usr/local
LMPREFIX=$(PREFIX)/lemonldap-ng
RLMPREFIX=$(DESTDIR)/$(LMPREFIX)
15
# BIN dirs
16 17 18 19
BINDIR=$(LMPREFIX)/bin
RBINDIR=$(DESTDIR)/$(BINDIR)
DATADIR=$(LMPREFIX)/data
RDATADIR=$(DESTDIR)/$(DATADIR)
20 21


22
EXAMPLEROOT=`pwd`/example
23 24

# Document roots for Apache VirtualHosts
25 26 27 28 29 30 31 32 33 34 35
DOCUMENTROOT=$(LMPREFIX)/htdocs
PORTALDIR=$(DOCUMENTROOT)/portal
RPORTALDIR=$(DESTDIR)/$(PORTALDIR)
PORTALSKINSDIR=$(PORTALDIR)/skins
RPORTALSKINSDIR=$(DESTDIR)/$(PORTALSKINSDIR)
LASPPORTALDIR=$(DOCUMENTROOT)/liberty-alliance-sp-portal
RLASPPORTALDIR=$(DESTDIR)/$(LASPPORTALDIR)
MANAGERDIR=$(DOCUMENTROOT)/manager
RMANAGERDIR=$(DESTDIR)/$(MANAGERDIR)
MANAGERDATADIR=$(MANAGERDIR)/imgs
RMANAGERDATADIR=$(DESTDIR)/$(MANAGERDATADIR)
36
SESSIONSEXPLORERDIR=$(MANAGERDIR)
37 38 39 40 41 42 43 44 45 46 47
RSESSIONSEXPLORERDIR=$(DESTDIR)/$(SESSIONSEXPLORERDIR)
SESSIONSEXPLORERDATADIR=$(SESSIONSEXPLORERDIR)/images
RSESSIONSEXPLORERDATADIR=$(DESTDIR)/$(SESSIONSEXPLORERDATADIR)
DOCDIR=$(DOCUMENTROOT)/doc
RDOCDIR=$(DESTDIR)/$(DOCDIR)
TESTDIR=$(DOCUMENTROOT)/test
RTESTDIR=$(DESTDIR)/$(TESTDIR)
EXAMPLESDIR=$(LMPREFIX)/examples
REXAMPLESDIR=$(DESTDIR)/$(EXAMPLESDIR)
TOOLSDIR=$(LMPREFIX)/tools
RTOOLSDIR=$(DESTDIR)/$(TOOLSDIR)
48 49

# Handler dir
50 51
HANDLERDIR=$(LMPREFIX)/handler
RHANDLERDIR=$(DESTDIR)/$(HANDLERDIR)
52 53

# Configuration dir
54 55 56 57 58
CONFDIR=$(LMPREFIX)/etc
RCONFDIR=$(DESTDIR)/$(CONFDIR)
CRONDIR=$(LMPREFIX)/etc/cron.d
RCRONDIR=$(DESTDIR)/$(CRONDIR)
STORAGECONFFILE=$(CONFDIR)/storage.conf
59 60

# Lemonldap-ng configuration storage dir
61 62
FILECONFIGDIR=$(DATADIR)/conf
RFILECONFIGDIR=$(DESTDIR)/$(FILECONFIGDIR)
63 64

# Apache::Session::File storage dir
65 66 67 68
APACHESESSIONFILEDIR=$(DATADIR)/sessions
RAPACHESESSIONFILEDIR=$(DESTDIR)/$(APACHESESSIONFILEDIR)
APACHESESSIONFILELOCKDIR=$(APACHESESSIONFILEDIR)/lock
RAPACHESESSIONFILELOCKDIR=$(DESTDIR)/$(APACHESESSIONFILELOCKDIR)
69 70 71
APACHEUSER=
APACHEGROUP=

72
# DNS Domain for cookie and virtual hosts
73 74
DNSDOMAIN=example.com

75
# LDAP parameters
76 77 78 79
LDAPHOST=localhost
LDAPPORT=389
LDAPSUFFIX=dc=example,dc=net

80
# Other
81
VERSION=`head -n1 changelog |sed -e 's/lemonldap-ng (//' -e 's/).*$$//'`
82 83 84 85
SRCCOMMONDIR=lemonldap-ng-common
SRCHANDLERDIR=lemonldap-ng-handler
SRCPORTALDIR=lemonldap-ng-portal
SRCMANAGERDIR=lemonldap-ng-manager
86 87
EXAMPLELANG=en # For static Manager example only

88
all:	configure common handler manager portal
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
	@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 :"
	@echo "   - install_doc_site      ($(DOCDIR))"
	@echo "   - install_examples_site ($(EXAMPLESDIR))"
	@echo
117

118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
#
# Perl libraries configuration
#
configure:	common_conf handler_conf portal_conf manager_conf

common_conf:
	@cd ${SRCCOMMONDIR}; LMNGCONFFILE=$(STORAGECONFFILE) perl Makefile.PL $(PERLOPTIONS)
	@touch common_conf

handler_conf:
	@cd ${SRCHANDLERDIR}; perl Makefile.PL $(PERLOPTIONS)
	@touch handler_conf

portal_conf:
	@cd ${SRCPORTALDIR}; perl Makefile.PL $(PERLOPTIONS)
	@touch portal_conf

manager_conf:
	@cd ${SRCMANAGERDIR}; perl Makefile.PL $(PERLOPTIONS)
	@touch manager_conf
138

139 140 141
#
# Perl libraries make
#
142 143 144
common:		common_conf
	@$(MAKE) -C ${SRCCOMMONDIR}
	@touch common
145 146

handler:	handler_conf
147
	@$(MAKE) -C ${SRCHANDLERDIR}
148
	@touch handler
149 150

portal:		portal_conf
151
	@$(MAKE) -C ${SRCPORTALDIR}
152
	@touch portal
153 154

manager:	manager_conf
155
	@$(MAKE) -C ${SRCMANAGERDIR}
156
	@touch manager
157

158 159 160 161 162 163
test:		common handler portal manager common_test handler_test portal_test manager_test

common_test:	common
	@$(MAKE) -C ${SRCCOMMONDIR} test

handler_test:	handler common_test
164
	@$(MAKE) -C ${SRCHANDLERDIR} test FULLPERL="$(PERL) -I../${SRCCOMMONDIR}/blib/lib/"
165

166
portal_test:	portal handler_test common_test
167
	@$(MAKE) -C ${SRCPORTALDIR} test FULLPERL="$(PERL) -I../${SRCCOMMONDIR}/blib/lib/ -I../${SRCHANDLERDIR}/blib/lib/"
168

169
manager_test:	manager handler_test common_test
170
	@$(MAKE) -C ${SRCMANAGERDIR} test FULLPERL="$(PERL) -I../${SRCCOMMONDIR}/blib/lib/ -I../${SRCHANDLERDIR}/blib/lib/"
171

172 173 174 175
#
# INSTALL
#
install:	install_libs install_bin install_site
176

177 178 179
#
# Perl libraires install
#
180
install_libs:	common_install_libs install_handler_libs install_portal_libs install_manager_libs
181 182

common_install_libs:		common
183
	@$(MAKE) -C ${SRCCOMMONDIR} install
184

185
install_handler_libs:	handler
186
	@$(MAKE) -C ${SRCHANDLERDIR} install
187

188
install_portal_libs:		portal
189
	@$(MAKE) -C ${SRCPORTALDIR} install
190

191
install_manager_libs:	manager
192
	@$(MAKE) -C ${SRCMANAGERDIR} install
193

194
example:
195
	$(MAKE) install_site LMPREFIX=$(EXAMPLEROOT)
196 197

install_bin:	install_libs install_conf_dir
198 199
	# Binary install
	@install -v -d $(RBINDIR)
200 201 202 203 204
	@cp --preserve=mode --remove-destination \
		${SRCPORTALDIR}/example/scripts/purgeCentralCache \
		${SRCCOMMONDIR}/scripts/lmConfig_File2MySQL \
		${SRCMANAGERDIR}/example/scripts/lmConfigEditor \
			$(RBINDIR)
205 206 207 208

#
# SITE INSTALL
#
209
install_site:	install_manager_site install_portal_site install_handler_site install_test_site install_examples_site install_doc_site
210
	# Site install
211 212 213
	@install -v -d $(RCONFDIR)
	# Apache configuration files
	@cp --remove-destination _example/etc/apache* $(RCONFDIR)
214
	@perl -i -pe 's#__HANDLER__#${HANDLERDIR}/MyHandler.pm#; \
215
		s/__DNSDOMAIN__/$(DNSDOMAIN)/g; \
216 217 218 219
		s#__PORTALDIR__#$(PORTALDIR)/#g; \
		s#__MANAGERDIR__#$(MANAGERDIR)/#g; \
		s#__TESTDIR__#$(TESTDIR)/#g; \
		s#__DOCDIR__#$(DOCDIR)/#g;' $(RCONFDIR)/apache*
220 221
	# File for /etc/hosts inclusion
	@cp --remove-destination _example/etc/for_etc_hosts $(RCONFDIR)
222
	@perl -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)/for_etc_hosts
223 224
	#
	@echo
225
	@echo "LemonLDAP::NG v${VERSION} is installed with these parameters:"
226 227 228 229 230 231 232 233 234 235 236
	@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"
237
	@echo "      include ${CONFDIR}/apache.conf"
238
	@echo "    or with Apache-2.x:"
239
	@echo "      include ${CONFDIR}/apache2.conf"
240 241 242 243 244 245
	@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."
246
	@echo "    Edit ${RCONFDIR}/apps/apps-list.xml to modify the menu."
247 248 249 250 251 252 253
	@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
254 255 256 257 258 259 260 261

install_manager_site:	install_conf_dir
	# Manager install
	@install -v -d ${RMANAGERDIR} ${RMANAGERDATADIR} \
		${RSESSIONSEXPLORERDIR} $(RSESSIONSEXPLORERDATADIR) \
		$(RCONFDIR)
	@find ${RMANAGERDIR} -type l -name imgs -delete
	@find ${RMANAGERDIR} -type l -name images -delete
262 263 264 265 266 267
	@cp -pR --remove-destination ${SRCMANAGERDIR}/example/* ${RMANAGERDIR}
	@rm -rf $$(find ${RMANAGERDIR} -type d -name .svn) ${RMANAGERDIR}/scripts ${RMANAGERDIR}/mrtg ${RMANAGERDIR}/soapserver.pl
	@if [ "${RMANAGERDIR}/imgs/" != "${RMANAGERDATADIR}/" ]; then \
		mv -f ${RMANAGERDIR}/imgs/* ${RMANAGERDATADIR}/; \
		rm -rf ${RMANAGERDIR}/imgs; \
		ln -s $$(echo ${MANAGERDATADIR} | sed -e 's/\/$$//') ${RMANAGERDIR}/imgs; \
268 269
	fi
	# apply.conf install
270 271 272
	@mv ${RMANAGERDIR}/apply.conf $(RCONFDIR)
	@perl -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)/apply.conf
	@perl -i -pe 's#__APPLYCONFFILE__#$(CONFDIR)/apply.conf#' ${RMANAGERDIR}/index.pl
273
	# Sessions explorer install
274 275 276 277 278
	@if [ "${MANAGERDIR}" != "$(SESSIONSEXPLORERDIR)" ]; then mv -f ${RMANAGERDIR}/sessions.pl $(RSESSIONSEXPLORERDIR); fi
	@if [ "${MANAGERDIR}/images/" != "${SESSIONSEXPLORERDATADIR}/" ]; then \
		mv -f ${RMANAGERDIR}/images/* ${RSESSIONSEXPLORERDATADIR}; \
		rm -rf ${RMANAGERDIR}/images; \
		ln -s $$(echo ${SESSIONSEXPLORERDATADIR} | sed -e 's/\/$$//') ${RMANAGERDIR}/images; \
279
	fi
280 281 282
	@rm -rf $$(find ${RMANAGERDIR} ${RMANAGERDATADIR} \
		${RSESSIONSEXPLORERDIR} $(RSESSIONSEXPLORERDATADIR) \
		$(RCONFDIR) -type d -name .svn)
283 284 285 286

install_portal_site:	install_conf_dir
	# Portal install
	@install -v -d $(RPORTALDIR) $(RPORTALSKINSDIR) \
287
		$(RPORTALDIR)/skins/ $(RLASPPORTALDIR) \
288 289
		$(RCRONDIR) $(RCONFDIR)
	@for skin in $$(ls lemonldap-ng-portal/example/skins/); do \
290 291
		[ -h $(RPORTALDIR)/skins/$$skin ] && rm -f $(RPORTALDIR)/skins/$$skin; \
		install -v -d $(RPORTALSKINSDIR)/$$skin; \
292
	done
293 294 295 296 297 298 299
	@cp -pR --remove-destination ${SRCPORTALDIR}/example/index_skin.pl ${RPORTALDIR}/index.pl
	@cp -pR --remove-destination ${SRCPORTALDIR}/example/error.pl ${RPORTALDIR}
	@cp -pR --remove-destination ${SRCPORTALDIR}/example/apps ${RPORTALDIR}
	@perl -i -pe 's#__SKINDIR__#$(PORTALDIR)/skins#; \
		s#__APPSXMLFILE__#$(CONFDIR)/apps-list.xml#;' ${RPORTALDIR}/index.pl ${RPORTALDIR}/error.pl
	@cp -pR --remove-destination ${SRCPORTALDIR}/example/skins/* $(RPORTALSKINSDIR)
	@if [ "$(PORTALDIR)/skins/" != "$(PORTALSKINSDIR)/" ]; then \
300
		for skin in $$(ls lemonldap-ng-portal/example/skins/); do \
301 302
			rm -rf $(RPORTALDIR)/skins/$$skin/; \
			ln -s $(PORTALSKINSDIR)/$$skin $(RPORTALDIR)/skins/$$skin; \
303 304 305
		done; \
	fi
	@cp --remove-destination _example/etc/apps-list* $(RCONFDIR)
306
	@perl -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)/apps-list.xml
307
	# L-A portal install
308 309
	@cp -pR --remove-destination ${SRCPORTALDIR}/example/AuthLA/* $(RLASPPORTALDIR)
	@perl -i -pe 's#__DIR__#$(LASPPORTALDIR)/#g' $(RLASPPORTALDIR)/index.pl
310 311 312
	# Cron files
	@cp --remove-destination lemonldap-ng-portal/example/scripts/purgeCentralCache.cron.d $(RCRONDIR)
	# Clean SVN files
313
	@rm -rf $$(find ${RPORTALDIR} $(RPORTALSKINSDIR) $(RLASPPORTALDIR) $(RCRONDIR) $(RCONFDIR) -type d -name .svn)
314 315

install_handler_site:	install_conf_dir
316
	# Handler install
317 318
	@install -v -d ${RHANDLERDIR}
	@cp --remove-destination ${SRCHANDLERDIR}/example/MyHandler.pm ${RHANDLERDIR}
319
	@rm -rf $$(find $(RHANDLERDIR) -type d -name .svn)
320 321

install_test_site:
322
	# Test site install
323 324
	@install -v -d $(RTESTDIR)
	@cp -pR --remove-destination _example/test/* $(RTESTDIR)
325
	@rm -rf $$(find $(RTESTDIR) -type d -name .svn)
326
	@perl -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RTESTDIR)/index.pl
327
	@rm -rf $$(find $(RTESTDIR) -type d -name .svn)
328 329

install_examples_site:
330
	# Examples install
331
	@install -v -d $(REXAMPLESDIR)
332
	@for i in manager portal handler; do \
333 334
		cp -dpR --remove-destination lemonldap-ng-$$i/example $(REXAMPLESDIR)/$$i; \
	done
335 336 337
	@rm -rf $(REXAMPLESDIR)/portal/skins \
		$(REXAMPLESDIR)/manager/imgs \
		$(REXAMPLESDIR)/manager/images \
338
	@rm -rf $$(find $(REXAMPLESDIR) -type d -name .svn)
339 340 341 342 343 344
	@perl -i -pe 's#__DIR__#$(LASPPORTALDIR)#g' $(REXAMPLESDIR)/portal/AuthLA/index.pl
	@perl -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(REXAMPLESDIR)/manager/apply.conf
	@perl -i -pe 's#__APPLYCONFFILE__#$(CONFDIR)/apply.conf#' $(REXAMPLESDIR)/manager/*.pl
	@perl -i -pe 's#__SKINDIR__#$(PORTALDIR)/skins#; \
		s#__APPSXMLFILE__#$(CONFDIR)/apps-list.xml#; \
		s#__SESSIONDIR__#$(APACHESESSIONFILEDIR)/#g;' $(REXAMPLESDIR)/portal/*.pl
345

346 347 348 349
install_doc_site:
	@install -v -d $(RDOCDIR)
	@cp -R --remove-destination doc/* $(RDOCDIR)

350
install_conf_dir:	install_sessions_dir
351
	# Configuration files install
352
	@install -v -d $(RCONFDIR) $(RFILECONFIGDIR) $(RTOOLSDIR)
353 354
	@cp --remove-destination $(SRCCOMMONDIR)/storage.conf $(RCONFDIR)
	@perl -i -pe 's#^dirName = .*#dirName = $(FILECONFIGDIR)#g' $(RCONFDIR)/storage.conf
355
	@cp _example/conf/lmConf-1 $(RFILECONFIGDIR)
356
	@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
357 358 359 360
	@perl -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g;\
		s/__LDAPPORT__/$(LDAPPORT)/g;\
		s/__LDAPHOST__/$(LDAPHOST)/g;\
		s/__LDAPSUFFIX__/$(LDAPSUFFIX)/g;\
361
		s#__SESSIONDIR__#$(APACHESESSIONFILEDIR)#g;' $(RFILECONFIGDIR)/lmConf-1
362 363 364 365 366 367 368 369 370
	@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
371
	@cp lemonldap-ng-common/tools/lmConfig.mysql lemonldap-ng-common/tools/apache-session-mysql.sql $(RTOOLSDIR)
372
	@rm -rf $$(find $(RCONFDIR) $(RFILECONFIGDIR) $(RTOOLSDIR) -type d -name .svn)
373 374 375 376 377

install_sessions_dir:
	@install -m 777 -v -d $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR)
	# Fix Apache::Session directories permissions
	@if [ "$(APACHEUSER)" != "" ]; then \
378
		chown $(APACHEUSER) $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR) || exit 1; \
379
		if [ "$(APACHEGROUP)" != "" ]; then \
380
			chgrp $(APACHEGROUP) $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR) || exit 1; \
381 382 383 384 385 386
		fi; \
		chmod 770 $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR); \
	else \
		chmod 777 $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR); \
	fi

387
postconf_hosts:
388
	@cat ${SYSTEMCONFDIR}/for_etc_hosts >> /etc/hosts
389 390
	@echo "/etc/hosts was updated"

391
postconf: postconf_hosts
392 393
	@echo "Post configuration done"

394 395
uninstall:	configure handler_uninstall portal_uninstall manager_uninstall

396 397 398 399
common_uninstall:	common
	@$(MAKE) -C ${SRCCOMMONDIR} uninstall
	@rm -vf common_uninstall

400
handler_uninstall:	handler
401
	@$(MAKE) -C ${SRCHANDLERDIR} uninstall
402
	@rm -vf handler_uninstall
403 404

portal_uninstall:		portal
405
	@$(MAKE) -C ${SRCPORTALDIR} uninstall
406
	@rm -vf portal_uninstall
407 408

manager_uninstall:	manager
409
	@$(MAKE) -C ${SRCMANAGERDIR} uninstall
410
	@rm -vf manager_uninstall
411

412
dist:	clean
413
	@mkdir -p lemonldap-ng-$(VERSION)
414
	@- cp -pR lemonldap-ng-common/ lemonldap-ng-manager/ lemonldap-ng-portal/ lemonldap-ng-handler/ * lemonldap-ng-$(VERSION)
415 416 417 418
	@- dir=lemonldap-ng-$(VERSION); find $$dir -name .svn -exec rm -rf {} \; 2>/dev/null
	@rm -rf lemonldap-ng-$(VERSION)/lemonldap-ng-$(VERSION)
	@tar czf lemonldap-ng-$(VERSION).tar.gz lemonldap-ng-$(VERSION)
	@rm -rf lemonldap-ng-$(VERSION)
419

420
debian-dist:	dist
421
	@mv lemonldap-ng-$(VERSION).tar.gz lemonldap-ng_$(VERSION).orig.tar.gz
422

423 424 425 426 427
cpan:	clean configure common_cpan handler_cpan portal_cpan manager_cpan

common_cpan:	common_conf
	@$(MAKE) -C ${SRCCOMMONDIR} dist
	@mv ${SRCCOMMONDIR}/Lemonldap*.gz .
428 429

handler_cpan:	handler_conf
430 431
	@$(MAKE) -C ${SRCHANDLERDIR} dist
	@mv ${SRCHANDLERDIR}/Lemonldap*.gz .
432 433

portal_cpan:		portal_conf
434 435
	@$(MAKE) -C ${SRCPORTALDIR} dist
	@mv ${SRCPORTALDIR}/Lemonldap*.gz .
436 437

manager_cpan:	manager_conf
438 439
	@$(MAKE) -C ${SRCMANAGERDIR} dist
	@mv ${SRCMANAGERDIR}/Lemonldap*.gz .
440 441

static_example:	example
442 443 444
	@mkdir -p ${EXAMPLESDIR}/static
	@cd ${EXAMPLESDIR}/static/;cp -a ../manager/{imgs,theme} .;cd -
	@../scripts/make_static_example.pl ${DESTMANAGERDIR}/index.pl ${SCRIPTSDIR}/static/index.html $(EXAMPLELANG)
445

446
documentation:
447
	@cd doc/ && ../scripts/doc.pl
448

449 450 451
doxygen:	clean
	doxygen Doxyfile

452 453 454
distclean:	clean

clean:		common_clean handler_clean portal_clean manager_clean
455
	@rm -rf $(EXAMPLEROOT) example/ doc/devel
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473
	@rm -vf *gz

common_clean:
	- $(MAKE) -C ${SRCCOMMONDIR} distclean
	@rm -vf common*

handler_clean:
	- $(MAKE) -C ${SRCHANDLERDIR} distclean
	@rm -vf handler*

portal_clean:
	- $(MAKE) -C ${SRCPORTALDIR} distclean
	@rm -vf portal*

manager_clean:
	- $(MAKE) -C ${SRCMANAGERDIR} distclean
	@rm -vf manager*