root/lm-sensors/trunk/prog/rrd/Makefile

Revision 4372, 1.7 KB (checked in by khali, 5 years ago)

rrd: Misc updates
* More hwmon class changes
* Look for rrd in /usr/bin by default
* Add missing shell declarations
* Update URI

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#
2# Edit the following for your setup
3#
4USER=apache
5# CRONTAB not used
6#CRONTAB=/var/spool/cron/tabs/$(USER)
7RRDPATH=/usr/bin
8BINPATH=/usr/local/bin
9RRDDIR=/var/lib/sensors-rrd
10APACHE=/var/www/html
11APACHDIR=$(APACHE)/senspix
12MACH=`uname -n`
13SENSDEV=hwmon0
14SENSDIR=/sys/class/hwmon/$(SENSDEV)/device
15################################################
16# Everything below here should be fine
17#
18RRDB=$(RRDDIR)/sensors.rrd
19
20all: sens_day.cgi sens_week.cgi summ_week.cgi $(SENSDIR)
21
22%.cgi : %.in Makefile
23        sed -e "s#%%RRDPATH%%#$(RRDPATH)#g;s#%%APACHDIR%%#$(APACHDIR)#g;s#%%RRDDIR%%#$(RRDDIR)#g;s#%%MACH%%#$(MACH)#g" $< > $@
24
25$(RRDDIR) :
26        install -d -o $(USER) $(RRDDIR)
27
28$(RRDB) : $(RRDDIR)
29        ./sens_create_rrd $(RRDB)
30        chown $(USER) $(RRDB)
31       
32$(SENSDIR) :
33        $(error error - sensor $(SENSDEV) not installed - check SENSDEV definition in Makefile)
34
35$(CRONTAB) :
36        $(error error - crontab for user $(USER) not present - check CRONTAB definition in Makefile)
37
38$(APACHE) :
39        $(error error - Web server directory $(APACHE) not present - check APACHE definition in Makefile)
40
41$(APACHDIR)/pix : $(APACHE)
42        install -d -o $(USER) -m 777 $(APACHDIR)/pix
43
44install: all $(RRDB) $(SENSDIR) $(CRONTAB) $(APACHDIR)/pix
45        install -m 755 sens_update_rrd $(BINPATH)
46        install -m 755 sens_week.cgi $(APACHDIR)
47        install -m 755 sens_day.cgi $(APACHDIR)
48        install -m 755 summ_week.cgi $(APACHDIR)
49#       grep sens_update_rrd $(CRONTAB) > /dev/null 2>&1 || echo '*/5 * * * *   /usr/local/bin/sens_update_rrd' $(RRDB) $(SENSDEV) >> $(CRONTAB)
50        @echo
51        @echo Note!!! You must manually install the following line in the crontab for user $(USER):
52        @echo '   */5 * * * *    ' /usr/local/bin/sens_update_rrd $(RRDB) $(SENSDEV)
53
54clean:
55        rm -f sens_day.cgi sens_week.cgi summ_week.cgi
Note: See TracBrowser for help on using the browser.