summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/logrotate
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/logrotate')
-rw-r--r--meta/recipes-extended/logrotate/logrotate_3.14.0.bb20
1 files changed, 15 insertions, 5 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate_3.14.0.bb b/meta/recipes-extended/logrotate/logrotate_3.14.0.bb
index d48539f84f..ccc68ad3ac 100644
--- a/meta/recipes-extended/logrotate/logrotate_3.14.0.bb
+++ b/meta/recipes-extended/logrotate/logrotate_3.14.0.bb
@@ -34,9 +34,9 @@ PACKAGECONFIG[acl] = ",,acl"
34PACKAGECONFIG[selinux] = ",,libselinux" 34PACKAGECONFIG[selinux] = ",,libselinux"
35 35
36CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \ 36CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \
37 ${sysconfdir}/logrotate.conf \ 37 ${sysconfdir}/logrotate.conf \
38 ${sysconfdir}/logrotate.d/btmp \ 38 ${sysconfdir}/logrotate.d/btmp \
39 ${sysconfdir}/logrotate.d/wtmp" 39 ${sysconfdir}/logrotate.d/wtmp"
40 40
41# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our 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. 42# optimization variables, so use it rather than EXTRA_CFLAGS.
@@ -62,8 +62,11 @@ SYSTEMD_SERVICE_${PN} = "\
62 ${BPN}.timer \ 62 ${BPN}.timer \
63" 63"
64 64
65LOGROTATE_OPTIONS ?= ""
66
65LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily" 67LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily"
66LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h" 68LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h"
69LOGROTATE_SYSTEMD_TIMER_PERSISTENT ?= "true"
67 70
68do_install(){ 71do_install(){
69 oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} 72 oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir}
@@ -78,8 +81,15 @@ do_install(){
78 install -d ${D}${systemd_system_unitdir} 81 install -d ${D}${systemd_system_unitdir}
79 install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service 82 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 83 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 84 [ -z "${LOGROTATE_OPTIONS}" ] ||
82 sed -i -e 's,AccuracySec=.*$,AccuracySec=${LOGROTATE_SYSTEMD_TIMER_ACCURACY},g' ${D}${systemd_system_unitdir}/logrotate.timer 85 sed -ri \
86 -e 's|(ExecStart=.*/logrotate.*)$|\1 ${LOGROTATE_OPTIONS}|g' \
87 ${D}${systemd_system_unitdir}/logrotate.service
88 sed -ri \
89 -e 's|(OnCalendar=).*$|\1${LOGROTATE_SYSTEMD_TIMER_BASIS}|g' \
90 -e 's|(AccuracySec=).*$|\1${LOGROTATE_SYSTEMD_TIMER_ACCURACY}|g' \
91 -e 's|(Persistent=).*$|\1${LOGROTATE_SYSTEMD_TIMER_PERSISTENT}|g' \
92 ${D}${systemd_system_unitdir}/logrotate.timer
83 fi 93 fi
84 94
85 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then 95 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then