<commit_before>#
# base recipe: meta/recipes-extended/gawk/gawk_4.2.1.bb
# base branch: master
# base commit: a5d1288804e517dee113cb9302149541f825d316
#

SUMMARY = "GNU awk text processing utility"
DESCRIPTION = "The GNU version of awk, a text processing utility. \
Awk interprets a special-purpose programming language to do \
quick and easy text pattern matching and reformatting jobs."
HOMEPAGE = "https://www.gnu.org/software/gawk/"

inherit debian-package
require recipes-debian/sources/gawk.inc

LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"

DEPENDS += "readline"

# run-ptest: test script for ptest
SRC_URI += " \
file://run-ptest \
"

# source format is 3.0 (quilt) but there is no debian/patches
DEBIAN_QUILT_PATCHES = ""

inherit autotools gettext update-alternatives

do_configure() {
	# Debian removed *.texi out of source code.
	# Touch them to pass compiling.
	oe_runconf
	touch --date="Jan 01 2000" \
		${S}/doc/gawktexi.in ${S}/doc/gawk.texi ${S}/doc/gawkinet.texi \
		${S}/doc/gawkworkflow.texi ${S}/doc/gawkworkflow.info \
		${S}/doc/gawk.info ${S}/doc/gawkinet.info ${S}/doc/sidebar.awk
}

do_install_append() {
	# Remove unwanted files.
	rm -f ${D}${bindir}/*awk-*
	rm -f ${D}${bindir}/awk
	# Remove fake info files
	rm -rf ${D}${datadir}/info
}

FILES_${PN} += "${datadir}/awk"

ALTERNATIVE_${PN} = "awk"
ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
ALTERNATIVE_PRIORITY = "100"

inherit ptest

do_install_ptest() {
	mkdir ${D}${PTEST_PATH}/test
	for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests; \
		do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
	done
	sed -i -e 's|/usr/local/bin|${bindir}|g' \<commit_msg>gawk: ptest: update do_install_ptest() recipe<commit_after>#
# base recipe: meta/recipes-extended/gawk/gawk_4.2.1.bb
# base branch: master
# base commit: <PASSWORD>
#

SUMMARY = "GNU awk text processing utility"
DESCRIPTION = "The GNU version of awk, a text processing utility. \
Awk interprets a special-purpose programming language to do \
quick and easy text pattern matching and reformatting jobs."
HOMEPAGE = "https://www.gnu.org/software/gawk/"

inherit debian-package
require recipes-debian/sources/gawk.inc

LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"

DEPENDS += "readline"

# run-ptest: test script for ptest
SRC_URI += " \
file://run-ptest \
"

# source format is 3.0 (quilt) but there is no debian/patches
DEBIAN_QUILT_PATCHES = ""

inherit autotools gettext update-alternatives

do_configure() {
	# Debian removed *.texi out of source code.
	# Touch them to pass compiling.
	oe_runconf
	touch --date="Jan 01 2000" \
		${S}/doc/gawktexi.in ${S}/doc/gawk.texi ${S}/doc/gawkinet.texi \
		${S}/doc/gawkworkflow.texi ${S}/doc/gawkworkflow.info \
		${S}/doc/gawk.info ${S}/doc/gawkinet.info ${S}/doc/sidebar.awk
}

do_install_append() {
	# Remove unwanted files.
	rm -f ${D}${bindir}/*awk-*
	rm -f ${D}${bindir}/awk
	# Remove fake info files
	rm -rf ${D}${datadir}/info
}

FILES_${PN} += "${datadir}/awk"

ALTERNATIVE_${PN} = "awk"
ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
ALTERNATIVE_PRIORITY = "100"

inherit ptest

do_install_ptest() {
	mkdir ${D}${PTEST_PATH}/test
	for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests inclib.awk; \
		do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
	done
	sed -i -e 's|/usr/local/bin|${bindir}|g' \
{'fraction_non_alphanumeric': 0.16526285216381062, 'fraction_numerical': 0.030787104269532385, 'mean_word_length': 4.306625577812018, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5880899', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1373, 'n_words': 313}