File: Makefile

package info (click to toggle)
lm-sensors 1%3A3.6.0-7
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 3,236 kB
  • sloc: perl: 6,461; ansic: 5,303; sh: 2,301; lex: 372; yacc: 296; makefile: 220
file content (55 lines) | stat: -rw-r--r-- 1,732 bytes parent folder | download | duplicates (9)
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
53
54
55
#
# Edit the following for your setup
#
USER=apache
# CRONTAB not used
#CRONTAB=/var/spool/cron/tabs/$(USER)
RRDPATH=/usr/bin
BINPATH=/usr/local/bin
RRDDIR=/var/lib/sensors-rrd
APACHE=/var/www/html
APACHDIR=$(APACHE)/senspix
MACH=`uname -n`
SENSDEV=hwmon0
SENSDIR=/sys/class/hwmon/$(SENSDEV)/device
################################################
# Everything below here should be fine
#
RRDB=$(RRDDIR)/sensors.rrd

all: sens_day.cgi sens_week.cgi summ_week.cgi $(SENSDIR)

%.cgi : %.in Makefile
	sed -e "s#%%RRDPATH%%#$(RRDPATH)#g;s#%%APACHDIR%%#$(APACHDIR)#g;s#%%RRDDIR%%#$(RRDDIR)#g;s#%%MACH%%#$(MACH)#g" $< > $@

$(RRDDIR) :
	install -d -o $(USER) $(RRDDIR)

$(RRDB) : $(RRDDIR)
	./sens_create_rrd $(RRDB)
	chown $(USER) $(RRDB)
	
$(SENSDIR) :
	$(error error - sensor $(SENSDEV) not installed - check SENSDEV definition in Makefile)

$(CRONTAB) :
	$(error error - crontab for user $(USER) not present - check CRONTAB definition in Makefile)

$(APACHE) :
	$(error error - Web server directory $(APACHE) not present - check APACHE definition in Makefile)

$(APACHDIR)/pix : $(APACHE)
	install -d -o $(USER) -m 777 $(APACHDIR)/pix

install: all $(RRDB) $(SENSDIR) $(CRONTAB) $(APACHDIR)/pix
	install -m 755 sens_update_rrd $(BINPATH)
	install -m 755 sens_week.cgi $(APACHDIR)
	install -m 755 sens_day.cgi $(APACHDIR)
	install -m 755 summ_week.cgi $(APACHDIR)
#	grep sens_update_rrd $(CRONTAB) > /dev/null 2>&1 || echo '*/5 * * * *	/usr/local/bin/sens_update_rrd' $(RRDB) $(SENSDEV) >> $(CRONTAB)
	@echo
	@echo Note!!! You must manually install the following line in the crontab for user $(USER):
	@echo '   */5 * * * *    ' /usr/local/bin/sens_update_rrd $(RRDB) $(SENSDEV)

clean:
	rm -f sens_day.cgi sens_week.cgi summ_week.cgi