xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-extended/logwatch/logwatch_7.6.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "A log file analysis program"
2*4882a593SmuzhiyunDESCRIPTION = "\
3*4882a593SmuzhiyunLogwatch is a customizable, pluggable log-monitoring system. It will go \
4*4882a593Smuzhiyunthrough your logs for a given period of time and make a report in the areas \
5*4882a593Smuzhiyunthat you wish with the detail that you wish. Easy to use - works right out of \
6*4882a593Smuzhiyunthe package on many systems.\
7*4882a593Smuzhiyun"
8*4882a593SmuzhiyunSECTION = "devel"
9*4882a593SmuzhiyunHOMEPAGE = "http://www.logwatch.org/"
10*4882a593SmuzhiyunLICENSE = "MIT"
11*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://LICENSE;md5=ba882fa9b4b6b217a51780be3f4db9c8"
12*4882a593SmuzhiyunRDEPENDS:${PN} = "perl"
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunSRC_URI = "http://jaist.dl.sourceforge.net/project/${BPN}/${BP}/${BP}.tar.gz"
15*4882a593SmuzhiyunSRC_URI[sha256sum] = "689f3c68b99ef7af7d3c7007c3ff0a55d5674bdbf9c01f69a9f187726d6d4baf"
16*4882a593Smuzhiyun
17*4882a593Smuzhiyundo_install() {
18*4882a593Smuzhiyun    install -m 0755 -d ${D}${sysconfdir}/logwatch/scripts
19*4882a593Smuzhiyun    install -m 0755 -d ${D}${datadir}/logwatch/dist.conf/logfiles
20*4882a593Smuzhiyun    install -m 0755 -d ${D}${datadir}/logwatch/dist.conf/services
21*4882a593Smuzhiyun    install -m 0755 -d ${D}${localstatedir}/cache/logwatch
22*4882a593Smuzhiyun    cp -r -f conf/ ${D}${datadir}/logwatch/default.conf
23*4882a593Smuzhiyun    cp -r -f scripts/ ${D}${datadir}/logwatch/scripts
24*4882a593Smuzhiyun    cp -r -f lib ${D}${datadir}/logwatch/lib
25*4882a593Smuzhiyun    chown -R root:root ${D}${datadir}/logwatch
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun    install -m 0755 -d ${D}${mandir}/man1
28*4882a593Smuzhiyun    install -m 0755 -d ${D}${mandir}/man5
29*4882a593Smuzhiyun    install -m 0755 -d ${D}${mandir}/man8
30*4882a593Smuzhiyun    install -m 0644 amavis-logwatch.1 ${D}${mandir}/man1
31*4882a593Smuzhiyun    install -m 0644 postfix-logwatch.1 ${D}${mandir}/man1
32*4882a593Smuzhiyun    install -m 0644 ignore.conf.5 ${D}${mandir}/man5
33*4882a593Smuzhiyun    install -m 0644 override.conf.5 ${D}${mandir}/man5
34*4882a593Smuzhiyun    install -m 0644 logwatch.conf.5 ${D}${mandir}/man5
35*4882a593Smuzhiyun    install -m 0644 logwatch.8 ${D}${mandir}/man8
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun    install -m 0755 -d ${D}${sysconfdir}/cron.daily
38*4882a593Smuzhiyun    install -m 0755 -d ${D}${sbindir}
39*4882a593Smuzhiyun    ln -sf ../..${datadir}/logwatch/scripts/logwatch.pl ${D}${sbindir}/logwatch
40*4882a593Smuzhiyun    cat > ${D}${sysconfdir}/cron.daily/0logwatch <<EOF
41*4882a593Smuzhiyun    DailyReport=\`grep -e "^[[:space:]]*DailyReport[[:space:]]*=[[:space:]]*" /usr/share/logwatch/default.conf/logwatch.conf | head -n1 | sed -e "s|^\s*DailyReport\s*=\s*||"\`
42*4882a593Smuzhiyun    if [ "\$DailyReport" != "No" ] && [ "\$DailyReport" != "no" ]
43*4882a593Smuzhiyun    then
44*4882a593Smuzhiyun            logwatch
45*4882a593Smuzhiyun    fi
46*4882a593SmuzhiyunEOF
47*4882a593Smuzhiyun    chmod 755 ${D}${sysconfdir}/cron.daily/0logwatch
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun    install -m 0755 -d ${D}${sysconfdir}/logwatch/conf/logfiles
50*4882a593Smuzhiyun    install -m 0755 -d ${D}${sysconfdir}/logwatch/conf/services
51*4882a593Smuzhiyun    touch ${D}${sysconfdir}/logwatch/conf/logwatch.conf
52*4882a593Smuzhiyun    touch ${D}${sysconfdir}/logwatch/conf/ignore.conf
53*4882a593Smuzhiyun    touch ${D}${sysconfdir}/logwatch/conf/override.conf
54*4882a593Smuzhiyun    echo "# Local configuration options go here (defaults are in /usr/share/logwatch/default.conf/logwatch.conf)" > ${D}${sysconfdir}/logwatch/conf/logwatch.conf
55*4882a593Smuzhiyun    echo "###### REGULAR EXPRESSIONS IN THIS FILE WILL BE TRIMMED FROM REPORT OUTPUT #####" > ${D}${sysconfdir}/logwatch/conf/ignore.conf
56*4882a593Smuzhiyun    echo "# Configuration overrides for specific logfiles/services may be placed here." > ${D}${sysconfdir}/logwatch/conf/override.conf
57*4882a593Smuzhiyun}
58