# Makefile template
#
# Copyright (C) 1999-2002 Riccardo Facchetti <riccardo@master.oasi.gpa.it>
# 
# Makefile for the EnGarde installation.
#
#  25 Sep 1999 -- KES
#  23 Nov 2001 -- MRR  Hacked to use with EnGarde Secure Linux
#

# Default variables
@VARIABLES@
# TOP source directory.
topdir = @topdir@
top_builddir = $(topdir)

# Include the default make targets: to be put before the all-targets: rule.
@TARGETS@

all-targets: Makefile

install:
	@if test -f /etc/init.d/apcupsd; then \
	    /sbin/chkconfig --del apcupsd; \
	fi
	@$(INSTALL_PROGRAM) -m 744 apcupsd /etc/init.d/apcupsd
	# save old halt script
	@cp -f /etc/init.d/halt /etc/init.d/halt.old
	# insert apcupsd script into halt
	@awk -f awkhaltprog /etc/init.d/halt.old >/etc/init.d/halt
	@chmod 744 /etc/init.d/halt
	# link new halt script for startup and shutdown
	@/sbin/chkconfig --add apcupsd
	@echo "================================================="
	@echo " "
	@echo "apcupsd script installation for Engarde Secure Linux complete." 
	@echo " "
	@echo "You should now edit  /etc/apcupsd/apcupsd.conf  to correspond"
	@echo "to your setup then start the apcupsd daemon with:"
	@echo " "
	@echo "/etc/init.d/apcupsd start"
	@echo " "
	@echo "thereafter when you reboot, it will be stopped and started"
	@echo "automatically."
	@echo " "
	@echo "Please check that your halt script in:"
	@echo "    /etc/init.d/halt"
	@echo "was properly updated (see installation section of manual)"
	@echo " "
	@echo "================================================="

uninstall:
	@echo "Removing symlinks..."
	@/sbin/chkconfig --del apcupsd
	@echo "Removing boot script..."
	@rm -f /etc/init.d/apcupsd
	@echo "Restoring old halt script"
	@cp -f /etc/init.d/halt.old /etc/init.d/halt

clean:

distclean:
	@rm -f apccontrol.sh apcupsd awkhaltprog Makefile apcupsd.spec
	@rm -rf CVS


syntax highlighted by Code2HTML, v. 0.9.1