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

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

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
CONFSTORAGEDIR=$(LMVARDIR)/conf
15
FIRSTCONFFILE=$(CONFSTORAGEDIR)/lmConf-1.json
Xavier Guimard's avatar
Xavier Guimard committed
16
LMINIFILE=$(CONFDIR)/lemonldap-ng.ini
17
CAPTCHADIR=$(LMVARDIR)/captcha
18

19
%:
20
	dh $@ --with systemd
21

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

26
override_dh_auto_build:
27
	$(MAKE) all
28

29
override_dh_auto_install:
Xavier Guimard's avatar
Xavier Guimard committed
30
	$(MAKE) install \
31
			DESTDIR=$(CURDIR)/debian/tmp \
32
			PREFIX=/usr \
Xavier Guimard's avatar
Xavier Guimard committed
33
			LMPREFIX=/usr/share/lemonldap-ng \
34
			BINDIR=$(LMSHAREDIR)/bin \
35
			SBINDIR=/usr/sbin \
36
			FASTCGISOCKDIR=/var/run/llng-fastcgi-server \
37
			DOCUMENTROOT=$(LMVARDIR) \
38 39 40
			EXAMPLESDIR=/examples \
			HANDLERDIR=$(LMVARDIR)/handler \
			MANAGERDIR=$(LMSHAREDIR)/manager \
41
			PORTALDIR=$(LMSHAREDIR)/portal \
Xavier Guimard's avatar
Xavier Guimard committed
42
			STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
43 44 45
			TOOLSDIR=$(LMSHAREDIR)/ressources \
			CONFDIR=/etc/lemonldap-ng \
			CRONDIR=/etc/cron.d \
46 47
			DATADIR=$(LMVARDIR) \
			APACHEUSER=www-data \
48
			APACHEGROUP=www-data \
49
			DEFDOCDIR=/usr/share/doc/lemonldap-ng-doc \
Xavier Guimard's avatar
Xavier Guimard committed
50
			UWSGIYAMLDIR=/etc/uwsgi/apps-available \
51
			PROD=yes
52 53 54
	for i in handler portal manager test; do \
		mv $(TMP)/etc/lemonldap-ng/$$i-apache2.X.conf $(TMP)/etc/lemonldap-ng/$$i-apache2.conf; \
	done
Xavier Guimard's avatar
Xavier Guimard committed
55 56 57

override_dh_compress:
	dh_compress -X favicon.ico
58

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