UPS: apcupsd clean sources
[tomato.git] / release / src / router / apcupsd / platforms / yellowdog / Makefile
blob1e190aa3aa3f1a6bf5b66e53eaf0b32a6565084b
1 topdir:=../..
3 SUBDIRS =
4 include $(topdir)/autoconf/targets.mak
6 all-install: install-yellowdog
7 all-uninstall: uninstall-yellowdog
9 install-yellowdog:
10 $(call DISTINST,Yellowdog)
11 # unlink old rc script (if not doing a DESTDIR install)
12 $(call CHKCFG,del,/etc/rc.d/init.d/apcupsd)
13 # install new rc script
14 $(call MKDIR,/etc/rc.d/init.d)
15 $(call INSTDATA,744,apcupsd,/etc/rc.d/init.d)
16 # link new rc script (if not doing a DESTDIR install)
17 $(call CHKCFG,add,/etc/rc.d/init.d/apcupsd)
18 # save old halt script
19 $(call COPY,/etc/rc.d/init.d/halt,/etc/rc.d/init.d/halt.old)
20 # insert apcupsd callout into halt script
21 @echo " PATCH" $(DESTDIR)/etc/rc.d/init.d/halt
22 $(V)awk -f awkhaltprog $(DESTDIR)/etc/rc.d/init.d/halt.old >$(DESTDIR)/etc/rc.d/init.d/halt
23 $(V)chmod 744 $(DESTDIR)/etc/rc.d/init.d/halt
24 @echo "================================================="
25 @echo " "
26 @echo "apcupsd script installation for RedHat $(DISTVER) complete."
27 @echo " "
28 @echo "You should now edit /etc/apcupsd/apcupsd.conf to correspond"
29 @echo "to your setup then start the apcupsd daemon with:"
30 @echo " "
31 @echo "/etc/rc.d/init.d/apcupsd start"
32 @echo " "
33 @echo "thereafter when you reboot, it will be stopped and started"
34 @echo "automatically."
35 @echo " "
36 @echo "Please check that your halt script in:"
37 @echo " /etc/rc.d/init.d/halt"
38 @echo "was properly updated (see installation section of manual)"
39 @echo " "
40 @echo "================================================="
42 uninstall-yellowdog:
43 $(call DISTUNINST,Yellowdog)
44 # unlink old rc script (if not doing a DESTDIR install)
45 -$(call CHKCFG,del,/etc/rc.d/init.d/apcupsd)
46 -$(call UNINST,/etc/rc.d/init.d/apcupsd)
47 -$(call COPY,$(DESTDIR)/etc/rc.d/init.d/halt.old,/etc/rc.d/init.d/halt)
48 -$(call UNINST,/etc/rc.d/init.d/halt.old)