# Makefile template
#
# Copyright (C) 1999-2002 Riccardo Facchetti <riccardo@master.oasi.gpa.it>
#
# 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:
@$(INSTALL_PROGRAM) -m 744 apcupsd /sbin/init.d/apcupsd
@echo "Installing symlinks..."
@ln -sf /sbin/init.d/apcupsd /sbin/rc2.d/K56apcupsd
@ln -sf /sbin/init.d/apcupsd /sbin/rc2.d/S56apcupsd
@ln -sf /sbin/init.d/apcupsd /sbin/rc3.d/K56apcupsd
@ln -sf /sbin/init.d/apcupsd /sbin/rc3.d/S56apcupsd
# save old halt script
@cp -f /sbin/rc0 /sbin/rc0.old
# insert apcupsd script into halt
@awk -f awkhaltprog /sbin/rc0.old >/sbin/rc0
@chmod 744 /sbin/rc0
@echo "================================================="
@echo " "
@echo "apcupsd script installation for the Alpha $(DISTVER) 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 "/sbin/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 " /sbin/rc0"
@echo "was properly updated (see installation section of manual)"
@echo " "
@echo "================================================="
uninstall:
@echo "Removing symlinks..."
@rm -f /sbin/rc2.d/K56apcupsd
@rm -f /sbin/rc2.d/S56apcupsd
@rm -f /sbin/rc3.d/K56apcupsd
@rm -f /sbin/rc3.d/S56apcupsd
@echo "Removing boot script..."
@rm -f /sbin/init.d/apcupsd
@echo "Restoring old halt script"
@cp /sbin/rc0 /sbin/rc0.old
@grep -v "###apcupsd###" /sbin/rc0.old >/sbin/rc0
@chmod 744 /sbin/rc0
clean:
distclean:
@rm -f apccontrol.sh apcupsd awkhaltprog Makefile
@rm -rf CVS
syntax highlighted by Code2HTML, v. 0.9.1