lemonldap-ng/debian/rules

71 lines
2.4 KiB
Makefile
Executable File

#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
LMSHAREDIR=/usr/share/lemonldap-ng
LMVARDIR =/var/lib/lemonldap-ng
TMP = $(CURDIR)/debian/tmp
CONFDIR=/etc/lemonldap-ng
SESSIONSDIR=$(LMVARDIR)/sessions
CONFSTORAGEDIR=$(LMVARDIR)/conf
FIRSTCONFFILE=$(CONFSTORAGEDIR)/lmConf-1
LMINIFILE=$(CONFDIR)/lemonldap-ng.ini
CAPTCHADIR=$(LMVARDIR)/portal/captcha_output
%:
dh $@
override_dh_auto_configure:
$(MAKE) configure STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
PERLOPTIONS="INSTALLDIRS=vendor"
override_dh_auto_install:
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp \
PREFIX=/usr/ \
LMPREFIX=/usr/share/lemonldap-ng/ \
BINDIR=$(LMSHAREDIR)/bin/ \
DOCUMENTROOT=$(LMVARDIR) \
EXAMPLESDIR=/examples/ \
HANDLERDIR=$(LMVARDIR)/handler/ \
PORTALSKINSDIR=$(LMSHAREDIR)/portal-skins/ \
MANAGERSKINSDIR=$(LMSHAREDIR)/manager-skins/ \
SESSIONSEXPLORERDATADIR=$(LMSHAREDIR)/sessions-explorer-imgs/ \
STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
TOOLSDIR=$(LMSHAREDIR)/ressources/ \
CONFDIR=/etc/lemonldap-ng/ \
CRONDIR=/etc/cron.d/ \
DATADIR=$(LMVARDIR) \
APACHEUSER=www-data \
APACHEGROUP=www-data \
DOCDIR=/usr/share/doc/lemonldap-ng-doc
test -n "$$LOCALBUILD" || ./scripts/minifierjs $$(find debian/tmp/ -name '*.js')
test -n "$$LOCALBUILD" || ./scripts/minifiercss $$(find debian/tmp/ -name '*.css')
mkdir $(TMP)/$(LMSHAREDIR)/manager $(TMP)/$(LMSHAREDIR)/portal
mv $(TMP)/$(LMVARDIR)/portal/*.pl $(TMP)/$(LMSHAREDIR)/portal/
mv $(TMP)/$(LMVARDIR)/manager/*pl $(TMP)/$(LMSHAREDIR)/manager/
override_dh_compress:
dh_compress -X favicon.ico
# Fix lemonldap-ng dirs permissions and owner since dh_fixperms change them:
# * global configuration dirs must be writable by www-data but not readable
# by all (also sessions, captcha,... dirs)
# * lemonldap-ng.ini must not be readable by all
override_dh_fixperms:
dh_fixperms
chown www-data:www-data \
debian/*/$(SESSIONSDIR) \
debian/*/$(SESSIONSDIR)/lock \
debian/liblemonldap-ng-conf-perl/$(CONFSTORAGEDIR) \
debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR)
chgrp www-data debian/liblemonldap-ng-conf-perl/$(LMINIFILE) \
debian/liblemonldap-ng-conf-perl/$(FIRSTCONFFILE)
chmod 770 debian/*/$(SESSIONSDIR) debian/*/$(SESSIONSDIR)/lock
chmod 750 debian/liblemonldap-ng-conf-perl/$(CONFSTORAGEDIR)
chmod 640 debian/liblemonldap-ng-conf-perl/$(FIRSTCONFFILE) \
debian/liblemonldap-ng-conf-perl/$(LMINIFILE)