#!/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 ALERT_LIST_ORIG := $(shell find alerts -name "*.alert" -print) ALERT_LIST_DOCS := $(shell find alerts -name "*.README" -print) MONITOR_LIST_ORIG := $(shell find monitors -name "*.monitor" -print | grep -v ps.monitor | grep -v remote.monitor | grep -v softraid.monitor) MONITOR_LIST_DOCS := $(shell find monitors -name "*.README" -print) %: dh $@ override_dh_auto_install: ######################################################################### # PROCESSING ALERTS ######################################################################### @for i in $(ALERT_LIST_ORIG) ; do \ echo "# [A] Installing : $$i" ; \ install -m 755 $$i debian/mon-contrib/usr/lib/mon-contrib/alert.d; \ done # # Install alerts docs # @for i in $(ALERT_LIST_DOCS) ; do \ echo "# [A] Installing : $$i" ; \ install -m 644 $$i debian/mon-contrib/usr/share/doc/mon-contrib/alerts; \ done # # Link alerts # @for i in $(ALERT_LIST_ORIG) ; do \ alert=`basename $$i` ; \ src=`echo /usr/lib/mon-contrib/alert.d/$$alert` ; \ dst=`echo /usr/lib/mon/alert.d/$$alert` ; \ echo "# [A] Linking : $$src to $$dst" ; \ dh_link $$src $$dst ; \ done ######################################################################### # PROCESSING MONITORS ######################################################################### @for i in $(MONITOR_LIST_ORIG) ; do \ echo "# [M] Installing : $$i" ; \ install -m 755 $$i debian/mon-contrib/usr/lib/mon-contrib/mon.d; \ done # # Install monitor docs # @for i in $(MONITOR_LIST_DOCS) ; do \ echo "# [M] Installing : $$i" ; \ install -m 644 $$i debian/mon-contrib/usr/share/doc/mon-contrib/monitors; \ done # # Link monitors # @for i in debian/mon-contrib/usr/lib/mon-contrib/mon.d/* ; do \ monitor=`basename $$i` ; \ src=`echo /usr/lib/mon-contrib/mon.d/$$monitor` ; \ dst=`echo /usr/lib/mon/mon.d/$$monitor` ; \ echo "# [M] Linking : $$src to $$dst" ; \ dh_link $$src $$dst ; \ done # # Installing *.html documents # install -m 644 *.html debian/mon-contrib/usr/share/doc/mon-contrib/html