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