summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/logrotate/logrotate_3.22.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/logrotate/logrotate_3.22.0.bb')
-rw-r--r--meta/recipes-extended/logrotate/logrotate_3.22.0.bb115
1 files changed, 0 insertions, 115 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate_3.22.0.bb b/meta/recipes-extended/logrotate/logrotate_3.22.0.bb
deleted file mode 100644
index 7995438408..0000000000
--- a/meta/recipes-extended/logrotate/logrotate_3.22.0.bb
+++ /dev/null
@@ -1,115 +0,0 @@
1SUMMARY = "Rotates, compresses, removes and mails system log files"
2SECTION = "console/utils"
3HOMEPAGE = "https://github.com/logrotate/logrotate/"
4DESCRIPTION = "The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files."
5LICENSE = "GPL-2.0-only"
6
7# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox?
8
9DEPENDS = "coreutils popt"
10
11LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
12
13SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.xz \
14 file://run-ptest \
15 file://0001-test-avoid-locale-dependent-errno-string.patch \
16 "
17
18SRC_URI[sha256sum] = "42b4080ee99c9fb6a7d12d8e787637d057a635194e25971997eebbe8d5e57618"
19
20CVE_STATUS_GROUPS = "CVE_STATUS_RECIPE"
21CVE_STATUS_RECIPE = "CVE-2011-1548 CVE-2011-1549 CVE-2011-1550"
22CVE_STATUS_RECIPE[status] = "not-applicable-platform: CVE is debian, gentoo or SUSE specific on the way logrotate was installed/used"
23
24PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}"
25
26PACKAGECONFIG[acl] = ",,acl"
27PACKAGECONFIG[selinux] = ",,libselinux"
28
29CONFFILES:${PN} += "${localstatedir}/lib/logrotate.status \
30 ${sysconfdir}/logrotate.conf \
31 ${sysconfdir}/logrotate.d/btmp \
32 ${sysconfdir}/logrotate.d/wtmp"
33
34# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
35# optimization variables, so use it rather than EXTRA_CFLAGS.
36EXTRA_OEMAKE = "\
37 LFS= \
38 OS_NAME='${OS_NAME}' \
39 'CC=${CC}' \
40 'RPM_OPT_FLAGS=${CFLAGS}' \
41 'EXTRA_LDFLAGS=${LDFLAGS}' \
42 ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \
43 ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \
44"
45
46# OS_NAME in the makefile defaults to `uname -s`. The behavior for
47# freebsd/netbsd is questionable, so leave it as Linux, which only sets
48# INSTALL=install and BASEDIR=/usr.
49OS_NAME = "Linux"
50
51inherit autotools systemd github-releases ptest
52
53SYSTEMD_SERVICE:${PN} = "\
54 ${BPN}.service \
55 ${BPN}.timer \
56"
57
58LOGROTATE_OPTIONS ?= ""
59
60LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily"
61LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h"
62LOGROTATE_SYSTEMD_TIMER_PERSISTENT ?= "true"
63
64do_install(){
65 oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir}
66 mkdir -p ${D}${sysconfdir}/logrotate.d
67 mkdir -p ${D}${localstatedir}/lib
68 install -p -m 644 ${S}/examples/logrotate.conf ${D}${sysconfdir}/logrotate.conf
69 install -p -m 644 ${S}/examples/btmp ${D}${sysconfdir}/logrotate.d/btmp
70 install -p -m 644 ${S}/examples/wtmp ${D}${sysconfdir}/logrotate.d/wtmp
71
72 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
73 install -d ${D}${systemd_system_unitdir}
74 install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service
75 install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer
76 [ -z "${LOGROTATE_OPTIONS}" ] ||
77 sed -ri \
78 -e 's|(ExecStart=.*/logrotate.*)$|\1 ${LOGROTATE_OPTIONS}|g' \
79 ${D}${systemd_system_unitdir}/logrotate.service
80 sed -ri \
81 -e 's|(OnCalendar=).*$|\1${LOGROTATE_SYSTEMD_TIMER_BASIS}|g' \
82 -e 's|(AccuracySec=).*$|\1${LOGROTATE_SYSTEMD_TIMER_ACCURACY}|g' \
83 -e 's|(Persistent=).*$|\1${LOGROTATE_SYSTEMD_TIMER_PERSISTENT}|g' \
84 ${D}${systemd_system_unitdir}/logrotate.timer
85 fi
86
87 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
88 mkdir -p ${D}${sysconfdir}/cron.daily
89 install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
90 fi
91}
92
93do_install_ptest() {
94 cp -r ${S}/test/* ${D}${PTEST_PATH}
95 cp ${S}/test-driver ${D}${PTEST_PATH}
96 cp ${B}/test/Makefile ${D}${PTEST_PATH}
97
98 # Do not rebuild Makefile
99 sed -i 's/^Makefile:/_Makefile:/' ${D}${PTEST_PATH}/Makefile
100
101 # Fix top_builddir and top_srcdir
102 sed -e 's/^top_builddir = \(.*\)/top_builddir = ./' \
103 -e 's/^top_srcdir = \(.*\)/top_srcdir = ./' \
104 -i ${D}${PTEST_PATH}/Makefile
105
106 # Replace bash with sh
107 sed -i 's,/bin/bash,/bin/sh,' ${D}${PTEST_PATH}/Makefile
108
109 # Replace gawk with awk
110 sed -i 's/gawk/awk/' ${D}${PTEST_PATH}/Makefile
111 ln -s ${sbindir}/logrotate ${D}${PTEST_PATH}
112}
113
114# coreutils is needed to have "readlink"
115RDEPENDS:${PN}-ptest += "make coreutils"