Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "System Log Daemons" |
| 2 | DESCRIPTION = "The sysklogd package implements two system log daemons: syslogd, klogd" |
| 3 | HOMEPAGE = "http://www.infodrom.org/projects/sysklogd/" |
| 4 | SECTION = "base" |
| 5 | |
| 6 | LICENSE = "GPLv2+ & BSD" |
| 7 | LICENSE_syslogd = "BSD" |
| 8 | LICENSE_klogd = "GPLv2+" |
| 9 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ |
| 10 | file://syslogd.c;beginline=2;endline=15;md5=77ffb2fec48c46d7ca0abb2d5813e7fd \ |
| 11 | file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \ |
| 12 | " |
| 13 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 14 | inherit update-rc.d update-alternatives systemd |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 15 | |
| 16 | SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \ |
| 17 | file://no-strip-install.patch \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 18 | file://0001-Fix-build-with-musl.patch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | file://sysklogd \ |
| 20 | file://syslog.conf \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 21 | file://syslogd.service \ |
| 22 | file://klogd.service \ |
| 23 | file://tmpfiles.sysklogd.conf \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 24 | " |
| 25 | |
| 26 | SRC_URI_append_e500v2 = " file://no-vectorization.patch" |
| 27 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 28 | SYSTEMD_PACKAGES = "${PN}" |
| 29 | SYSTEMD_SERVICE_${PN} = "syslogd.service klogd.service" |
| 30 | SYSTEMD_AUTO_ENABLE = "enable" |
| 31 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | INITSCRIPT_NAME = "syslog" |
| 33 | CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}" |
| 34 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 35 | EXTRA_OEMAKE = "-e MAKEFLAGS=" |
| 36 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | CFLAGS_append = " -DSYSV" |
| 38 | |
| 39 | do_install () { |
| 40 | install -d ${D}${mandir}/man8 \ |
| 41 | ${D}${mandir}/man5 \ |
| 42 | ${D}${base_sbindir} |
| 43 | oe_runmake 'BINDIR=${D}${base_sbindir}' \ |
| 44 | 'MANDIR=${D}${mandir}' install |
| 45 | install -d ${D}${sysconfdir} |
| 46 | install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf |
| 47 | install -d ${D}${sysconfdir}/init.d |
| 48 | install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 49 | install -d ${D}${systemd_unitdir}/system |
| 50 | install -m 644 ${WORKDIR}/syslogd.service ${D}${systemd_unitdir}/system |
| 51 | install -m 644 ${WORKDIR}/klogd.service ${D}${systemd_unitdir}/system |
| 52 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true', 'false', d)}; then |
| 53 | install -d ${D}${exec_prefix}/lib/tmpfiles.d |
| 54 | install -m 644 ${WORKDIR}/tmpfiles.sysklogd.conf ${D}${exec_prefix}/lib/tmpfiles.d/sysklogd.conf |
| 55 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | } |
| 57 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 58 | FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/sysklogd.conf', '', d)}" |
| 59 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | # sysklogd package has no internal systemd support, so we weigh busybox's |
| 61 | # sysklogd utility over it in case of systemd |
| 62 | ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}" |
| 63 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 64 | ALTERNATIVE_${PN} = "syslogd klogd syslog-conf \ |
| 65 | ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','syslog-init','',d)}" |
| 66 | |
| 67 | ALTERNATIVE_${PN}-doc = "syslogd.8" |
| 68 | ALTERNATIVE_LINK_NAME[syslogd.8] = "${mandir}/man8/syslogd.8" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 69 | |
| 70 | ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" |
| 71 | ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd" |
| 72 | ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog" |
| 73 | ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" |
| 74 | |
| 75 | pkg_prerm_${PN} () { |
| 76 | if test "x$D" = "x"; then |
| 77 | if test "$1" = "upgrade" -o "$1" = "remove"; then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 78 | /etc/init.d/syslog stop || : |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 79 | fi |
| 80 | fi |
| 81 | } |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 82 | |
| 83 | python () { |
| 84 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
| 85 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") |
| 86 | } |