<commit_before>DESCRIPTION = "The reference implementation of the freesmartphone.org framework APIs"
HOMEPAGE = "http://www.freesmartphone.org"
AUTHOR = "FreeSmartphone.Org Development Team"
SECTION = "console/network"
DEPENDS = "python-cython-native python-pyrex-native"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
SRCREV = "c835f64c8e2b994d658a765243c60fb682fb587c"
PV = "0.9.5.9+gitr${SRCPV}"
PR = "r14"
PE = "1"

inherit distutils update-rc.d python-dir

INITSCRIPT_NAME = "frameworkd"
INITSCRIPT_PARAMS = "defaults 29"

SRC_URI = "${FREESMARTPHONE_GIT}/framework.git;protocol=git;branch=master \
           file://oeventsd-use-opimd-signals.patch \
           file://0001-oeventsd-workaround-buggy-kernel-to-get-full-vibrati.patch \
"

S = "${WORKDIR}/git"

do_configure_append() {
        echo "version=\"${PV}\"" >framework/__version__.py
}

do_install_append() {
  install -d ${D}${sysconfdir}/freesmartphone/opim/
  frameworkd_install_machine_specific_configs
}

# machines with enabled ogsmd
do_install_append_a780() {
  frameworkd_install_ogsmd_configs
}
do_install_append_eten-m800() {
  frameworkd_install_ogsmd_configs
}

frameworkd_install_ogsmd_configs() {
        # Install machine specific files
        install -d ${D}${sysconfdir}/freesmartphone/ogsmd
        install -m 0644 ${S}/etc/freesmartphone/ogsmd/cell.db ${D}${sysconfdir}/freesmartphone/ogsmd
        install -m 0644 ${S}/etc/freesmartphone/ogsmd/la.db ${D}${sysconfdir}/freesmartphone/ogsmd
        install -m 0644 ${S}/etc/freesmartphone/ogsmd/networks.tab ${D}${sysconfdir}/freesmartphone/ogsmd
}
frameworkd_install_machine_specific_configs() {
        # Fix permissions
        chmod 755 ${D}${sysconfdir}/init.d/frameworkd
        # Check for machine specific conf.
        CONF_PATH="${S}/etc"
        CONF_PATH_MACHINE="${CONF_PATH}"
        if [ -d "${CONF_PATH}/${MACHINE}" ] ; then
                CONF_PATH_MACHINE="${CONF_PATH}/${MACHINE}"
        fi
        # Install machine specific files
        install -m 0644 ${CONF_PATH_MACHINE}/frameworkd.conf ${D}${sysconfdir}

        # Check for machine specific conf.
        CONF_PATH="${S}/etc/freesmartphone/oevents"
        CONF_PATH_MACHINE="${CONF_PATH}"
        if [ -d "${CONF_PATH}/${MACHINE}" ] ; then
                CONF_PATH_MACHINE="${CONF_PATH}/${MACHINE}"
        fi
        install -m 0644 ${CONF_PATH_MACHINE}/rules.yaml ${D}${sysconfdir}/freesmartphone/oevents/
}

RDEPENDS_${PN} += "\
  fsousaged \
"

RDEPENDS_${PN} += "\
  python-ctypes \
  python-dbus \
  python-datetime \
  python-difflib \
  python-logging \
  python-pprint \
  python-pyalsaaudio \
  python-pygobject \
  python-pyrtc \
  python-pyserial \
  python-pyyaml \
  python-shell \
  python-subprocess \
  python-sqlite3 \
  python-syslog \
  python-textutils \<commit_msg>frameworkd: check even in ${MACHINE_CLASS} directory for a config file and bump PR<commit_after>DESCRIPTION = "The reference implementation of the freesmartphone.org framework APIs"
