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

override_dh_install: 
	dh_install
	# Configuration files
	install -m644 debian/network-routes  $(CURDIR)/debian/ifupdown-extra/etc/network/routes
	install -m644 debian/network-test-default  $(CURDIR)/debian/ifupdown-extra/etc/default/network-test
	# Network scripts for ifupdown
	install -m755 if-up-scripts/check-network-cable  $(CURDIR)/debian/ifupdown-extra/etc/network/if-up.d/00check-network-cable
	install -m755 if-up-scripts/check-duplicate-ip  $(CURDIR)/debian/ifupdown-extra/etc/network/if-up.d/10check-duplicate-ip
	install -m755 if-up-scripts/check-duplicate-ip6  $(CURDIR)/debian/ifupdown-extra/etc/network/if-up.d/10check-duplicate-ip6
	install -m755 if-up-scripts/static-routes  $(CURDIR)/debian/ifupdown-extra/etc/network/if-up.d/20static-routes
	install -m755 if-up-scripts/check-gateway  $(CURDIR)/debian/ifupdown-extra/etc/network/if-up.d/30check-gateway
	# Serviced Unit file
	install -m644 debian/networking-routes.service $(CURDIR)/debian/ifupdown-extra/lib/systemd/system/

override_dh_installinit:
	dh_installinit
	dh_installinit --name=networking-routes --no-start -- start 41 S . 


