blob: 7d0a15961bf47175b03f04af471002aee217c082 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Rotates, compresses, removes and mails system log files"
2SECTION = "console/utils"
3HOMEPAGE = "https://fedorahosted.org/logrotate/"
4LICENSE = "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
13SRC_URI = "https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.gz \
14 file://act-as-mv-when-rotate.patch \
15 file://update-the-manual.patch \
16 file://disable-check-different-filesystems.patch \
17 "
18
19SRC_URI[md5sum] = "4492b145b6d542e4a2f41e77fa199ab0"
20SRC_URI[sha256sum] = "022769e3288c80981559a8421703c88e8438b447235e36dd3c8e97cd94c52545"
21
22PACKAGECONFIG ?= "\
23 ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
24 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
25"
26
27PACKAGECONFIG[acl] = ",,acl"
28PACKAGECONFIG[selinux] = ",,libselinux"
29
30CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \
31 ${sysconfdir}/logrotate.conf"
32
33# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
34# optimization variables, so use it rather than EXTRA_CFLAGS.
35EXTRA_OEMAKE = "\
36 LFS= \
37 OS_NAME='${OS_NAME}' \
38 'CC=${CC}' \
39 'RPM_OPT_FLAGS=${CFLAGS}' \
40 'EXTRA_LDFLAGS=${LDFLAGS}' \
41 ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \
42 ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \
43"
44
45# OS_NAME in the makefile defaults to `uname -s`. The behavior for
46# freebsd/netbsd is questionable, so leave it as Linux, which only sets
47# INSTALL=install and BASEDIR=/usr.
48OS_NAME = "Linux"
49
50do_compile_prepend() {
51 # Make sure the recompile is OK
52 rm -f ${B}/.depend
53}
54
55do_install(){
56 oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} BINDIR=${bindir}
57 mkdir -p ${D}${sysconfdir}/logrotate.d
58 mkdir -p ${D}${sysconfdir}/cron.daily
59 mkdir -p ${D}${localstatedir}/lib
60 install -p -m 644 examples/logrotate-default ${D}${sysconfdir}/logrotate.conf
61 install -p -m 755 examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
62 touch ${D}${localstatedir}/lib/logrotate.status
63}