rules 3.71 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

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
30
31
32
33

	touch configure-stamp


build: build-stamp

build-stamp: configure-stamp 
	dh_testdir

	# Add here commands to compile the package.
34
	$(MAKE)
35
36
37
38
39
40

	touch $@

clean:
	dh_testdir
	dh_testroot
41
	debconf-updatepo
42
43
44
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
45
	[ ! -f Makefile ] || $(MAKE) clean
46
47
48
49
50
51

	dh_clean 

install: build
	dh_testdir
	dh_testroot
52
	dh_prep
53
54
55
	dh_installdirs

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

	# Since Lenny, jquery.js is provided by libjs-jquery
Yadd's avatar
Yadd committed
75
76
	find $(CURDIR)/debian/tmp -type f -regex '.*/jquery-[0-9].*\.js' -delete
	find $(CURDIR)/debian/tmp -type f -name jquery.js -delete
Yadd's avatar
Yadd committed
77
	rm -f $(CURDIR)/debian/tmp$(LMSHAREDIR)*-skins/*/jquery.js
78
79
	#test -n "$$LOCALBUILD" || ./scripts/minifierjs $$(find debian/tmp/ -name '*.js')
	#test -n "$$LOCALBUILD" || ./scripts/minifiercss $$(find debian/tmp/ -name '*.css')
80
	perl -i -pe 's#src=(["'"'"']).*?jquery(-\d[\.\w\-]*?)?.js#src=$$1/javascript/jquery/jquery.js#i' \
Yadd's avatar
Yadd committed
81
			$(CURDIR)/debian/tmp/examples/manager/*.pl \
82
83
			$(CURDIR)/debian/tmp$(LMSHAREDIR)manager-skins/default/*.tpl \
			$(CURDIR)/debian/tmp$(LMSHAREDIR)portal-skins/pastel/*.tpl
84
85
	# postinst provides initial portal, manager and sessions-explorer
	rm -f debian/tmp/var/lib/lemonldap-ng/portal/index.pl \
86
		debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal/index.pl
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
96
97
	mkdir -p debian/lemonldap-ng/usr/share/doc/lemonldap-ng/examples && \
		cd debian/lemonldap-ng/usr/share/doc/lemonldap-ng/examples && \
98
99
		ln -s ../../liblemonldap-ng-handler-perl/examples handler && \
		ln -s ../../liblemonldap-ng-manager-perl/examples manager && \
Yadd's avatar
Lintian    
Yadd committed
100
		ln -s ../../liblemonldap-ng-portal-perl/examples portal
101
	chmod +x debian/liblemonldap-ng-portal-perl$(LMSHAREDIR)bin/purgeCentralCache
102
#	dh_installmenu
103
	dh_installdebconf	
104
105
106
107
108
109
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_python
#	dh_installinit
110
	dh_installcron
111
112
113
114
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
115
	dh_compress -X.pm -X.pl
116
117
118
119
120
121
122
123
124
	dh_fixperms
#	dh_perl
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

125
126
127
# Build architecture-dependent files here.
binary-arch: build install

128
129
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure