diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2021-01-19 14:45:46 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-20 22:46:17 +0000 |
commit | e2d2e65f81209ef3e630a94157b397fcc97ff2ba (patch) | |
tree | c157bc9d71ad1b47b099e07f3b9f465619b4de08 /meta/recipes-extended/logrotate/logrotate_3.18.0.bb | |
parent | 3f5f9d748422cb837879281535fb9c79bbb09c5c (diff) | |
download | poky-e2d2e65f81209ef3e630a94157b397fcc97ff2ba.tar.gz |
logrotate: upgrade 3.17.0 -> 3.18.0
(From OE-Core rev: 4efc2586a43a399c0f91a26d66a33ac47b8778e2)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/logrotate/logrotate_3.18.0.bb')
-rw-r--r-- | meta/recipes-extended/logrotate/logrotate_3.18.0.bb | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate_3.18.0.bb b/meta/recipes-extended/logrotate/logrotate_3.18.0.bb new file mode 100644 index 0000000000..270052f46f --- /dev/null +++ b/meta/recipes-extended/logrotate/logrotate_3.18.0.bb | |||
@@ -0,0 +1,91 @@ | |||
1 | SUMMARY = "Rotates, compresses, removes and mails system log files" | ||
2 | SECTION = "console/utils" | ||
3 | HOMEPAGE = "https://github.com/logrotate/logrotate/issues" | ||
4 | LICENSE = "GPLv2" | ||
5 | |||
6 | # TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox? | ||
7 | |||
8 | DEPENDS="coreutils popt" | ||
9 | |||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
11 | |||
12 | UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases" | ||
13 | UPSTREAM_CHECK_REGEX = "logrotate-(?P<pver>\d+(\.\d+)+).tar" | ||
14 | |||
15 | SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz \ | ||
16 | file://act-as-mv-when-rotate.patch \ | ||
17 | file://0001-Update-the-manual.patch \ | ||
18 | file://disable-check-different-filesystems.patch \ | ||
19 | " | ||
20 | |||
21 | SRC_URI[sha256sum] = "841f81bf09d0014e4a2e11af166bb33fcd8429cc0c2d4a7d3d9ceb3858cfccc5" | ||
22 | |||
23 | PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}" | ||
24 | |||
25 | PACKAGECONFIG[acl] = ",,acl" | ||
26 | PACKAGECONFIG[selinux] = ",,libselinux" | ||
27 | |||
28 | CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \ | ||
29 | ${sysconfdir}/logrotate.conf \ | ||
30 | ${sysconfdir}/logrotate.d/btmp \ | ||
31 | ${sysconfdir}/logrotate.d/wtmp" | ||
32 | |||
33 | # If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our | ||
34 | # optimization variables, so use it rather than EXTRA_CFLAGS. | ||
35 | EXTRA_OEMAKE = "\ | ||
36 | LFS= \ | ||
37 | OS_NAME='${OS_NAME}' \ | ||
38 | 'CC=${CC}' \ | ||
39 | 'RPM_OPT_FLAGS=${CFLAGS}' \ | ||
40 | 'EXTRA_LDFLAGS=${LDFLAGS}' \ | ||
41 | ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \ | ||
42 | ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \ | ||
43 | " | ||
44 | |||
45 | # OS_NAME in the makefile defaults to `uname -s`. The behavior for | ||
46 | # freebsd/netbsd is questionable, so leave it as Linux, which only sets | ||
47 | # INSTALL=install and BASEDIR=/usr. | ||
48 | OS_NAME = "Linux" | ||
49 | |||
50 | inherit autotools systemd | ||
51 | |||
52 | SYSTEMD_SERVICE_${PN} = "\ | ||
53 | ${BPN}.service \ | ||
54 | ${BPN}.timer \ | ||
55 | " | ||
56 | |||
57 | LOGROTATE_OPTIONS ?= "" | ||
58 | |||
59 | LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily" | ||
60 | LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h" | ||
61 | LOGROTATE_SYSTEMD_TIMER_PERSISTENT ?= "true" | ||
62 | |||
63 | do_install(){ | ||
64 | oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} | ||
65 | mkdir -p ${D}${sysconfdir}/logrotate.d | ||
66 | mkdir -p ${D}${localstatedir}/lib | ||
67 | install -p -m 644 ${S}/examples/logrotate.conf ${D}${sysconfdir}/logrotate.conf | ||
68 | install -p -m 644 ${S}/examples/btmp ${D}${sysconfdir}/logrotate.d/btmp | ||
69 | install -p -m 644 ${S}/examples/wtmp ${D}${sysconfdir}/logrotate.d/wtmp | ||
70 | touch ${D}${localstatedir}/lib/logrotate.status | ||
71 | |||
72 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
73 | install -d ${D}${systemd_system_unitdir} | ||
74 | install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service | ||
75 | install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer | ||
76 | [ -z "${LOGROTATE_OPTIONS}" ] || | ||
77 | sed -ri \ | ||
78 | -e 's|(ExecStart=.*/logrotate.*)$|\1 ${LOGROTATE_OPTIONS}|g' \ | ||
79 | ${D}${systemd_system_unitdir}/logrotate.service | ||
80 | sed -ri \ | ||
81 | -e 's|(OnCalendar=).*$|\1${LOGROTATE_SYSTEMD_TIMER_BASIS}|g' \ | ||
82 | -e 's|(AccuracySec=).*$|\1${LOGROTATE_SYSTEMD_TIMER_ACCURACY}|g' \ | ||
83 | -e 's|(Persistent=).*$|\1${LOGROTATE_SYSTEMD_TIMER_PERSISTENT}|g' \ | ||
84 | ${D}${systemd_system_unitdir}/logrotate.timer | ||
85 | fi | ||
86 | |||
87 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
88 | mkdir -p ${D}${sysconfdir}/cron.daily | ||
89 | install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate | ||
90 | fi | ||
91 | } | ||