From b1e429688ea3360b985413a89617707b7087a9cc Mon Sep 17 00:00:00 2001 From: lixiaoyong Date: Wed, 17 Nov 2021 09:37:51 +0800 Subject: [PATCH 1/4] add recipe for xz Signed-off-by: lixiaoyong --- meta-openeuler/recipes-core/xz/xz_5.2.5.bb | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 meta-openeuler/recipes-core/xz/xz_5.2.5.bb diff --git a/meta-openeuler/recipes-core/xz/xz_5.2.5.bb b/meta-openeuler/recipes-core/xz/xz_5.2.5.bb new file mode 100644 index 00000000000..63a91fc556a --- /dev/null +++ b/meta-openeuler/recipes-core/xz/xz_5.2.5.bb @@ -0,0 +1,45 @@ +SUMMARY = "Utilities for managing LZMA compressed files" +HOMEPAGE = "https://tukaani.org/xz/" +DESCRIPTION = "XZ Utils is free general-purpose data compression software with a high compression ratio. XZ Utils were written for POSIX-like systems, but also work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils." +SECTION = "base" + +# The source includes bits of PD, GPLv2, GPLv3, LGPLv2.1+, but the only file +# which is GPLv3 is an m4 macro which isn't shipped in any of our packages, +# and the LGPL bits are under lib/, which appears to be used for libgnu, which +# appears to be used for DOS builds. So we're left with GPLv2+ and PD. +LICENSE = "GPLv2+ & GPL-3.0-with-autoconf-exception & LGPLv2.1+ & PD" +LICENSE_${PN} = "GPLv2+" +LICENSE_${PN}-dev = "GPLv2+" +LICENSE_${PN}-staticdev = "GPLv2+" +LICENSE_${PN}-doc = "GPLv2+" +LICENSE_${PN}-dbg = "GPLv2+" +LICENSE_${PN}-locale = "GPLv2+" +LICENSE_liblzma = "PD" + +LIC_FILES_CHKSUM = "file://COPYING;md5=97d554a32881fee0aa283d96e47cb24a \ + file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \ + file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \ + file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 \ + " + +SRC_URI = "https://tukaani.org/xz/xz-${PV}.tar.gz" +SRC_URI[md5sum] = "0d270c997aff29708c74d53f599ef717" +SRC_URI[sha256sum] = "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" +UPSTREAM_CHECK_REGEX = "xz-(?P\d+(\.\d+)+)\.tar" + +CACHED_CONFIGUREVARS += "gl_cv_posix_shell=/bin/sh" + +inherit autotools gettext + +PACKAGES =+ "liblzma" + +FILES_liblzma = "${libdir}/liblzma*${SOLIBS}" + +#inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "xz xzcat unxz \ + lzma lzcat unlzma" + +BBCLASSEXTEND = "native nativesdk" -- Gitee From 199a8b7b84e3f61fae80cbcb2c39a4c14c378df3 Mon Sep 17 00:00:00 2001 From: lixiaoyong Date: Wed, 17 Nov 2021 10:52:53 +0800 Subject: [PATCH 2/4] add recipe for gzip Signed-off-by: lixiaoyong --- .../recipes-core/gzip/files/run-ptest | 6 +++ .../gzip/gzip-1.10/wrong-path-fix.patch | 36 +++++++++++++++++ meta-openeuler/recipes-core/gzip/gzip.inc | 33 +++++++++++++++ meta-openeuler/recipes-core/gzip/gzip_1.10.bb | 40 +++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 meta-openeuler/recipes-core/gzip/files/run-ptest create mode 100644 meta-openeuler/recipes-core/gzip/gzip-1.10/wrong-path-fix.patch create mode 100644 meta-openeuler/recipes-core/gzip/gzip.inc create mode 100644 meta-openeuler/recipes-core/gzip/gzip_1.10.bb diff --git a/meta-openeuler/recipes-core/gzip/files/run-ptest b/meta-openeuler/recipes-core/gzip/files/run-ptest new file mode 100644 index 00000000000..cf7c64949ab --- /dev/null +++ b/meta-openeuler/recipes-core/gzip/files/run-ptest @@ -0,0 +1,6 @@ +#!/bin/sh + +cd src/tests + +make check + diff --git a/meta-openeuler/recipes-core/gzip/gzip-1.10/wrong-path-fix.patch b/meta-openeuler/recipes-core/gzip/gzip-1.10/wrong-path-fix.patch new file mode 100644 index 00000000000..7c37bc8d2d9 --- /dev/null +++ b/meta-openeuler/recipes-core/gzip/gzip-1.10/wrong-path-fix.patch @@ -0,0 +1,36 @@ +fix MakeMaker issues with using wrong SHELL/GREP + +A set of substitution is being processed to all target scripts with sed by +replacing some key words with the detected values at configure time, this +is exactly not compliant with cross compling, and will cause missing path +errors at run time like: +"/usr/bin/zgrep: line 230: /usr/bin/grep: No such file or directory" + +Fixed by removing unneeded substitution and using real runtime paths +instead. + +Signed-off-by: Ming Liu + +Upstream-Status: Pending + +--- + Makefile.am | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index d4ecc3f..e4657d2 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -82,8 +82,7 @@ SUFFIXES = .in + .in: + $(AM_V_GEN)rm -f $@-t $@ \ + && sed \ +- -e 's|/bin/sh|$(SHELL)|g' \ +- -e 's|[@]GREP@|$(GREP)|g' \ ++ -e 's|[@]GREP@|$(base_bindir)/grep|g' \ + -e 's|[@]VERSION@|$(VERSION)|g' \ + $(srcdir)/$@.in >$@-t \ + && chmod a=rx $@-t \ +-- +2.7.4 + diff --git a/meta-openeuler/recipes-core/gzip/gzip.inc b/meta-openeuler/recipes-core/gzip/gzip.inc new file mode 100644 index 00000000000..1a0747dff83 --- /dev/null +++ b/meta-openeuler/recipes-core/gzip/gzip.inc @@ -0,0 +1,33 @@ +SUMMARY = "Standard GNU compressor" +DESCRIPTION = "GNU Gzip is a popular data compression program originally written by Jean-loup Gailly for the GNU \ +project. Mark Adler wrote the decompression part" +HOMEPAGE = "http://www.gnu.org/software/gzip/" +SECTION = "console/utils" +# change to GPLv3+ in 2007/07. Previous GPLv2 version is 1.3.12 + +inherit autotools texinfo +export DEFS="NO_ASM" + +EXTRA_OEMAKE_class-target = "GREP=${base_bindir}/grep" +EXTRA_OECONF_append_libc-musl = " gl_cv_func_fflush_stdin=yes " + +do_install_append () { + if [ "${base_bindir}" != "${bindir}" ]; then + # Rename and move files into /bin (FHS), which is typical place for gzip + install -d ${D}${base_bindir} + mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip + mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip + mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat + mv ${D}${bindir}/uncompress ${D}${base_bindir}/uncompress + fi +} + +#inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "gunzip gzip zcat" +ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip" +ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip" +ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat" + +export CONFIG_SHELL="/bin/sh" diff --git a/meta-openeuler/recipes-core/gzip/gzip_1.10.bb b/meta-openeuler/recipes-core/gzip/gzip_1.10.bb new file mode 100644 index 00000000000..9778e687e1a --- /dev/null +++ b/meta-openeuler/recipes-core/gzip/gzip_1.10.bb @@ -0,0 +1,40 @@ +require gzip.inc + +LICENSE = "GPLv3+" + +SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \ + file://run-ptest \ + " +SRC_URI_append_class-target = " file://wrong-path-fix.patch" + +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://gzip.h;beginline=8;endline=20;md5=6e47caaa630e0c8bf9f1bc8d94a8ed0e" + +PROVIDES_append_class-native = " gzip-replacement-native" + +RDEPENDS_${PN}-ptest += "make perl grep diffutils" + +BBCLASSEXTEND = "native nativesdk" + +inherit ptest + +do_install_ptest() { + mkdir -p ${D}${PTEST_PATH}/src/build-aux + cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/src/build-aux/ + mkdir -p ${D}${PTEST_PATH}/src/tests + cp -r ${S}/tests/* ${D}${PTEST_PATH}/src/tests + sed -e 's/^abs_srcdir = ..*/abs_srcdir = \.\./' \ + -e 's/^top_srcdir = ..*/top_srcdir = \.\./' \ + -e 's/^GREP = ..*/GREP = grep/' \ + -e 's/^AWK = ..*/AWK = awk/' \ + -e 's/^srcdir = ..*/srcdir = \./' \ + -e 's/^Makefile: ..*/Makefile: /' \ + -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's:${HOSTTOOLS_DIR}/::g' \ + -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ + ${B}/tests/Makefile > ${D}${PTEST_PATH}/src/tests/Makefile +} + +SRC_URI[md5sum] = "cf9ee51aff167ff69844d5d7d71c8b20" +SRC_URI[sha256sum] = "c91f74430bf7bc20402e1f657d0b252cb80aa66ba333a25704512af346633c68" -- Gitee From 6da0fced81645d1fb17bfa998971f6373f038cc9 Mon Sep 17 00:00:00 2001 From: lixiaoyong Date: Fri, 26 Nov 2021 10:04:59 +0800 Subject: [PATCH 3/4] add recipe for bzip2 Signed-off-by: lixiaoyong --- .../recipes-core/bzip2/bzip2/Makefile.am | 74 +++++++++++++++++++ .../recipes-core/bzip2/bzip2/configure.ac | 11 +++ .../recipes-core/bzip2/bzip2/run-ptest | 2 + .../recipes-core/bzip2/bzip2_1.0.8.bb | 71 ++++++++++++++++++ 4 files changed, 158 insertions(+) create mode 100644 meta-openeuler/recipes-core/bzip2/bzip2/Makefile.am create mode 100644 meta-openeuler/recipes-core/bzip2/bzip2/configure.ac create mode 100644 meta-openeuler/recipes-core/bzip2/bzip2/run-ptest create mode 100644 meta-openeuler/recipes-core/bzip2/bzip2_1.0.8.bb diff --git a/meta-openeuler/recipes-core/bzip2/bzip2/Makefile.am b/meta-openeuler/recipes-core/bzip2/bzip2/Makefile.am new file mode 100644 index 00000000000..7338df03ebe --- /dev/null +++ b/meta-openeuler/recipes-core/bzip2/bzip2/Makefile.am @@ -0,0 +1,74 @@ + +lib_LTLIBRARIES = libbz2.la +libbz2_la_LDFLAGS = -version-info 1:6:0 + +libbz2_la_SOURCES = blocksort.c \ + huffman.c \ + crctable.c \ + randtable.c \ + compress.c \ + decompress.c \ + bzlib.c + +bin_PROGRAMS = bzip2 bzip2recover + +bzip2_SOURCES = bzip2.c +bzip2_LDADD = libbz2.la +bzip2_DEPENDENCIES = libbz2.la + +include_HEADERS = bzlib.h + +bzip2recover_SOURCES = bzip2recover.c +bzip2recover_LDADD = libbz2.la +bzip2recover_DEPENDENCIES = libbz2.la + +bin_SCRIPTS = bzgrep bzmore bzdiff + +man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1 +EXTRA_DIST = $(man_MANS) + +runtest: + ./bzip2 -1 < sample1.ref > sample1.rb2 + ./bzip2 -2 < sample2.ref > sample2.rb2 + ./bzip2 -3 < sample3.ref > sample3.rb2 + ./bzip2 -d < sample1.bz2 > sample1.tst + ./bzip2 -d < sample2.bz2 > sample2.tst + ./bzip2 -ds < sample3.bz2 > sample3.tst + @if cmp sample1.bz2 sample1.rb2; then echo "PASS: sample1 compress";\ + else echo "FAIL: sample1 compress"; fi + @if cmp sample2.bz2 sample2.rb2; then echo "PASS: sample2 compress";\ + else echo "FAIL: sample2 compress"; fi + @if cmp sample3.bz2 sample3.rb2; then echo "PASS: sample3 compress";\ + else echo "FAIL: sample3 compress"; fi + @if cmp sample1.tst sample1.ref; then echo "PASS: sample1 decompress";\ + else echo "FAIL: sample1 decompress"; fi + @if cmp sample2.tst sample2.ref; then echo "PASS: sample2 decompress";\ + else echo "FAIL: sample2 decompress"; fi + @if cmp sample3.tst sample3.ref; then echo "PASS: sample3 decompress";\ + else echo "FAIL: sample3 decompress"; fi + ./bzip2-tests/run-tests.sh --without-valgrind --tests-dir="$(PWD)/bzip2-tests" + +install-ptest: + sed -n '/^runtest:/,/^install-ptest:/{/^install-ptest:/!p}' \ + $(srcdir)/Makefile.am > $(DESTDIR)/Makefile + cp $(srcdir)/sample1.ref $(DESTDIR)/ + cp $(srcdir)/sample2.ref $(DESTDIR)/ + cp $(srcdir)/sample3.ref $(DESTDIR)/ + cp $(srcdir)/sample1.bz2 $(DESTDIR)/ + cp $(srcdir)/sample2.bz2 $(DESTDIR)/ + cp $(srcdir)/sample3.bz2 $(DESTDIR)/ + ln -s $(bindir)/bzip2 $(DESTDIR)/bzip2 + +install-exec-hook: + ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT) + ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT) + ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT) + ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT) + ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT) + ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT) + +install-data-hook: + echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1 + echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1 + echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1 + echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1 diff --git a/meta-openeuler/recipes-core/bzip2/bzip2/configure.ac b/meta-openeuler/recipes-core/bzip2/bzip2/configure.ac new file mode 100644 index 00000000000..b8abade2d96 --- /dev/null +++ b/meta-openeuler/recipes-core/bzip2/bzip2/configure.ac @@ -0,0 +1,11 @@ +AC_PREREQ([2.57]) + +AC_INIT(bzip2, %BZIP2_VERSION%) +AM_INIT_AUTOMAKE(foreign) +AM_MAINTAINER_MODE + +AC_PROG_CC +AC_PROG_LIBTOOL + +AC_OUTPUT([Makefile]) + diff --git a/meta-openeuler/recipes-core/bzip2/bzip2/run-ptest b/meta-openeuler/recipes-core/bzip2/bzip2/run-ptest new file mode 100644 index 00000000000..3b20fce1ee9 --- /dev/null +++ b/meta-openeuler/recipes-core/bzip2/bzip2/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +make -k runtest diff --git a/meta-openeuler/recipes-core/bzip2/bzip2_1.0.8.bb b/meta-openeuler/recipes-core/bzip2/bzip2_1.0.8.bb new file mode 100644 index 00000000000..c200a7a33ce --- /dev/null +++ b/meta-openeuler/recipes-core/bzip2/bzip2_1.0.8.bb @@ -0,0 +1,71 @@ +SUMMARY = "Very high-quality data compression program" +DESCRIPTION = "bzip2 compresses files using the Burrows-Wheeler block-sorting text compression algorithm, and \ +Huffman coding. Compression is generally considerably better than that achieved by more conventional \ +LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors." +HOMEPAGE = "https://sourceware.org/bzip2/" +SECTION = "console/utils" +LICENSE = "bzip2-1.0.6 & GPLv3+ & Apache-2.0 & MS-PL & BSD-3-Clause & Zlib" +LICENSE_${PN} = "bzip2-1.0.6" +LICENSE_${PN}-dev = "bzip2-1.0.6" +LICENSE_${PN}-dbg = "bzip2-1.0.6" +LICENSE_${PN}-doc = "bzip2-1.0.6" +LICENSE_${PN}-src = "bzip2-1.0.6" +LICENSE_libbz2 = "bzip2-1.0.6" +LICENSE_${PN}-ptest = "bzip2-1.0.6 & GPLv3+ & Apache-2.0 & MS-PL & BSD-3-Clause & Zlib" + +LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;endline=37;md5=600af43c50f1fcb82e32f19b32df4664 \ + file://${WORKDIR}/git/commons-compress/LICENSE.txt;md5=86d3f3a95c324c9479bd8986968f4327 \ + file://${WORKDIR}/git/dotnetzip/License.txt;md5=9cb56871eed4e748c3bc7e8ff352a54f \ + file://${WORKDIR}/git/dotnetzip/License.zlib.txt;md5=cc421ccd22eeb2e5db6b79e6de0a029f \ + file://${WORKDIR}/git/go/LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707 \ + file://${WORKDIR}/git/lbzip2/COPYING;md5=d32239bcb673463ab874e80d47fae504 \ +" + +SRC_URI = "https://sourceware.org/pub/${BPN}/${BPN}-${PV}.tar.gz \ + git://sourceware.org/git/bzip2-tests.git;name=bzip2-tests \ + file://configure.ac;subdir=${BP} \ + file://Makefile.am;subdir=${BP} \ + file://run-ptest \ + " +SRC_URI[md5sum] = "67e051268d0c475ea773822f7500d0e5" +SRC_URI[sha256sum] = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" + +SRCREV_bzip2-tests = "f9061c030a25de5b6829e1abf373057309c734c0" + +UPSTREAM_CHECK_URI = "https://www.sourceware.org/pub/bzip2/" + +PACKAGES =+ "libbz2" + +CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64" + +#inherit autotools update-alternatives ptest relative_symlinks +inherit autotools ptest relative_symlinks + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "bunzip2 bzcat bzip2" + +#install binaries to bzip2-native under sysroot for replacement-native +EXTRA_OECONF_append_class-native = " --bindir=${STAGING_BINDIR_NATIVE}/${PN}" + +do_configure_prepend () { + sed -i -e "s|%BZIP2_VERSION%|${PV}|" ${S}/configure.ac +} + +do_install_ptest () { + install -d ${D}${PTEST_PATH}/bzip2-tests + cp -r ${WORKDIR}/git/commons-compress ${D}${PTEST_PATH}/bzip2-tests/commons-compress + cp -r ${WORKDIR}/git/dotnetzip ${D}${PTEST_PATH}/bzip2-tests/dotnetzip + cp -r ${WORKDIR}/git/go ${D}${PTEST_PATH}/bzip2-tests/go + cp -r ${WORKDIR}/git/lbzip2 ${D}${PTEST_PATH}/bzip2-tests/lbzip2 + cp -r ${WORKDIR}/git/pyflate ${D}${PTEST_PATH}/bzip2-tests/pyflate + cp ${WORKDIR}/git/README ${D}${PTEST_PATH}/bzip2-tests/ + cp ${WORKDIR}/git/run-tests.sh ${D}${PTEST_PATH}/bzip2-tests/ + sed -i -e "s|^Makefile:|_Makefile:|" ${D}${PTEST_PATH}/Makefile +} + +FILES_libbz2 = "${libdir}/lib*${SOLIBS}" + +RDEPENDS_${PN}-ptest += "make bash" + +PROVIDES_append_class-native = " bzip2-replacement-native" +BBCLASSEXTEND = "native nativesdk" -- Gitee From 38423eeeba71363571b4cff9b7358273ea29f330 Mon Sep 17 00:00:00 2001 From: lixiaoyong Date: Fri, 26 Nov 2021 10:08:07 +0800 Subject: [PATCH 4/4] add recipe for less Signed-off-by: lixiaoyong --- meta-openeuler/recipes-core/less/less_563.bb | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 meta-openeuler/recipes-core/less/less_563.bb diff --git a/meta-openeuler/recipes-core/less/less_563.bb b/meta-openeuler/recipes-core/less/less_563.bb new file mode 100644 index 00000000000..763176ae222 --- /dev/null +++ b/meta-openeuler/recipes-core/less/less_563.bb @@ -0,0 +1,43 @@ +SUMMARY = "Text file viewer similar to more" +DESCRIPTION = "Less is a program similar to more, i.e. a terminal \ +based program for viewing text files and the output from other \ +programs. Less offers many features beyond those that more does." +HOMEPAGE = "http://www.greenwoodsoftware.com/" +SECTION = "console/utils" + +# (GPLv2+ (<< 418), GPLv3+ (>= 418)) | less +# Including email author giving permissing to use BSD +# +# From: Mark Nudelman +# To: Elizabeth Flanagan