blob: 31e971aeac55e8b1bee67df4b4ed1f261d6c43f3 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Stream EDitor (text filtering utility)"
2HOMEPAGE = "http://www.gnu.org/software/sed/"
Andrew Geissler95ac1b82021-03-31 14:34:31 -05003DESCRIPTION = "sed (stream editor) is a non-interactive command-line text editor."
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00004LICENSE = "GPL-3.0-or-later"
Andrew Geissler82c905d2020-04-13 13:39:40 -05005LIC_FILES_CHKSUM = "file://COPYING;md5=c678957b0c8e964aa6c70fd77641a71e \
6 file://sed/sed.h;beginline=1;endline=15;md5=fb3c7e6fbca6f66943859153d4be8efe \
7 "
8SECTION = "console/utils"
9
10SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.xz \
11 file://run-ptest \
12"
13
14SRC_URI[md5sum] = "6d906edfdb3202304059233f51f9a71d"
15SRC_URI[sha256sum] = "f79b0cfea71b37a8eeec8490db6c5f7ae7719c35587f21edb0617f370eeff633"
16
17inherit autotools texinfo update-alternatives gettext ptest
18
19PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
20
Patrick Williams213cb262021-08-07 19:21:33 -050021RDEPENDS:${PN}-ptest += "make gawk perl perl-module-filehandle perl-module-file-compare perl-module-file-find perl-module-file-temp perl-module-file-stat"
22RRECOMMENDS:${PN}-ptest:append:libc-glibc = " locale-base-ru-ru locale-base-en-us locale-base-el-gr.iso-8859-7"
Andrew Geissler82c905d2020-04-13 13:39:40 -050023
24EXTRA_OECONF = "--disable-acl \
25 "
26
27do_install () {
28 autotools_do_install
29 install -d ${D}${base_bindir}
30 if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
31 mv ${D}${bindir}/sed ${D}${base_bindir}/sed
32 rmdir ${D}${bindir}/
33 fi
34}
35
Patrick Williams213cb262021-08-07 19:21:33 -050036ALTERNATIVE:${PN} = "sed"
Andrew Geissler82c905d2020-04-13 13:39:40 -050037ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed"
38ALTERNATIVE_PRIORITY = "100"
39
40do_compile_ptest() {
41 oe_runmake testsuite/get-mb-cur-max testsuite/test-mbrtowc
42}
43
44do_install_ptest() {
45 cp -rf ${S}/testsuite/ ${D}${PTEST_PATH}
46 cp -rf ${B}/testsuite/* ${D}${PTEST_PATH}/testsuite/
47 cp -rf ${S}/build-aux/ ${D}${PTEST_PATH}/
48 cp ${B}/Makefile ${D}${PTEST_PATH}
49 cp ${S}/init.cfg ${D}${PTEST_PATH}
50
51 sed -e 's/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/bash/sh/' -i ${D}${PTEST_PATH}/Makefile
52 for i in `grep -rl "sed/sed" ${D}${PTEST_PATH}`; do sed -e 's/..\/sed\/sed/sed/' -i $i; done
53
54 sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
55 -e 's|${DEBUG_PREFIX_MAP}||g' \
56 -e 's:${HOSTTOOLS_DIR}/::g' \
57 -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
58 -e 's:abs_top_builddir =.*:abs_top_builddir = ..:g' \
59 -e 's:abs_top_srcdir =.*:abs_top_srcdir = ..:g' \
60 -e 's:abs_srcdir =.*:abs_srcdir = ..:g' \
61 -e 's:top_srcdir =.*:top_srcdir = ..:g' \
62 -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
63 -i ${D}${PTEST_PATH}/Makefile
64}
65
Patrick Williams213cb262021-08-07 19:21:33 -050066RPROVIDES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sed', '', d)}"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060067
68BBCLASSEXTEND = "nativesdk"