c09773cff94e473b1f809a0250ed00f8a28652d9
[vuplus_openembedded] / nylon / nylon-statistics.oe
1 DESCRIPTION = "statistics & graphing for nylon"
2 RDEPENDS = "rrdtool"
3 SECTION = "base"
4 PRIORITY = "optional"
5 MAINTAINER = "Bruno Randolf <bruno.randolf@4g-systems.biz>"
6 LICENSE = "GPLv2"
7
8 SRC_URI = "svn://meshcube.org/svn/application;module=${PN}"
9 S = "${WORKDIR}/${PN}"
10
11 do_install() {
12         install -d ${D}/srv/www/cgi-bin
13         install -d ${D}/${sbindir}
14         ln -s /var/tmp ${D}/srv/www/rrd-img
15         install -m 755 ${S}/*.html ${D}/srv/www/cgi-bin
16         install -m 755 ${S}/collect.sh ${D}/${sbindir}
17 }
18
19 pkg_postinst() {
20 if test "x$D" == "x"; then
21         mkdir -p /etc/cron/crontabs
22         if ! grep -q collect.sh /etc/cron/crontabs/root; then
23                 echo "adding crontab"
24                 echo "*/5 * * * *    /usr/sbin/collect.sh" >> /etc/cron/crontabs/root
25         fi
26         update-rc.d -s busybox-cron defaults
27         if [ ! -e /etc/httpd.conf ]; then
28                 echo "A:*" > /etc/httpd.conf
29         fi      
30         update-rc.d -s busybox-httpd defaults
31 fi
32 }
33
34 FILES_${PN} += "/srv"