File: rules

package info (click to toggle)
lemonldap-ng 2.0.2%2Bds-7%2Bdeb10u7
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 21,452 kB
  • sloc: perl: 47,147; javascript: 12,938; makefile: 958; sh: 433; xml: 170; php: 26; sql: 5
file content (90 lines) | stat: -rwxr-xr-x 2,956 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/make -f

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

LMSHAREDIR=/usr/share/lemonldap-ng
LMVARDIR  =/var/lib/lemonldap-ng
TMP       = $(CURDIR)/debian/tmp

CONFDIR=/etc/lemonldap-ng
SESSIONSDIR=$(LMVARDIR)/sessions
PSESSIONSDIR=$(LMVARDIR)/psessions
NOTIFICATIONSDIR=$(LMVARDIR)/notifications
CONFSTORAGEDIR=$(LMVARDIR)/conf
FIRSTCONFFILE=$(CONFSTORAGEDIR)/lmConf-1.json
LMINIFILE=$(CONFDIR)/lemonldap-ng.ini
CAPTCHADIR=$(LMVARDIR)/captcha

%:
	dh $@

override_dh_auto_configure:
	$(MAKE) configure STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
		PERLOPTIONS="INSTALLDIRS=vendor"

override_dh_auto_build:
	$(MAKE) all

override_dh_auto_install:
	$(MAKE) install \
			DESTDIR=$(CURDIR)/debian/tmp \
			PREFIX=/usr \
			LMPREFIX=/usr/share/lemonldap-ng \
			BINDIR=$(LMSHAREDIR)/bin \
			SBINDIR=/usr/sbin \
			FASTCGISOCKDIR=/var/run/llng-fastcgi-server \
			DOCUMENTROOT=$(LMVARDIR) \
			EXAMPLESDIR=/examples \
			HANDLERDIR=$(LMVARDIR)/handler \
			MANAGERDIR=$(LMSHAREDIR)/manager \
			PORTALDIR=$(LMSHAREDIR)/portal \
			STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
			TOOLSDIR=$(LMSHAREDIR)/ressources \
			CONFDIR=/etc/lemonldap-ng \
			CRONDIR=/etc/cron.d \
			DATADIR=$(LMVARDIR) \
			APACHEVERSION=2.X \
			APACHEUSER=www-data \
			APACHEGROUP=www-data \
			DEFDOCDIR=/usr/share/doc/lemonldap-ng-doc \
			UWSGIYAMLDIR=/etc/uwsgi/apps-available \
			USEDEBIANLIBS=yes
	# Generate minified files removed by uscan
	for i in $$(find $(TMP)/$(LMSHAREDIR) -type f -name '*.js'); do \
		echo -n "compressing $$i: "; \
		uglifyjs --comments='/Copyr/i' $$i >$${i%%.js}.min.js; \
		echo done; \
	done
	for i in $$(find $(TMP)/$(LMSHAREDIR) -type f -name '*.css'); do \
		echo -n "compressing $$i: "; \
		yui-compressor $$i >$${i%%.css}.min.css; \
		echo done; \
	done

override_dh_compress:
	dh_compress -X favicon.ico

# 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 \
		debian/*/$(PSESSIONSDIR) \
		debian/*/$(PSESSIONSDIR)/lock \
		debian/*/$(NOTIFICATIONSDIR) \
		debian/liblemonldap-ng-common-perl/$(CONFSTORAGEDIR) \
		debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR)
	chgrp www-data debian/liblemonldap-ng-common-perl/$(LMINIFILE) \
		debian/liblemonldap-ng-common-perl/$(FIRSTCONFFILE)
	chmod 770 debian/*/$(SESSIONSDIR) debian/*/$(SESSIONSDIR)/lock \
	        debian/*/$(PSESSIONSDIR) debian/*/$(PSESSIONSDIR)/lock \
		debian/*/$(NOTIFICATIONSDIR) \
		debian/liblemonldap-ng-portal-perl/$(CAPTCHADIR)
	chmod 750 debian/liblemonldap-ng-common-perl/$(CONFSTORAGEDIR)
	chmod 640 debian/liblemonldap-ng-common-perl/$(FIRSTCONFFILE) \
		debian/liblemonldap-ng-common-perl/$(LMINIFILE)