rules 2.73 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
15
16
CONFSTORAGEDIR=$(LMVARDIR)/conf
FIRSTCONFFILE=$(CONFSTORAGEDIR)/lmConf-1
LMINIFILE=$(CONFDIR)/lemonldap-ng.ini
17
CAPTCHADIR=$(LMVARDIR)/captcha
18

Yadd's avatar
Yadd committed
19
20
%:
	dh $@
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

Yadd's avatar
Yadd committed
26
override_dh_auto_install:
27
28
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp \
			PREFIX=/usr/ \
Yadd's avatar
Yadd committed
29
			LMPREFIX=/usr/share/lemonldap-ng/ \
Yadd's avatar
Yadd committed
30
			BINDIR=$(LMSHAREDIR)/bin/ \
31
32
			DOCUMENTROOT=$(LMVARDIR) \
			EXAMPLESDIR=/examples/ \
Yadd's avatar
Yadd committed
33
34
35
36
			HANDLERDIR=$(LMVARDIR)/handler/ \
			PORTALSKINSDIR=$(LMSHAREDIR)/portal-skins/ \
			MANAGERSKINSDIR=$(LMSHAREDIR)/manager-skins/ \
			SESSIONSEXPLORERDATADIR=$(LMSHAREDIR)/sessions-explorer-imgs/ \
Yadd's avatar
Yadd committed
37
			STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
Yadd's avatar
Yadd committed
38
			TOOLSDIR=$(LMSHAREDIR)/ressources/ \
39
40
41
42
			CONFDIR=/etc/lemonldap-ng/ \
			CRONDIR=/etc/cron.d/ \
			DATADIR=$(LMVARDIR) \
			APACHEUSER=www-data \
Yadd's avatar
Yadd committed
43
			APACHEGROUP=www-data \
44
45
			DEFDOCDIR=/usr/share/doc/lemonldap-ng-doc \
			FRDOCDIR=/usr/share/doc/lemonldap-ng-fr-doc
46

47
48
	test -n "$$LOCALBUILD" || ./scripts/minifierjs $$(find debian/tmp/ -name '*.js')
	test -n "$$LOCALBUILD" || ./scripts/minifiercss $$(find debian/tmp/ -name '*.css')
Yadd's avatar
Yadd committed
49

Yadd's avatar
Yadd committed
50
51
52
53
54
	mkdir $(TMP)/$(LMSHAREDIR)/manager $(TMP)/$(LMSHAREDIR)/portal
	mv $(TMP)/$(LMVARDIR)/portal/*.pl $(TMP)/$(LMSHAREDIR)/portal/

override_dh_compress:
	dh_compress -X favicon.ico
55

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