#!/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

%:
	dh $@

# Do not use the makefile
override_dh_auto_build:

# Exclude eole-lxc-controller files from eole-server
override_dh_install:
	dh_install -peole-common-pkg
	# Exclude everything related to container mode and dedicated to zephir
	dh_install -peole-server --exclude=01_container.xml --exclude=lxc --exclude=29_mode_zephir.xml
	dh_install -peole-lxc-controller
	dh_install -peole-lxc-container-pkg
	dh_install -peole-lxc-container-apps
	dh_install -peole-ssmtp-pkg
	dh_install -peole-mode-zephir

# Force init script name
override_dh_installinit:
	dh_installinit --noscripts -peole-server --name=ferme-firewall $@
	dh_installinit --noscripts -peole-server --name=bastion $@
	dh_installinit --noscripts -peole-lxc-container-apps --name=bastion $@

override_dh_installsystemd:
	dh_installsystemd -peole-server --name=ferme-firewall --no-start --no-restart-on-upgrade
	dh_installsystemd -peole-server --name=bastion --no-restart-on-upgrade
	dh_installsystemd -peole-lxc-container-apps --name=bastion --no-restart-on-upgrade

override_dh_builddeb:
	# Make package compatible with older version
	dh_builddeb -- -Zgzip -Srle

.PHONY: override_dh_auto_build override_dh_install override_dh_installinit override_dh_installsystemd override_dh_builddeb
