Skip to content
Snippets Groups Projects
rules 3.12 KiB
Newer Older
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess.
#

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

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

build-stamp:
	dh_testdir
	
	# Add here commands to compile the package.
	./autogen.sh

	./configure \
	  --prefix=/usr \
	  --localstatedir=/var \
	  --sysconfdir=/etc \
	  --with-export-dir=/var/lib/ganeti/export \
	  --with-iallocator-search-path=/usr/local/lib/ganeti/iallocators,/usr/lib/ganeti/iallocators \
	  --with-os-search-path=/srv/ganeti/os,/usr/local/lib/ganeti/os,/usr/lib/ganeti/os,/usr/share/ganeti/os \
	  --docdir=/usr/share/doc/snf-ganeti \
	  --enable-htools

	$(MAKE)

	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	# Add here commands to clean up after the build process.
	#$(MAKE) clean
	[ ! -f Makefile ] || $(MAKE) distclean
	# this is not removed by make distclean :(
	rm -f ganeti

	rm -f debian/snf-ganeti.ganeti.init
	rm -f debian/snf-ganeti.ganeti.cron.d
	rm -f debian/snf-ganeti.ganeti.default

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	# Add here commands to install the package into debian/<packagename>.
	$(MAKE) install DESTDIR=$(CURDIR)/debian/`dh_listpackages`
	cp $(CURDIR)/doc/examples/ganeti.initd $(CURDIR)/debian/snf-ganeti.ganeti.init
	cp $(CURDIR)/doc/examples/ganeti.cron $(CURDIR)/debian/snf-ganeti.ganeti.cron.d
	cp $(CURDIR)/doc/examples/ganeti.default $(CURDIR)/debian/snf-ganeti.ganeti.default
	# No longer needed with ganeti 2.1
	#mv $(CURDIR)/debian/snf-ganeti/usr/share/doc/ganeti $(CURDIR)/debian/snf-ganeti/usr/share/doc/snf-ganeti
	install -m 0644 $(CURDIR)/doc/examples/bash_completion \
	  $(CURDIR)/debian/snf-ganeti/etc/bash_completion.d/ganeti
	#install -m 0644 $(CURDIR)/debian/snf-ganeti.overrides \
	#  $(CURDIR)/debian/snf-ganeti/usr/share/lintian/overrides/snf-ganeti

	# remove embedded copy of jquery
	rm -f $(CURDIR)/debian/snf-ganeti/usr/share/doc/snf-ganeti/html/_static/jsquery.js

	rmdir debian/snf-ganeti/var/run/ganeti
	rmdir debian/snf-ganeti/var/run

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
#	dh_installexamples
#	dh_installmenu
#	dh_installdebconf
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installcatalogs
#	dh_installpam
#	dh_installmime
# Note: dh_pysupport *must* be before dh_installinit, since the daemons
# need the python modules as installed by pysupport
	dh_pysupport
	dh_installinit --name=ganeti --error-handler=true -- defaults 20 80
	dh_installcron --name=ganeti
#	dh_installinfo
#	dh_installwm
#	dh_installudev
#	dh_lintian
#	dh_bugfiles
#	dh_undocumented
	dh_installman
	dh_link
	# Note: no compression on the html docs, since it will break navigation
	dh_compress -Xsnf-ganeti/html/
	dh_fixperms
#	dh_perl
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install