diff options
author | Jackie Huang <jackie.huang@windriver.com> | 2017-08-24 11:19:53 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-08-28 11:06:04 +0200 |
commit | d853932c664edaed63d5491a7cee1e1031f41ff4 (patch) | |
tree | d1fa05672d3234862132268009966ba8b4f81306 | |
parent | 8530df3ff6e1b3609926035677b6422da9445d22 (diff) | |
download | meta-openembedded-d853932c664edaed63d5491a7cee1e1031f41ff4.tar.gz |
logcheck: update to 1.3.18 and move to meta-perl
- logcheck depends on mime-construct which is in meta-perl,
so move it to meta-perl to avoid that meta-oe depends on
meta-perl.
- logcheck should not be run as root, so inherit useradd
and add proper user and group.
- Add missing runtime dependencies according to the file
debian/control and simple test by running "logcheck -ot".
- For syslog, debian directly depends on rsyslog, but logcheck
works with any syslog and we have busybox-syslog, sysklogd,
syslog-ng and rsyslog, so use VIRTUAL-RUNTIME_syslog for the
syslog dependency and set rsyslog as the default, which can be
easily overridden in distro conf file or local.conf.
- Don't install /var/lock when populating rootfs. Do it
through volatile.
- install header.txt for generated mails
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r-- | meta-oe/recipes-extended/logcheck/logcheck_1.3.17.bb | 38 | ||||
-rw-r--r-- | meta-perl/recipes-extended/logcheck/files/99_logcheck | 2 | ||||
-rw-r--r-- | meta-perl/recipes-extended/logcheck/logcheck_1.3.18.bb | 78 |
3 files changed, 80 insertions, 38 deletions
diff --git a/meta-oe/recipes-extended/logcheck/logcheck_1.3.17.bb b/meta-oe/recipes-extended/logcheck/logcheck_1.3.17.bb deleted file mode 100644 index ba4c2ab9a..000000000 --- a/meta-oe/recipes-extended/logcheck/logcheck_1.3.17.bb +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | SUMMARY = "Analyzes log files and sends noticeable events as email" | ||
2 | DESCRIPTION = "\ | ||
3 | Logcheck is a simple utility which is designed to allow a system administrator \ | ||
4 | to view the log-files which are produced upon hosts under their control. \ | ||
5 | It does this by mailing summaries of the log-files to them, after first \ | ||
6 | filtering out "normal" entries. \ | ||
7 | Normal entries are entries which match one of the many included regular \ | ||
8 | expression files contain in the database." | ||
9 | SECTION = "Applications/System" | ||
10 | LICENSE = "GPLv2" | ||
11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c93c0550bd3173f4504b2cbd8991e50b" | ||
12 | |||
13 | SRC_URI = "git://git.debian.org/git/logcheck/logcheck.git" | ||
14 | SRCREV = "2429e67ad875fee8a0234c64d504277b038c89cd" | ||
15 | |||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | do_install() { | ||
19 | # Fix QA Issue | ||
20 | sed -i '/install -d $(DESTDIR)\/var\/lock\/logcheck/s/^/#/' Makefile | ||
21 | |||
22 | # "make install" do not install the manpages. Install them manually. | ||
23 | install -m 755 -d ${D}${mandir}/man1 | ||
24 | install -m 755 -d ${D}${mandir}/man8 | ||
25 | install -m 644 docs/logcheck-test.1 ${D}${mandir}/man1/ | ||
26 | install -m 644 docs/logtail.8 ${D}${mandir}/man8/ | ||
27 | install -m 644 docs/logtail2.8 ${D}${mandir}/man8/ | ||
28 | sed -i "s/syslog/messages/" etc/logcheck.logfiles | ||
29 | sed -i "s/auth\.log/secure/" etc/logcheck.logfiles | ||
30 | install -m 755 -d ${D}${sysconfdir}/cron.d | ||
31 | install -m 644 debian/logcheck.cron.d ${D}${sysconfdir}/cron.d/logcheck | ||
32 | install -m 755 -d ${D}/var/lib/logcheck | ||
33 | oe_runmake install DESTDIR=${D} | ||
34 | } | ||
35 | |||
36 | RDEPENDS_${PN} = "perl" | ||
37 | |||
38 | FILES_${PN} += "${datadir}/logtail" | ||
diff --git a/meta-perl/recipes-extended/logcheck/files/99_logcheck b/meta-perl/recipes-extended/logcheck/files/99_logcheck new file mode 100644 index 000000000..4de33aca3 --- /dev/null +++ b/meta-perl/recipes-extended/logcheck/files/99_logcheck | |||
@@ -0,0 +1,2 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d logcheck logcheck 0755 /var/lock/logcheck none | ||
diff --git a/meta-perl/recipes-extended/logcheck/logcheck_1.3.18.bb b/meta-perl/recipes-extended/logcheck/logcheck_1.3.18.bb new file mode 100644 index 000000000..24c19b72a --- /dev/null +++ b/meta-perl/recipes-extended/logcheck/logcheck_1.3.18.bb | |||
@@ -0,0 +1,78 @@ | |||
1 | SUMMARY = "Analyzes log files and sends noticeable events as email" | ||
2 | DESCRIPTION = "\ | ||
3 | Logcheck is a simple utility which is designed to allow a system administrator \ | ||
4 | to view the log-files which are produced upon hosts under their control. \ | ||
5 | It does this by mailing summaries of the log-files to them, after first \ | ||
6 | filtering out "normal" entries. \ | ||
7 | Normal entries are entries which match one of the many included regular \ | ||
8 | expression files contain in the database." | ||
9 | SECTION = "Applications/System" | ||
10 | LICENSE = "GPLv2" | ||
11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c93c0550bd3173f4504b2cbd8991e50b" | ||
12 | |||
13 | SRC_URI = "git://git.debian.org/git/logcheck/logcheck.git \ | ||
14 | file://99_logcheck \ | ||
15 | " | ||
16 | SRCREV = "0a5865d80fa34c55387a1917a3e6f885bcff7f1d" | ||
17 | |||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | inherit useradd | ||
21 | |||
22 | USERADD_PACKAGES = "${PN}" | ||
23 | USERADD_PARAM_${PN} = "-m -g ${BPN} -G adm -r -d ${localstatedir}/lib/${BPN} \ | ||
24 | -s /bin/false -c 'logcheck account' ${BPN}" | ||
25 | GROUPADD_PARAM_${PN} = "-r ${BPN}" | ||
26 | |||
27 | do_install() { | ||
28 | # Fix QA Issue | ||
29 | sed -i '/install -d $(DESTDIR)\/var\/lock\/logcheck/s/^/#/' Makefile | ||
30 | |||
31 | # "make install" do not install the manpages. Install them manually. | ||
32 | install -m 755 -d ${D}${mandir}/man1 | ||
33 | install -m 755 -d ${D}${mandir}/man8 | ||
34 | install -m 644 docs/logcheck-test.1 ${D}${mandir}/man1/ | ||
35 | install -m 644 docs/logtail.8 ${D}${mandir}/man8/ | ||
36 | install -m 644 docs/logtail2.8 ${D}${mandir}/man8/ | ||
37 | |||
38 | install -m 755 -d ${D}${sysconfdir}/cron.d | ||
39 | install -m 644 debian/logcheck.cron.d ${D}${sysconfdir}/cron.d/logcheck | ||
40 | install -m 755 -d ${D}/var/lib/logcheck | ||
41 | |||
42 | oe_runmake install DESTDIR=${D} | ||
43 | |||
44 | # install header.txt for generated mails | ||
45 | install -m 0644 ${S}/debian/header.txt ${D}${sysconfdir}/${BPN} | ||
46 | |||
47 | chown -R ${BPN}:${BPN} ${D}${localstatedir}/lib/${BPN} | ||
48 | chown -R root:${BPN} ${D}${sysconfdir}/${BPN} | ||
49 | |||
50 | # Don't install /var/lock when populating rootfs. Do it through volatile | ||
51 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
52 | install -d ${D}${sysconfdir}/default/volatiles | ||
53 | install -m 0644 ${WORKDIR}/99_logcheck ${D}${sysconfdir}/default/volatiles | ||
54 | fi | ||
55 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
56 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
57 | echo "d /var/lock/logcheck 0755 logcheck logcheck -" \ | ||
58 | > ${D}${sysconfdir}/tmpfiles.d/logcheck.conf | ||
59 | fi | ||
60 | } | ||
61 | |||
62 | VIRTUAL-RUNTIME_syslog ??= "rsyslog" | ||
63 | |||
64 | RDEPENDS_${PN} = "\ | ||
65 | bash \ | ||
66 | cronie \ | ||
67 | debianutils-run-parts \ | ||
68 | grep \ | ||
69 | lockfile-progs \ | ||
70 | mime-construct \ | ||
71 | perl \ | ||
72 | perl-module-file-basename \ | ||
73 | perl-module-getopt-std \ | ||
74 | perl-module-file-glob \ | ||
75 | ${VIRTUAL-RUNTIME_syslog} \ | ||
76 | " | ||
77 | |||
78 | FILES_${PN} += "${datadir}/logtail" | ||