Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- recipes-extended/bzip2/bzip2-morello_1.0.8.bb | 72 ++++++++++++++++++ recipes-extended/bzip2/files/Makefile.am | 74 +++++++++++++++++++ recipes-extended/bzip2/files/configure.ac | 11 +++ recipes-extended/bzip2/files/run-ptest | 2 + 4 files changed, 159 insertions(+) create mode 100644 recipes-extended/bzip2/bzip2-morello_1.0.8.bb create mode 100644 recipes-extended/bzip2/files/Makefile.am create mode 100644 recipes-extended/bzip2/files/configure.ac create mode 100644 recipes-extended/bzip2/files/run-ptest
diff --git a/recipes-extended/bzip2/bzip2-morello_1.0.8.bb b/recipes-extended/bzip2/bzip2-morello_1.0.8.bb new file mode 100644 index 0000000..f526263 --- /dev/null +++ b/recipes-extended/bzip2/bzip2-morello_1.0.8.bb @@ -0,0 +1,72 @@ +inherit autotools update-alternatives ptest relative_symlinks purecap-sysroot + +MORELLO_SRC = "poky/meta/recipes-extended/bzip2/bzip2_1.0.8.bb" + +SUMMARY = "Very high-quality data compression program - CHERI: sourced from poky/meta" +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 & GPL-3.0-or-later & 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 & GPL-3.0-or-later & Apache-2.0 & MS-PL & BSD-3-Clause & Zlib" + +TOOLCHAIN = "${MORELLO_TOOLCHAIN}" + +BPN_BZIP2 = "bzip2" + +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/%24%7BBPN_BZIP2%7D/%24%7BBPN_BZIP2%7D-%24%7BPV%7D... \ + git://sourceware.org/git/bzip2-tests.git;name=bzip2-tests;branch=master \ + file://configure.ac;subdir=${BPN_BZIP2}-${PV} \ + file://Makefile.am;subdir=${BPN_BZIP2}-${PV} \ + file://run-ptest \ + " + +S = "${WORKDIR}/${BPN_BZIP2}-${PV}" + +SRC_URI[md5sum] = "67e051268d0c475ea773822f7500d0e5" +SRC_URI[sha256sum] = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" + +SRCREV_bzip2-tests = "f9061c030a25de5b6829e1abf373057309c734c0" + +UPSTREAM_CHECK_URI = "https://www.sourceware.org/pub/bzip2/" + +PACKAGES =+ "libbz2-morello" + +CFLAGS:append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64" + +ALTERNATIVE_PRIORITY = "100" + +do_configure:prepend () { + sed -i -e "s|%BZIP2_VERSION%|${PV}|" ${S}/configure.ac +} + +PTEST_PATH = "${libdir}/bzip2/ptest" + +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 +} + +RDEPENDS:${PN}-ptest += "make bash" \ No newline at end of file diff --git a/recipes-extended/bzip2/files/Makefile.am b/recipes-extended/bzip2/files/Makefile.am new file mode 100644 index 0000000..d12d3a4 --- /dev/null +++ b/recipes-extended/bzip2/files/Makefile.am @@ -0,0 +1,74 @@ + +lib_LTLIBRARIES = libbz2.la +libbz2_la_LDFLAGS = -version-info 1:8: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/recipes-extended/bzip2/files/configure.ac b/recipes-extended/bzip2/files/configure.ac new file mode 100644 index 0000000..b8abade --- /dev/null +++ b/recipes-extended/bzip2/files/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/recipes-extended/bzip2/files/run-ptest b/recipes-extended/bzip2/files/run-ptest new file mode 100644 index 0000000..3b20fce --- /dev/null +++ b/recipes-extended/bzip2/files/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +make -k runtest