rules 3.04 KB
Newer Older
1 2 3 4 5
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

Xavier Guimard's avatar
Xavier Guimard committed
6
LMSHAREDIR=/usr/share/lemonldap-ng
Xavier Guimard's avatar
Xavier Guimard committed
7 8 9 10 11
LMVARDIR  =/var/lib/lemonldap-ng
TMP       = $(CURDIR)/debian/tmp

CONFDIR=/etc/lemonldap-ng
SESSIONSDIR=$(LMVARDIR)/sessions
12
PSESSIONSDIR=$(LMVARDIR)/psessions
13
NOTIFICATIONSDIR=$(LMVARDIR)/notifications
Xavier Guimard's avatar
Xavier Guimard committed
14 15 16
CONFSTORAGEDIR=$(LMVARDIR)/conf
FIRSTCONFFILE=$(CONFSTORAGEDIR)/lmConf-1
LMINIFILE=$(CONFDIR)/lemonldap-ng.ini
17 18
CAPTCHADIR=$(LMVARDIR)/captcha
CAPTCHAOUTPUTDIR=$(LMVARDIR)/portal/captcha_output
19

Xavier Guimard's avatar
Xavier Guimard committed
20 21
%:
	dh $@
22

Xavier Guimard's avatar
Xavier Guimard committed
23
override_dh_auto_configure:
Xavier Guimard's avatar
Xavier Guimard committed
24
	$(MAKE) configure STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
Xavier Guimard's avatar
Xavier Guimard committed
25
		PERLOPTIONS="INSTALLDIRS=vendor"
26

Xavier Guimard's avatar
Xavier Guimard committed
27
override_dh_auto_install:
28 29
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp \
			PREFIX=/usr/ \
Xavier Guimard's avatar
Xavier Guimard committed
30
			LMPREFIX=/usr/share/lemonldap-ng/ \
Xavier Guimard's avatar
Xavier Guimard committed
31
			BINDIR=$(LMSHAREDIR)/bin/ \
32 33
			DOCUMENTROOT=$(LMVARDIR) \
			EXAMPLESDIR=/examples/ \
Xavier Guimard's avatar
Xavier Guimard committed
34 35 36 37
			HANDLERDIR=$(LMVARDIR)/handler/ \
			PORTALSKINSDIR=$(LMSHAREDIR)/portal-skins/ \
			MANAGERSKINSDIR=$(LMSHAREDIR)/manager-skins/ \
			SESSIONSEXPLORERDATADIR=$(LMSHAREDIR)/sessions-explorer-imgs/ \
Xavier Guimard's avatar
Xavier Guimard committed
38
			STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
Xavier Guimard's avatar
Xavier Guimard committed
39
			TOOLSDIR=$(LMSHAREDIR)/ressources/ \
40 41 42 43
			CONFDIR=/etc/lemonldap-ng/ \
			CRONDIR=/etc/cron.d/ \
			DATADIR=$(LMVARDIR) \
			APACHEUSER=www-data \
Xavier Guimard's avatar
Xavier Guimard committed
44
			APACHEGROUP=www-data \
Xavier Guimard's avatar
Xavier Guimard committed
45
			DOCDIR=/usr/share/doc/lemonldap-ng-doc
46
	$(MAKE) fr-doc
47 48
	test -n "$$LOCALBUILD" || ./scripts/minifierjs $$(find debian/tmp/ -name '*.js')
	test -n "$$LOCALBUILD" || ./scripts/minifiercss $$(find debian/tmp/ -name '*.css')
Xavier Guimard's avatar
Xavier Guimard committed
49

Xavier Guimard's avatar
Xavier Guimard committed
50 51 52 53 54 55
	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
56

57 58 59 60 61 62 63 64 65
# 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 \
66 67
		debian/*/$(PSESSIONSDIR) \
		debian/*/$(PSESSIONSDIR)/lock \
68
		debian/*/$(NOTIFICATIONSDIR) \
69
		debian/liblemonldap-ng-common-perl/$(CONFSTORAGEDIR) \
70 71 72
		debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR) \
		debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR)/data \
		debian/liblemonldap-ng-portal-perl/$(CAPTCHAOUTPUTDIR)
73 74
	chgrp www-data debian/liblemonldap-ng-common-perl/$(LMINIFILE) \
		debian/liblemonldap-ng-common-perl/$(FIRSTCONFFILE)
Xavier Guimard's avatar
Xavier Guimard committed
75
	chmod 770 debian/*/$(SESSIONSDIR) debian/*/$(SESSIONSDIR)/lock \
76
	        debian/*/$(PSESSIONSDIR) debian/*/$(PSESSIONSDIR)/lock \
Xavier Guimard's avatar
Xavier Guimard committed
77 78
		debian/*/$(NOTIFICATIONSDIR) \
		debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR) \
79 80
		debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR)/data \
		debian/liblemonldap-ng-portal-perl/$(CAPTCHAOUTPUTDIR)
81 82 83
	chmod 750 debian/liblemonldap-ng-common-perl/$(CONFSTORAGEDIR)
	chmod 640 debian/liblemonldap-ng-common-perl/$(FIRSTCONFFILE) \
		debian/liblemonldap-ng-common-perl/$(LMINIFILE)