blob: 5bd338117eec932021d835a607c1614592870ec8 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Rotates, compresses, removes and mails system log files"
2SECTION = "console/utils"
Brad Bishop37a0e4d2017-12-04 01:01:44 -05003HOMEPAGE = "https://github.com/logrotate/logrotate/issues"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004LICENSE = "GPLv2"
5
6# TODO: logrotate 3.8.8 adds autotools/automake support, update recipe to use it.
7# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox?
8
9DEPENDS="coreutils popt"
10
11LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
12
Brad Bishop37a0e4d2017-12-04 01:01:44 -050013# When updating logrotate to latest upstream, SRC_URI should point to
14# a proper release tarball from https://github.com/logrotate/logrotate/releases
15# and we have to take the snapshot for now because there is no such
16# tarball available for 3.9.1.
17
18S = "${WORKDIR}/${BPN}-r3-9-1"
19
20UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases"
21
22SRC_URI = "https://github.com/${BPN}/${BPN}/archive/r3-9-1.tar.gz \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023 file://act-as-mv-when-rotate.patch \
24 file://update-the-manual.patch \
25 file://disable-check-different-filesystems.patch \
26 "
27
Brad Bishop37a0e4d2017-12-04 01:01:44 -050028SRC_URI[md5sum] = "8572b7c2cf9ade09a8a8e10098500fb3"
29SRC_URI[sha256sum] = "5bf8e478c428e7744fefa465118f8296e7e771c981fb6dffb7527856a0ea3617"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030
31PACKAGECONFIG ?= "\
32 ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
33 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
34"
35
36PACKAGECONFIG[acl] = ",,acl"
37PACKAGECONFIG[selinux] = ",,libselinux"
38
39CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \
40 ${sysconfdir}/logrotate.conf"
41
42# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
43# optimization variables, so use it rather than EXTRA_CFLAGS.
44EXTRA_OEMAKE = "\
45 LFS= \
46 OS_NAME='${OS_NAME}' \
47 'CC=${CC}' \
48 'RPM_OPT_FLAGS=${CFLAGS}' \
49 'EXTRA_LDFLAGS=${LDFLAGS}' \
50 ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \
51 ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \
52"
53
54# OS_NAME in the makefile defaults to `uname -s`. The behavior for
55# freebsd/netbsd is questionable, so leave it as Linux, which only sets
56# INSTALL=install and BASEDIR=/usr.
57OS_NAME = "Linux"
58
59do_compile_prepend() {
60 # Make sure the recompile is OK
61 rm -f ${B}/.depend
62}
63
64do_install(){
Patrick Williamsf1e5d692016-03-30 15:21:19 -050065 oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066 mkdir -p ${D}${sysconfdir}/logrotate.d
67 mkdir -p ${D}${sysconfdir}/cron.daily
68 mkdir -p ${D}${localstatedir}/lib
69 install -p -m 644 examples/logrotate-default ${D}${sysconfdir}/logrotate.conf
70 install -p -m 755 examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
71 touch ${D}${localstatedir}/lib/logrotate.status
72}