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

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

Yadd's avatar
Yadd committed
19
%:
20
	dh $@ --with systemd
21

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

26
override_dh_auto_build:
27
	$(MAKE) all
28

Yadd's avatar
Yadd committed
29
override_dh_auto_install:
Yadd's avatar
Yadd committed
30
	$(MAKE) install \
31
			DESTDIR=$(CURDIR)/debian/tmp \
32
			PREFIX=/usr \
Yadd's avatar
Typo    
Yadd committed
33
			LMPREFIX=/usr/share/lemonldap-ng \
34
			BINDIR=$(LMSHAREDIR)/bin \
Yadd's avatar
Yadd committed
35
			SBINDIR=/usr/sbin \
Yadd's avatar
Yadd committed
36
			FASTCGISOCKDIR=/var/run/llng-fastcgi-server \
37
			DOCUMENTROOT=$(LMVARDIR) \
38
39
40
			EXAMPLESDIR=/examples \
			HANDLERDIR=$(LMVARDIR)/handler \
			MANAGERDIR=$(LMSHAREDIR)/manager \
Yadd's avatar
Yadd committed
41
			PORTALDIR=$(LMSHAREDIR)/portal \
Yadd's avatar
Yadd 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 \
Yadd's avatar
Yadd committed
48
			APACHEGROUP=www-data \
49
			DEFDOCDIR=/usr/share/doc/lemonldap-ng-doc \
Yadd's avatar
Yadd committed
50
			UWSGIYAMLDIR=/etc/uwsgi/apps-available \
51
			PROD=yes
Yadd's avatar
Yadd committed
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
Yadd's avatar
Yadd 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)
Yadd's avatar
Yadd committed
75
	chmod 770 debian/*/$(SESSIONSDIR) debian/*/$(SESSIONSDIR)/lock \
76
	        debian/*/$(PSESSIONSDIR) debian/*/$(PSESSIONSDIR)/lock \
Yadd's avatar
Yadd committed
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)