rules 2.44 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
12
13
14
15
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
16

Yadd's avatar
Yadd committed
17
18
%:
	dh $@
19

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

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

44
45
	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
46

Yadd's avatar
Yadd committed
47
48
49
50
51
52
	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
53

54
55
56
57
58
59
60
61
62
# 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 \
63
		debian/liblemonldap-ng-common-perl/$(CONFSTORAGEDIR) \
64
		debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR)
65
66
	chgrp www-data debian/liblemonldap-ng-common-perl/$(LMINIFILE) \
		debian/liblemonldap-ng-common-perl/$(FIRSTCONFFILE)
67
	chmod 770 debian/*/$(SESSIONSDIR) debian/*/$(SESSIONSDIR)/lock
68
69
70
	chmod 750 debian/liblemonldap-ng-common-perl/$(CONFSTORAGEDIR)
	chmod 640 debian/liblemonldap-ng-common-perl/$(FIRSTCONFFILE) \
		debian/liblemonldap-ng-common-perl/$(LMINIFILE)