Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into...
[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 SRCDATE = "20051022"
8 PV = "1.0.0+cvs${SRCDATE}"
9 PR = "r1"
10
11 SRC_URI = "http://download.berlin.freifunk.net/meshcube.org/nylon/stable/sources/${PN}_gruen.4g__${SRCDATE}.tar.gz"
12 S = "${WORKDIR}/${PN}"
13 INHIBIT_PACKAGE_STRIP = "1"
14
15 do_install() {
16         install -d ${D}/srv/www/cgi-bin
17         install -d ${D}/${sbindir}
18         ln -s /var/tmp ${D}/srv/www/rrd-img
19         install -m 755 ${S}/*.html ${D}/srv/www/cgi-bin
20         ln -s /var/tmp/nav.inc.html ${D}/srv/www/cgi-bin
21         install -m 755 ${S}/collect.sh ${D}/${sbindir}
22 }
23
24 pkg_postinst() {
25 if test "x$D" != "x"; then
26         exit 1
27 else
28         if ! grep -q collect.sh /etc/cron/crontabs/root; then
29                 echo "adding crontab"
30                 test -d /etc/cron/crontabs || mkdir -p /etc/cron/crontabs
31                 echo "*/5 * * * *    ${sbindir}/collect.sh" >> /etc/cron/crontabs/root
32         fi
33         update-rc.d -s busybox-cron defaults
34         /etc/init.d/busybox-cron reload
35         if [ ! -e /etc/httpd.conf ]; then
36                 echo "A:*" > /etc/httpd.conf
37         fi
38         update-rc.d -s busybox-httpd defaults
39
40         if ! grep -q "/var/lib/rrd/" /etc/nylon/backup.list; then
41                 echo "adding to backup list"
42                 echo "/var/lib/rrd/" >> /etc/nylon/backup.list
43         fi
44 fi
45 }
46
47 FILES_${PN} += "/srv"