rename packages/ to recipes/ per earlier agreement
[openembedded.git] / recipes / nylon / nylon-statistics.bb
1 DESCRIPTION = "statistics & graphing for nylon"
2 RDEPENDS = "rrdtool"
3 SECTION = "base"
4 PRIORITY = "optional"
5 LICENSE = "GPLv2"
6 SRCDATE = "20050909"
7 PV = "1.0.0+cvs${SRCDATE}"
8 PR = "r1"
9
10 SRC_URI = "http://meshcube.org/download/${PN}_${SRCDATE}.tgz"
11 S = "${WORKDIR}/${PN}"
12 INHIBIT_PACKAGE_STRIP = "1"
13
14 do_install() {
15         install -d ${D}/srv/www/cgi-bin
16         install -d ${D}/${sbindir}
17         ln -s /var/tmp ${D}/srv/www/rrd-img
18         install -m 755 ${S}/*.html ${D}/srv/www/cgi-bin
19         ln -s /var/tmp/nav.inc.html ${D}/srv/www/cgi-bin
20         install -m 755 ${S}/collect.sh ${D}/${sbindir}
21 }
22
23 pkg_postinst() {
24 if test "x$D" != "x"; then
25         exit 1
26 else
27         if ! grep -q collect.sh /etc/cron/crontabs/root; then
28                 echo "adding crontab"
29                 test -d /etc/cron/crontabs || mkdir -p /etc/cron/crontabs
30                 echo "*/5 * * * *    ${sbindir}/collect.sh" >> /etc/cron/crontabs/root
31         fi
32         update-rc.d -s busybox-cron defaults
33         /etc/init.d/busybox-cron reload
34         if [ ! -e /etc/httpd.conf ]; then
35                 echo "A:*" > /etc/httpd.conf
36         fi
37         update-rc.d -s busybox-httpd defaults
38
39         if ! grep -q "/var/lib/rrd/" /etc/nylon/backup.list; then
40                 echo "adding to backup list"
41                 echo "/var/lib/rrd/" >> /etc/nylon/backup.list
42         fi
43 fi
44 }
45
46 FILES_${PN} += "/srv"