diff options
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r-- | meta/recipes-extended/logrotate/logrotate_3.12.3.bb | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate_3.12.3.bb b/meta/recipes-extended/logrotate/logrotate_3.12.3.bb index 2033be1e2d..05705bedbe 100644 --- a/meta/recipes-extended/logrotate/logrotate_3.12.3.bb +++ b/meta/recipes-extended/logrotate/logrotate_3.12.3.bb | |||
@@ -53,14 +53,33 @@ EXTRA_OEMAKE = "\ | |||
53 | # INSTALL=install and BASEDIR=/usr. | 53 | # INSTALL=install and BASEDIR=/usr. |
54 | OS_NAME = "Linux" | 54 | OS_NAME = "Linux" |
55 | 55 | ||
56 | inherit autotools | 56 | inherit autotools systemd |
57 | |||
58 | SYSTEMD_SERVICE_${PN} = "\ | ||
59 | ${PN}.service \ | ||
60 | ${PN}.timer \ | ||
61 | " | ||
62 | |||
63 | LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily" | ||
64 | LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h" | ||
57 | 65 | ||
58 | do_install(){ | 66 | do_install(){ |
59 | oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} | 67 | oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} |
60 | mkdir -p ${D}${sysconfdir}/logrotate.d | 68 | mkdir -p ${D}${sysconfdir}/logrotate.d |
61 | mkdir -p ${D}${sysconfdir}/cron.daily | ||
62 | mkdir -p ${D}${localstatedir}/lib | 69 | mkdir -p ${D}${localstatedir}/lib |
63 | install -p -m 644 ${S}/examples/logrotate-default ${D}${sysconfdir}/logrotate.conf | 70 | install -p -m 644 ${S}/examples/logrotate-default ${D}${sysconfdir}/logrotate.conf |
64 | install -p -m 755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate | ||
65 | touch ${D}${localstatedir}/lib/logrotate.status | 71 | touch ${D}${localstatedir}/lib/logrotate.status |
72 | |||
73 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
74 | install -d ${D}${systemd_system_unitdir} | ||
75 | install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service | ||
76 | install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer | ||
77 | sed -i -e 's,OnCalendar=.*$,OnCalendar=${LOGROTATE_SYSTEMD_TIMER_BASIS},g' ${D}${systemd_system_unitdir}/logrotate.timer | ||
78 | sed -i -e 's,AccuracySec=.*$,AccuracySec=${LOGROTATE_SYSTEMD_TIMER_ACCURACY},g' ${D}${systemd_system_unitdir}/logrotate.timer | ||
79 | fi | ||
80 | |||
81 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
82 | mkdir -p ${D}${sysconfdir}/cron.daily | ||
83 | install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate | ||
84 | fi | ||
66 | } | 85 | } |