summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/logrotate/logrotate_3.14.0.bb
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2018-04-03 07:54:46 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-05-04 13:28:02 +0100
commit602c7d65bb1d3f19b99b4f950442f298025f2104 (patch)
treea449e273da7a4702aa3cb7a08c4faf246c1dffc8 /meta/recipes-extended/logrotate/logrotate_3.14.0.bb
parent7a4684c381772b9605111a96f4baf9e8974b1bd7 (diff)
downloadpoky-602c7d65bb1d3f19b99b4f950442f298025f2104.tar.gz
logrotate: update to 3.14.0
Since the wtmp and btmp definitions had been moved from logrotate.conf to logrotate.d in this release, we also need to install them to /etc/logrotate.d/. Also update oeqa runtime logrotate test case. (From OE-Core rev: 5b4aedd6b18b6ba6ca1bcd460a0b51ced41656cd) Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/logrotate/logrotate_3.14.0.bb')
-rw-r--r--meta/recipes-extended/logrotate/logrotate_3.14.0.bb89
1 files changed, 89 insertions, 0 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate_3.14.0.bb b/meta/recipes-extended/logrotate/logrotate_3.14.0.bb
new file mode 100644
index 0000000000..d48539f84f
--- /dev/null
+++ b/meta/recipes-extended/logrotate/logrotate_3.14.0.bb
@@ -0,0 +1,89 @@
1SUMMARY = "Rotates, compresses, removes and mails system log files"
2SECTION = "console/utils"
3HOMEPAGE = "https://github.com/logrotate/logrotate/issues"
4LICENSE = "GPLv2"
5
6# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox?
7
8DEPENDS="coreutils popt"
9
10LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
11
12# When updating logrotate to latest upstream, SRC_URI should point to
13# a proper release tarball from https://github.com/logrotate/logrotate/releases
14# and we have to take the snapshot for now because there is no such
15# tarball available for 3.9.1.
16
17S = "${WORKDIR}/${BPN}-${PV}"
18
19UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases"
20UPSTREAM_CHECK_REGEX = "logrotate-(?P<pver>\d+(\.\d+)+).tar"
21
22SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz \
23 file://act-as-mv-when-rotate.patch \
24 file://update-the-manual.patch \
25 file://disable-check-different-filesystems.patch \
26 "
27
28SRC_URI[md5sum] = "1c0f6e6e490c4bcac0a1e77ad1310683"
29SRC_URI[sha256sum] = "4703bdc0e2df3b322f9dff0aafc99aa9172c9e4acae28b7c924cc7d4e5b29d55"
30
31PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}"
32
33PACKAGECONFIG[acl] = ",,acl"
34PACKAGECONFIG[selinux] = ",,libselinux"
35
36CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \
37 ${sysconfdir}/logrotate.conf \
38 ${sysconfdir}/logrotate.d/btmp \
39 ${sysconfdir}/logrotate.d/wtmp"
40
41# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
42# optimization variables, so use it rather than EXTRA_CFLAGS.
43EXTRA_OEMAKE = "\
44 LFS= \
45 OS_NAME='${OS_NAME}' \
46 'CC=${CC}' \
47 'RPM_OPT_FLAGS=${CFLAGS}' \
48 'EXTRA_LDFLAGS=${LDFLAGS}' \
49 ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \
50 ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \
51"
52
53# OS_NAME in the makefile defaults to `uname -s`. The behavior for
54# freebsd/netbsd is questionable, so leave it as Linux, which only sets
55# INSTALL=install and BASEDIR=/usr.
56OS_NAME = "Linux"
57
58inherit autotools systemd
59
60SYSTEMD_SERVICE_${PN} = "\
61 ${BPN}.service \
62 ${BPN}.timer \
63"
64
65LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily"
66LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h"
67
68do_install(){
69 oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir}
70 mkdir -p ${D}${sysconfdir}/logrotate.d
71 mkdir -p ${D}${localstatedir}/lib
72 install -p -m 644 ${S}/examples/logrotate-default ${D}${sysconfdir}/logrotate.conf
73 install -p -m 644 ${S}/examples/btmp ${D}${sysconfdir}/logrotate.d/btmp
74 install -p -m 644 ${S}/examples/wtmp ${D}${sysconfdir}/logrotate.d/wtmp
75 touch ${D}${localstatedir}/lib/logrotate.status
76
77 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
78 install -d ${D}${systemd_system_unitdir}
79 install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service
80 install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer
81 sed -i -e 's,OnCalendar=.*$,OnCalendar=${LOGROTATE_SYSTEMD_TIMER_BASIS},g' ${D}${systemd_system_unitdir}/logrotate.timer
82 sed -i -e 's,AccuracySec=.*$,AccuracySec=${LOGROTATE_SYSTEMD_TIMER_ACCURACY},g' ${D}${systemd_system_unitdir}/logrotate.timer
83 fi
84
85 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
86 mkdir -p ${D}${sysconfdir}/cron.daily
87 install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
88 fi
89}