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

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
15
FIRSTCONFFILE=$(CONFSTORAGEDIR)/lmConf-1.js
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
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
41
			EXAMPLESDIR=/examples \
			HANDLERDIR=$(LMVARDIR)/handler \
			PORTALSKINSDIR=$(LMSHAREDIR)/portal-skins \
			MANAGERDIR=$(LMSHAREDIR)/manager \
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 \
50
51
			FRDOCDIR=/usr/share/doc/lemonldap-ng-fr-doc \
			PROD=yes
Yadd's avatar
Yadd committed
52
53
54
55
	$(MAKE) install_fr_doc_site \
			DESTDIR=$(CURDIR)/debian/tmp \
			DOCDIR=/usr/share/doc/lemonldap-ng-fr-doc \
			USEDEBIANLIBS=yes
56
	mkdir $(TMP)/$(LMSHAREDIR)/portal
Yadd's avatar
Yadd committed
57
	mv $(TMP)/$(LMVARDIR)/portal/*.pl $(TMP)/$(LMSHAREDIR)/portal/
Yadd's avatar
Yadd committed
58
59
60
	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
61

62
63
64
65
66
override_dh_link:
	rm -rf debian/lemonldap-ng-fr-doc/usr/share/doc/lemonldap-ng-fr-doc/media \
		debian/lemonldap-ng-fr-doc/usr/share/doc/lemonldap-ng-fr-doc/lib
	dh_link

Yadd's avatar
Yadd committed
67
68
override_dh_compress:
	dh_compress -X favicon.ico
69

70
71
72
73
74
75
76
77
78
# 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 \
79
80
		debian/*/$(PSESSIONSDIR) \
		debian/*/$(PSESSIONSDIR)/lock \
81
		debian/*/$(NOTIFICATIONSDIR) \
82
		debian/liblemonldap-ng-common-perl/$(CONFSTORAGEDIR) \
83
		debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR)
84
85
	chgrp www-data debian/liblemonldap-ng-common-perl/$(LMINIFILE) \
		debian/liblemonldap-ng-common-perl/$(FIRSTCONFFILE)
Yadd's avatar
Yadd committed
86
	chmod 770 debian/*/$(SESSIONSDIR) debian/*/$(SESSIONSDIR)/lock \
87
	        debian/*/$(PSESSIONSDIR) debian/*/$(PSESSIONSDIR)/lock \
Yadd's avatar
Yadd committed
88
		debian/*/$(NOTIFICATIONSDIR) \
89
		debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR)
90
91
92
	chmod 750 debian/liblemonldap-ng-common-perl/$(CONFSTORAGEDIR)
	chmod 640 debian/liblemonldap-ng-common-perl/$(FIRSTCONFFILE) \
		debian/liblemonldap-ng-common-perl/$(LMINIFILE)