1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
topdir:=../..
SUBDIRS =
include $(topdir)/autoconf/targets.mak
all-install: install-alpha
all-uninstall: uninstall-alpha
install-alpha:
$(call DISTINST,alpha)
$(call MKDIR,/sbin/init.d)
$(call INSTDATA,744,apcupsd,/sbin/init.d/apcupsd)
$(call MKDIR,/sbin/rc2.d)
$(call SYMLINK,../init.d/apcupsd,/sbin/rc2.d/K56apcupsd)
$(call SYMLINK,../init.d/apcupsd,/sbin/rc2.d/S56apcupsd)
$(call MKDIR,/sbin/rc3.d)
$(call SYMLINK,../init.d/apcupsd,/sbin/rc3.d/K56apcupsd)
$(call SYMLINK,../init.d/apcupsd,/sbin/rc3.d/S56apcupsd)
# save old halt script
$(call COPY,/sbin/rc0,/sbin/rc0.old)
# insert apcupsd callout into halt script
@echo " AWK " $(DESTDIR)/sbin/rc0
$(V)awk -f awkhaltprog $(DESTDIR)/sbin/rc0.old >$(DESTDIR)/sbin/rc0
$(V)chmod 744 $(DESTDIR)/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-alpha:
$(call DISTUNINST,alpha)
-$(call UNINST,/sbin/rc2.d/K56apcupsd)
-$(call UNINST,/sbin/rc2.d/S56apcupsd)
-$(call UNINST,/sbin/rc3.d/K56apcupsd)
-$(call UNINST,/sbin/rc3.d/S56apcupsd)
-$(call UNINST,/sbin/init.d/apcupsd)
$(call COPY,/sbin/rc0,/sbin/rc0.old)
$(V)grep -v "###apcupsd###" $(DESTDIR)/sbin/rc0.old >$(DESTDIR)/sbin/rc0
$(V)chmod 744 $(DESTDIR)/sbin/rc0
|