HOMEPAGE = "http://www.freesmartphone.org"
AUTHOR = "FreeSmartphone.Org Development Team"
SECTION = "console/network"
DEPENDS = "python-cython-native python-pyrex-native"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
SRCREV = "c835f64c8e2b994d658a765243c60fb682fb587c"
PV = "0.9.5.9+gitr${SRCPV}"
PR = "r14"
PE = "1"

inherit distutils update-rc.d python-dir

INITSCRIPT_NAME = "frameworkd"
INITSCRIPT_PARAMS = "defaults 29"

SRC_URI = "${FREESMARTPHONE_GIT}/framework.git;protocol=git;branch=master \
           file://oeventsd-use-opimd-signals.patch \
           file://0001-oeventsd-workaround-buggy-kernel-to-get-full-vibrati.patch \
"

S = "${WORKDIR}/git"

do_configure_append() {
        echo "version=\"${PV}\"" >framework/__version__.py
}

do_install_append() {
  install -d ${D}${sysconfdir}/freesmartphone/opim/
  frameworkd_install_machine_specific_configs
}

# machines with enabled ogsmd
do_install_append_a780() {
  frameworkd_install_ogsmd_configs
}
do_install_append_eten-m800() {
  frameworkd_install_ogsmd_configs
}

frameworkd_install_ogsmd_configs() {
        # Install machine specific files
        install -d ${D}${sysconfdir}/freesmartphone/ogsmd
        install -m 0644 ${S}/etc/freesmartphone/ogsmd/cell.db ${D}${sysconfdir}/freesmartphone/ogsmd
        install -m 0644 ${S}/etc/freesmartphone/ogsmd/la.db ${D}${sysconfdir}/freesmartphone/ogsmd
        install -m 0644 ${S}/etc/freesmartphone/ogsmd/networks.tab ${D}${sysconfdir}/freesmartphone/ogsmd
}
frameworkd_install_machine_specific_configs() {
        # Fix permissions
        chmod 755 ${D}${sysconfdir}/init.d/frameworkd
        # Check for machine specific conf.
        CONF_PATH="${S}/etc"
        CONF_PATH_MACHINE="${CONF_PATH}"
        if [ -d "${CONF_PATH}/${MACHINE}" ] ; then
                CONF_PATH_MACHINE="${CONF_PATH}/${MACHINE}"
        elif [ -d "${CONF_PATH}/${MACHINE_CLASS}" ] ; then
                CONF_PATH_MACHINE="${CONF_PATH}/${MACHINE_CLASS}"
        fi
        # Install machine specific files
        install -m 0644 ${CONF_PATH_MACHINE}/frameworkd.conf ${D}${sysconfdir}

        # Check for machine specific conf.
        CONF_PATH="${S}/etc/freesmartphone/oevents"
        CONF_PATH_MACHINE="${CONF_PATH}"
        if [ -d "${CONF_PATH}/${MACHINE}" ] ; then
                CONF_PATH_MACHINE="${CONF_PATH}/${MACHINE}"
        elif [ -d "${CONF_PATH}/${MACHINE_CLASS}" ] ; then
                CONF_PATH_MACHINE="${CONF_PATH}/${MACHINE_CLASS}"
        fi
        install -m 0644 ${CONF_PATH_MACHINE}/rules.yaml ${D}${sysconfdir}/freesmartphone/oevents/
}

RDEPENDS_${PN} += "\
  fsousaged \
"

RDEPENDS_${PN} += "\
  python-ctypes \
  python-dbus \
  python-datetime \
  python-difflib \
  python-logging \
  python-pprint \
  python-pyalsaaudio \
  python-pygobject \
  python-pyrtc \
  python-pyserial \
  python-pyyaml \
  python-shell \
  python-subprocess \
  python-sqlite3 \
  python-syslog \
  python-textutils \
{'fraction_non_alphanumeric': 0.13608384628181666, 'fraction_numerical': 0.030277823989352852, 'mean_word_length': 3.48991784914115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2387909', 'n_tokens_mistral': 2297, 'n_tokens_neox': 2173, 'n_words': 326}