<commit_before>SUMMARY = "CUBE Command Server"
DESCRIPTION = "A service for taking action on commands from containers"

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"

SRC_URI = "file://cube-cmd-server \
           file://cube-cmd-handler \
           file://cube-cmd-server.service \
           file://cube-cmd-server.conf \
           file://cube-cmd-server-functions \
"
RDEPENDS_${PN} = "bash gawk dtach cube-cmd-server-functions nanoio nanoio-server"

inherit systemd
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "cube-cmd-server.service"
SYSTEMD_AUTO_ENABLE_${PN} = "enable"

PACKAGES += "${PN}-dom0-conf ${PN}-host-conf ${PN}-functions"

do_install_append() {
    install -d ${D}${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/cube-cmd-server.service ${D}${systemd_system_unitdir}

    install -d ${D}${base_sbindir}
    install -m 0755 ${WORKDIR}/cube-cmd-server ${D}${base_sbindir}
    install -m 0755 ${WORKDIR}/cube-cmd-handler ${D}${base_sbindir}

    install -d ${D}${sysconfdir}
    install -m 0644 ${WORKDIR}/cube-cmd-server.conf ${D}${sysconfdir}/cube-cmd-server.conf-host
    install -m 0644 ${WORKDIR}/cube-cmd-server.conf ${D}${sysconfdir}/cube-cmd-server.conf-dom0
    install -m 0644 ${WORKDIR}/cube-cmd-server-functions ${D}${sysconfdir}/cube-cmd-server-functions
}

FILES_${PN} = "${base_sbindir}/cube-cmd-server \
	       ${base_sbindir}/cube-cmd-handler \
	       ${systemd_system_unitdir}/cube-cmd-server.service"

FILES_${PN}-dom0-conf = "${sysconfdir}/cube-cmd-server.conf-dom0"
FILES_${PN}-host-conf = "${sysconfdir}/cube-cmd-server.conf-host"
FILES_${PN}-functions = "${sysconfdir}/cube-cmd-server-functions"

pkg_postinst_${PN}-host-conf () {
#!/bin/sh -e
mv etc/cube-cmd-server.conf-host etc/cube-cmd-server.conf
}

pkg_postinst_${PN}-dom0-conf () {
#!/bin/sh -e
mv etc/cube-cmd-server.conf-dom0 etc/cube-cmd-server.conf
}
<commit_msg>cube-cmd-server: use ${sysconfdir} versus hardcoded etc<commit_after>SUMMARY = "CUBE Command Server"
DESCRIPTION = "A service for taking action on commands from containers"

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"

SRC_URI = "file://cube-cmd-server \
           file://cube-cmd-handler \
           file://cube-cmd-server.service \
           file://cube-cmd-server.conf \
           file://cube-cmd-server-functions \
"
RDEPENDS_${PN} = "bash gawk dtach cube-cmd-server-functions nanoio nanoio-server"

inherit systemd
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "cube-cmd-server.service"
SYSTEMD_AUTO_ENABLE_${PN} = "enable"

PACKAGES += "${PN}-dom0-conf ${PN}-host-conf ${PN}-functions"

do_install_append() {
    install -d ${D}${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/cube-cmd-server.service ${D}${systemd_system_unitdir}

    install -d ${D}${base_sbindir}
    install -m 0755 ${WORKDIR}/cube-cmd-server ${D}${base_sbindir}
    install -m 0755 ${WORKDIR}/cube-cmd-handler ${D}${base_sbindir}

    install -d ${D}${sysconfdir}
    install -m 0644 ${WORKDIR}/cube-cmd-server.conf ${D}${sysconfdir}/cube-cmd-server.conf-host
    install -m 0644 ${WORKDIR}/cube-cmd-server.conf ${D}${sysconfdir}/cube-cmd-server.conf-dom0
    install -m 0644 ${WORKDIR}/cube-cmd-server-functions ${D}${sysconfdir}/cube-cmd-server-functions
}

FILES_${PN} = "${base_sbindir}/cube-cmd-server \
	       ${base_sbindir}/cube-cmd-handler \
	       ${systemd_system_unitdir}/cube-cmd-server.service"

FILES_${PN}-dom0-conf = "${sysconfdir}/cube-cmd-server.conf-dom0"
FILES_${PN}-host-conf = "${sysconfdir}/cube-cmd-server.conf-host"
FILES_${PN}-functions = "${sysconfdir}/cube-cmd-server-functions"

pkg_postinst_${PN}-host-conf () {
#!/bin/sh -e
mv ${sysconfdir}/cube-cmd-server.conf-host ${sysconfdir}/cube-cmd-server.conf
}

pkg_postinst_${PN}-dom0-conf () {
#!/bin/sh -e
mv ${sysconfdir}/cube-cmd-server.conf-dom0 ${sysconfdir}/cube-cmd-server.conf
}

{'fraction_non_alphanumeric': 0.18099547511312217, 'fraction_numerical': 0.029160382101558573, 'mean_word_length': 4.036708860759494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7588051', 'n_tokens_mistral': 1636, 'n_tokens_neox': 1524, 'n_words': 215}