rules 4.56 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
	# FOR OFFICIAL RELEASES
	# ---------------------
82
	# Since Lenny, jquery.js is provided by libjs-jquery
83
84
85
	#find $(CURDIR)/debian/tmp -type f -regex '.*/jquery-[0-9].*\.js' -delete
	#find $(CURDIR)/debian/tmp -type f -name jquery.js -delete
	#rm -f $(CURDIR)/debian/tmp$(LMSHAREDIR)/*-skins/*/jquery.js
Yadd's avatar
Yadd committed
86

87
	# Now, jquery.cookie.js is provided by libjs-jquery-cookie
88
89
	#find $(CURDIR)/debian/tmp -type f -name jquery.cookie.js -delete
	#rm -f $(CURDIR)/debian/tmp$(LMSHAREDIR)/*-skins/*/jquery.cookie.js
90

Yadd's avatar
Yadd committed
91
92
93
94
95
96
	# TODO: uncomment this when Debian jquery-ui version will be upgraded to 1.8.6
	#find $(CURDIR)/debian/tmp -type f -regex '.*/jquery-ui-[0-9].*\.js' -delete
	#find $(CURDIR)/debian/tmp -type f -name jquery-ui.js -delete
	#rm -f $(CURDIR)/debian/tmp$(LMSHAREDIR)/*-skins/*/jquery-ui.js
	# TODO: restore this in Perl (with final \ )
	#	s#src=(["'"'"']).*?jquery-ui(-\d[\.\w\-]*?)?.js#src=$$1/javascript/jquery-ui/jquery-ui.min.js#i;'
97
98
99
100
101
	#perl -i -pe 's#src=(["'"'"']).*?jquery(-\d[\.\w\-]*?)?.js#src=$$1/javascript/jquery/jquery.min.js#i; \
	#		s#src=(["'"'"']).*?jquery\.cookie\.js#src=$$1/javascript/jquery-cookie/jquery.cookie.min.js#i;' \
	#	$$(find $(CURDIR)/debian/tmp/examples/manager/ -name *.pl -type f) \
	#	$$(find	$(CURDIR)/debian/tmp$(LMSHAREDIR)/manager-skins/*/ \
	#		$(CURDIR)/debian/tmp$(LMSHAREDIR)/portal-skins/*/ -type f -name *.tpl)
Yadd's avatar
Yadd committed
102

Yadd's avatar
Yadd committed
103
104
	#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
105
106

	# Move perl scripts in /usr/share, links are created by *.postinst scripts
107
108
109
	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/
110

111
112
113
114
# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
115
	dh_installchangelogs changelog
116
	dh_installdocs
117
118
	dh_installexamples
	dh_install
Yadd's avatar
Yadd committed
119
120
	chmod +x debian/liblemonldap-ng-portal-perl$(LMSHAREDIR)/bin/purgeCentralCache
	chmod +x debian/liblemonldap-ng-handler-perl$(LMSHAREDIR)/bin/purgeLocalCache
121
#	dh_installmenu
122
	dh_installdebconf	
123
124
125
126
127
128
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_python
#	dh_installinit
129
	dh_installcron
130
131
132
133
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
134
	dh_compress -X.pm -X.pl
135
136
137
138
139
140
141
142
143
	dh_fixperms
#	dh_perl
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

144
145
146
# Build architecture-dependent files here.
binary-arch: build install

147
148
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure