rules 4 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
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp \
			PREFIX=/usr/ \
Yadd's avatar
Yadd committed
59
			LMPREFIX=/usr/share/lemonldap-ng/ \
60 61 62 63 64
			BINDIR=$(LMSHAREDIR)bin/ \
			DOCUMENTROOT=$(LMVARDIR) \
			EXAMPLESDIR=/examples/ \
			HANDLERDIR=$(LMVARDIR)handler/ \
			PORTALSKINSDIR=$(LMSHAREDIR)portal-skins/ \
Yadd's avatar
Yadd committed
65
			MANAGERSKINSDIR=$(LMSHAREDIR)manager-skins/ \
66
			SESSIONSEXPLORERDATADIR=$(LMSHAREDIR)sessions-explorer-imgs/ \
Yadd's avatar
Yadd committed
67
			STORAGECONFFILE=/etc/lemonldap-ng/lemonldap-ng.ini \
68 69 70 71 72 73 74 75
			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
76 77
	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
78
	rm -f $(CURDIR)/debian/tmp$(LMSHAREDIR)*-skins/*/jquery.js
79 80
	#test -n "$$LOCALBUILD" || ./scripts/minifierjs $$(find debian/tmp/ -name '*.js')
	#test -n "$$LOCALBUILD" || ./scripts/minifiercss $$(find debian/tmp/ -name '*.css')
81
	perl -i -pe 's#src=(["'"'"']).*?jquery(-\d[\.\w\-]*?)?.js#src=$$1/javascript/jquery/jquery.js#i' \
Yadd's avatar
Yadd committed
82 83 84
		$$(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)
85
	# postinst provides initial portal, manager and sessions-explorer
86 87 88
	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/
89

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

128 129 130
# Build architecture-dependent files here.
binary-arch: build install

131 132
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure