rules 3.24 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

export PERL_MM_USE_DEFAULT=1

Yadd's avatar
Yadd committed
14
15
LMSHAREDIR=/usr/share/lemonldap-ng
LMVARDIR=/var/lib/lemonldap-ng
16
17
18
19

configure: configure-stamp
configure-stamp:
	dh_testdir
20

21
	# Add here commands to configure the package.
Yadd's avatar
Yadd committed
22
	$(MAKE) configure STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
23
			PERLOPTIONS="INSTALLDIRS=vendor"
24
25
26
27
28
29

	touch configure-stamp


build: build-stamp

Yadd's avatar
Yadd committed
30
31
32
33
build-indep: build-stamp

build-arch:

34
35
36
37
build-stamp: configure-stamp 
	dh_testdir

	# Add here commands to compile the package.
38
	$(MAKE)
39
40
41
42
43
44

	touch $@

clean:
	dh_testdir
	dh_testroot
45
	debconf-updatepo
46
47
48
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
49
	[ ! -f Makefile ] || $(MAKE) clean
50
51
52
53
54
55

	dh_clean 

install: build
	dh_testdir
	dh_testroot
56
	dh_prep
57
58
59
	dh_installdirs

	# Add here commands to install the package into debian/lemonldap-ng.
60
	$(MAKE) test
61
62
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp \
			PREFIX=/usr/ \
Yadd's avatar
Yadd committed
63
			LMPREFIX=/usr/share/lemonldap-ng/ \
Yadd's avatar
Yadd committed
64
			BINDIR=$(LMSHAREDIR)/bin/ \
65
66
			DOCUMENTROOT=$(LMVARDIR) \
			EXAMPLESDIR=/examples/ \
Yadd's avatar
Yadd committed
67
68
69
70
			HANDLERDIR=$(LMVARDIR)/handler/ \
			PORTALSKINSDIR=$(LMSHAREDIR)/portal-skins/ \
			MANAGERSKINSDIR=$(LMSHAREDIR)/manager-skins/ \
			SESSIONSEXPLORERDATADIR=$(LMSHAREDIR)/sessions-explorer-imgs/ \
Yadd's avatar
Yadd committed
71
			STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
Yadd's avatar
Yadd committed
72
			TOOLSDIR=$(LMSHAREDIR)/ressources/ \
73
74
75
76
			CONFDIR=/etc/lemonldap-ng/ \
			CRONDIR=/etc/cron.d/ \
			DATADIR=$(LMVARDIR) \
			APACHEUSER=www-data \
Yadd's avatar
Yadd committed
77
			APACHEGROUP=www-data \
Yadd's avatar
Yadd committed
78
			DOCDIR=/usr/share/doc/lemonldap-ng-doc
79

80
81
	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
82
83

	# Move perl scripts in /usr/share, links are created by *.postinst scripts
84
85
86
	mkdir debian/tmp/usr/share/lemonldap-ng/manager debian/tmp/usr/share/lemonldap-ng/portal
	mv debian/tmp/var/lib/lemonldap-ng/portal/*.pl debian/tmp/usr/share/lemonldap-ng/portal/
	mv debian/tmp/var/lib/lemonldap-ng/manager/*pl debian/tmp/usr/share/lemonldap-ng/manager/
87

88
89
90
91
# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
92
	dh_installchangelogs changelog
93
	dh_installdocs
94
95
	dh_installexamples
	dh_install
Yadd's avatar
Yadd committed
96
97
	chmod +x debian/liblemonldap-ng-portal-perl$(LMSHAREDIR)/bin/purgeCentralCache
	chmod +x debian/liblemonldap-ng-handler-perl$(LMSHAREDIR)/bin/purgeLocalCache
98
#	dh_installmenu
99
	dh_installdebconf	
100
101
102
103
104
105
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_python
#	dh_installinit
106
	dh_installcron
107
108
109
110
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
111
	dh_compress -X.pm -X.pl
112
113
114
115
116
117
118
119
120
	dh_fixperms
#	dh_perl
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

121
122
123
# Build architecture-dependent files here.
binary-arch: build install

124
125
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure