Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-integ / recipes-support / syslog-ng / syslog-ng_%.bbappend
1 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
2
3 inherit stx-metadata
4
5 STX_REPO = "config-files"
6 STX_SUBPATH = "syslog-ng-config"
7
8 LICENSE_append = "& Apache-2.0"
9 LIC_FILES_CHKSUM += "\
10         file://stx-configfiles-LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
11         "
12
13 SRC_URI += " \
14         file://syslog-ng-config-parse-err.patch;striplevel=3 \
15         file://syslog-ng-config-systemd-service.patch;striplevel=3 \
16         file://syslog-ng-conf-replace-match-with-message.patch;striplevel=3 \ 
17         "
18
19
20 do_unpack_append() {
21     bb.build.exec_func('do_copy_config_files', d)
22 }
23
24 do_copy_config_files () {
25     cp -pf ${STX_METADATA_PATH}/files/LICENSE ${S}/stx-configfiles-LICENSE
26     cp -pf ${STX_METADATA_PATH}/files/syslog-ng.conf ${S}/syslog-ng.conf
27     cp -pf ${STX_METADATA_PATH}/files/syslog-ng.service ${S}/syslog-ng.service
28     cp -pf ${STX_METADATA_PATH}/files/syslog-ng.logrotate ${S}/syslog-ng.logortate
29     cp -pf ${STX_METADATA_PATH}/files/remotelogging.conf ${S}/remotelogging.conf
30     cp -pf ${STX_METADATA_PATH}/files//fm_event_syslogger ${S}/fm_event_syslogger
31 }
32
33 do_install_append () {
34     rm -rf ${D}${systemd_unitdir}/system/multi-user.target.wants
35
36         chmod 644 ${D}/${sysconfdir}/syslog-ng/syslog-ng.conf
37
38     install -D -m644 ${S}/remotelogging.conf ${D}/${sysconfdir}/syslog-ng/remotelogging.conf
39     install -D -m700 ${S}/fm_event_syslogger ${D}/${sbindir}/fm_event_syslogger
40
41
42     install -D -m700 ${S}/fm_event_syslogger ${D}/${sbindir}/fm_event_syslogger
43     install -D -m644 ${S}/syslog-ng.logrotate ${D}/${sysconfdir}/logrotate.d/syslog
44     install -D -m644 ${S}/remotelogging.conf ${D}/${sysconfdir}/syslog-ng/remotelogging.conf
45     install -D -m644 ${S}/syslog-ng.conf ${D}/${sysconfdir}/syslog-ng/syslog-ng.conf
46
47     # install -D -m644 ${S}/syslog-ng.service ${D}/${sysconfdir}/systemd/system/syslog-ng.service
48     install -D -m644 ${S}/syslog-ng.service  ${D}/${systemd_system_unitdir}/syslog-ng.service
49         # Fix the config version to avoid warning
50     sed -i -e 's/\(@version: \).*/\1 3.19/' ${D}${sysconfdir}/syslog-ng/syslog-ng.conf
51     # Workaround: comment out the udp source to aviod the service fail to start at boot time
52     sed -i -e 's/\(.*s_udp.*\)/#\1/' ${D}/${sysconfdir}/syslog-ng/syslog-ng.conf
53         # And replace default unit file with stx specific service file
54         rm -f ${D}/${systemd_system_unitdir}/syslog-ng@.service
55
56 }
57
58 # SYSTEMD_PACKAGES_append = "${PN}"
59 SYSTEMD_SERVICE_${PN} = "syslog-ng.service"
60 SYSTEMD_AUTO_ENABLE = "enable"
61 RDEPENDS_${PN}_append = " bash"