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