diff options
Diffstat (limited to 'meta/recipes-extended/logrotate/logrotate_3.14.0.bb')
-rw-r--r-- | meta/recipes-extended/logrotate/logrotate_3.14.0.bb | 89 |
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 @@ | |||
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 | # 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 | |||
17 | S = "${WORKDIR}/${BPN}-${PV}" | ||
18 | |||
19 | UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases" | ||
20 | UPSTREAM_CHECK_REGEX = "logrotate-(?P<pver>\d+(\.\d+)+).tar" | ||
21 | |||
22 | SRC_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 | |||
28 | SRC_URI[md5sum] = "1c0f6e6e490c4bcac0a1e77ad1310683" | ||
29 | SRC_URI[sha256sum] = "4703bdc0e2df3b322f9dff0aafc99aa9172c9e4acae28b7c924cc7d4e5b29d55" | ||
30 | |||
31 | PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}" | ||
32 | |||
33 | PACKAGECONFIG[acl] = ",,acl" | ||
34 | PACKAGECONFIG[selinux] = ",,libselinux" | ||
35 | |||
36 | CONFFILES_${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. | ||
43 | EXTRA_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. | ||
56 | OS_NAME = "Linux" | ||
57 | |||
58 | inherit autotools systemd | ||
59 | |||
60 | SYSTEMD_SERVICE_${PN} = "\ | ||
61 | ${BPN}.service \ | ||
62 | ${BPN}.timer \ | ||
63 | " | ||
64 | |||
65 | LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily" | ||
66 | LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h" | ||
67 | |||
68 | do_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 | } | ||