Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Rotates, compresses, removes and mails system log files" |
| 2 | SECTION = "console/utils" |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame^] | 3 | HOMEPAGE = "https://github.com/logrotate/logrotate/issues" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 4 | LICENSE = "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 | |
| 9 | DEPENDS="coreutils popt" |
| 10 | |
| 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760" |
| 12 | |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame^] | 13 | # 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 | |
| 18 | S = "${WORKDIR}/${BPN}-r3-9-1" |
| 19 | |
| 20 | UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases" |
| 21 | |
| 22 | SRC_URI = "https://github.com/${BPN}/${BPN}/archive/r3-9-1.tar.gz \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | file://act-as-mv-when-rotate.patch \ |
| 24 | file://update-the-manual.patch \ |
| 25 | file://disable-check-different-filesystems.patch \ |
| 26 | " |
| 27 | |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame^] | 28 | SRC_URI[md5sum] = "8572b7c2cf9ade09a8a8e10098500fb3" |
| 29 | SRC_URI[sha256sum] = "5bf8e478c428e7744fefa465118f8296e7e771c981fb6dffb7527856a0ea3617" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | |
| 31 | PACKAGECONFIG ?= "\ |
| 32 | ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \ |
| 33 | ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \ |
| 34 | " |
| 35 | |
| 36 | PACKAGECONFIG[acl] = ",,acl" |
| 37 | PACKAGECONFIG[selinux] = ",,libselinux" |
| 38 | |
| 39 | CONFFILES_${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. |
| 44 | EXTRA_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. |
| 57 | OS_NAME = "Linux" |
| 58 | |
| 59 | do_compile_prepend() { |
| 60 | # Make sure the recompile is OK |
| 61 | rm -f ${B}/.depend |
| 62 | } |
| 63 | |
| 64 | do_install(){ |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 65 | oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 66 | 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 | } |