<commit_before>DESCRIPTION = "frontpanel update"
SECTION = "base"
PRIORITY = "optional"

RCONFLICTS_${PN} = "et9000-fpupdate"
RREPLACES_${PN} = "et9000-fpupdate"

PV = "1.0"
PR = "r3"

FPVERSION = "13"

SRC_URI = " \
	http://www.et-view.com/download/fpupdate-${PV}.zip \
	http://www.et-view.com/download/avrmain-${MACHINE}-${FPVERSION}.hex \
	"
S = "${WORKDIR}"

inherit update-rc.d

INITSCRIPT_NAME = "fpupdate"
INITSCRIPT_PARAMS = "start 22 S ."

FILES_${PN} = "/${bindir} /lib/firmware /etc/init.d"

do_install() {
	install -d ${D}/${bindir}
	install -d ${D}/lib/firmware
	install -m 0755 ${S}/fpupdate ${D}/${bindir}
	install -m 0644 ${S}/avrmain-${MACHINE}-${FPVERSION}.hex ${D}/lib/firmware/avrmain.hex

	echo "#!/bin/sh" > ${S}/fpupdate.sh
	echo "if ! [ -f /lib/firmware/avrmain.hex ]; then" >> ${S}/fpupdate.sh
	echo "	exit 0" >> ${S}/fpupdate.sh
	echo "fi" >> ${S}/fpupdate.sh
	echo "if ! [ -x ${bindir}/fpupdate ]; then" >> ${S}/fpupdate.sh
	echo "	exit 0" >> ${S}/fpupdate.sh
	echo "fi" >> ${S}/fpupdate.sh
	echo "${bindir}/fpupdate /lib/firmware/avrmain.hex ${FPVERSION} && rm /lib/firmware/avrmain.hex" >> ${S}/fpupdate.sh

	install -d ${D}/etc/init.d
	install -m 0755 ${S}/fpupdate.sh ${D}/etc/init.d/fpupdate
}

pkg_postinst_${PN}_append() {
	if test -z "$D"
	then
		# force update without requiring reboot
		# (update-rc.d does not restart the script, when it was already installed)
		/etc/init.d/fpupdate
	fi
	true
}

PACKAGE_ARCH := "${MACHINE_ARCH}"
<commit_msg>et-fpupdate: Set PV to firmware version<commit_after>DESCRIPTION = "frontpanel update"
SECTION = "base"
PRIORITY = "optional"

RCONFLICTS_${PN} = "et9000-fpupdate"
RREPLACES_${PN} = "et9000-fpupdate"

PR = "r3"

FPVERSION = "13"
FPUPDATE = "1.0"

PV = "${FPVERSION}"

SRC_URI = " \
	http://www.et-view.com/download/fpupdate-${FPUPDATE}.zip \
	http://www.et-view.com/download/avrmain-${MACHINE}-${FPVERSION}.hex \
	"
S = "${WORKDIR}"

inherit update-rc.d

INITSCRIPT_NAME = "fpupdate"
INITSCRIPT_PARAMS = "start 22 S ."

FILES_${PN} = "/${bindir} /lib/firmware /etc/init.d"

do_install() {
	install -d ${D}/${bindir}
	install -d ${D}/lib/firmware
	install -m 0755 ${S}/fpupdate ${D}/${bindir}
	install -m 0644 ${S}/avrmain-${MACHINE}-${FPVERSION}.hex ${D}/lib/firmware/avrmain.hex

	echo "#!/bin/sh" > ${S}/fpupdate.sh
	echo "if ! [ -f /lib/firmware/avrmain.hex ]; then" >> ${S}/fpupdate.sh
	echo "	exit 0" >> ${S}/fpupdate.sh
	echo "fi" >> ${S}/fpupdate.sh
	echo "if ! [ -x ${bindir}/fpupdate ]; then" >> ${S}/fpupdate.sh
	echo "	exit 0" >> ${S}/fpupdate.sh
	echo "fi" >> ${S}/fpupdate.sh
	echo "${bindir}/fpupdate /lib/firmware/avrmain.hex ${FPVERSION} && rm /lib/firmware/avrmain.hex" >> ${S}/fpupdate.sh

	install -d ${D}/etc/init.d
	install -m 0755 ${S}/fpupdate.sh ${D}/etc/init.d/fpupdate
}

pkg_postinst_${PN}_append() {
	if test -z "$D"
	then
		# force update without requiring reboot
		# (update-rc.d does not restart the script, when it was already installed)
		/etc/init.d/fpupdate
	fi
	true
}

PACKAGE_ARCH := "${MACHINE_ARCH}"

{'fraction_non_alphanumeric': 0.2092022509102946, 'fraction_numerical': 0.019198940748096655, 'mean_word_length': 3.8352, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4764142', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1251, 'n_words': 251}