From 00892161a2722ce6ad17ae511de842ccc39ded36 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Sep 11 2021 09:48:43 +0000 Subject: Import liberasurecode-1.6.1-3.el9 in CloudSIG xena --- diff --git a/.liberasurecode.metadata b/.liberasurecode.metadata new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.liberasurecode.metadata diff --git a/SOURCES/liberasurecode-1.0.5-docs.patch b/SOURCES/liberasurecode-1.0.5-docs.patch new file mode 100644 index 0000000..4d19869 --- /dev/null +++ b/SOURCES/liberasurecode-1.0.5-docs.patch @@ -0,0 +1,12 @@ +diff -ur tsg--liberasurecode-4e1290ea61e5/doc/Makefile.am tsg--liberasurecode-4e1290ea61e5-p3/doc/Makefile.am +--- tsg--liberasurecode-4e1290ea61e5/doc/Makefile.am 2015-03-13 01:47:05.000000000 -0600 ++++ tsg--liberasurecode-4e1290ea61e5-p3/doc/Makefile.am 2015-03-30 21:49:20.078340707 -0600 +@@ -1,6 +1,6 @@ + DOC_MODULE=@PACKAGE@ +-HTML_DIR=$(datadir)/$(DOC_MODULE)/html +-TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) ++HTML_DIR=$(datadir)/doc/$(DOC_MODULE)/html ++TARGET_DIR=$(HTML_DIR) + + all-local: html/index.html + diff --git a/SOURCES/liberasurecode-1.5.0-ldtest.patch b/SOURCES/liberasurecode-1.5.0-ldtest.patch new file mode 100644 index 0000000..a050da2 --- /dev/null +++ b/SOURCES/liberasurecode-1.5.0-ldtest.patch @@ -0,0 +1,72 @@ +This patch undoes parts of the following upstream patches: + +commit 19442df2cd9a5bc8ec4deded7046ea7aca1d50a2 +Author: Kota Tsuyuzaki +Date: Mon Feb 20 14:12:43 2017 -0800 + + Fix warning on automake tool + + .......... + + Change-Id: I0e79bed7755a1f286b746a70fcf56fdc972bfd5d + +commit b046ff7091e710ecafb31b13678e0092fd1d3fd7 +Author: Ondřej Nový +Date: Sun Sep 30 12:23:22 2018 +0200 + + Fix building with LD_LIBRARY_PATH set + + .......... + + Change-Id: Ib7a1d6b839d4a207ee0471b55233e1ce5d958705 + +diff -ur liberasurecode-1.6.1/Makefile.am liberasurecode-1.6.1-p3/Makefile.am +--- liberasurecode-1.6.1/Makefile.am 2019-05-24 08:10:22.000000000 -0500 ++++ liberasurecode-1.6.1-p3/Makefile.am 2020-02-05 21:12:35.031620770 -0600 +@@ -46,20 +46,38 @@ + $(LN_S) liberasurecode/config_liberasurecode.h) + + test: check +- @./test/liberasurecode_test +- @./test/alg_sig_test +- @./test/test_xor_hd_code +- @./test/libec_slap ++ $(eval SONAMES := $(shell find $(abs_top_builddir) -name '*.so')) ++ $(eval SODIRS := $(dir $(SONAMES))) ++ $(eval LD_LIBRARY_PATH := LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):$(subst / ,/:,$(SODIRS))") ++ $(eval DYLD_LIBRARY_PATH := DYLD_LIBRARY_PATH="$(DYLD_LIBRARY_PATH):$(subst / ,/:,$(SODIRS))") ++ $(eval DYLD_FALLBACK_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH=$(DYLD_FALLBACK_LIBRARY_PATH):"$(subst / ,/:,$(SODIRS))") ++ @$(LD_LIBRARY_PATH) $(DYLD_LIBRARY_PATH) $(DYLD_FALLBACK_LIBRARY_PATH) \ ++ ./test/liberasurecode_test ++ @$(LD_LIBRARY_PATH) $(DYLD_LIBRARY_PATH) $(DYLD_FALLBACK_LIBRARY_PATH) \ ++ ./test/alg_sig_test ++ @$(LD_LIBRARY_PATH) $(DYLD_LIBRARY_PATH) $(DYLD_FALLBACK_LIBRARY_PATH) \ ++ ./test/test_xor_hd_code ++ @$(LD_LIBRARY_PATH) $(DYLD_LIBRARY_PATH) $(DYLD_FALLBACK_LIBRARY_PATH) \ ++ ./test/libec_slap + + VALGRIND_EXEC_COMMAND = $(LIBTOOL_COMMAND) valgrind --tool=memcheck \ + --error-exitcode=1 --leak-check=yes --track-fds=yes \ + --malloc-fill=A5 --free-fill=DE --fullpath-after=. --trace-children=yes + + valgrind-test: check +- @$(VALGRIND_EXEC_COMMAND) ./test/alg_sig_test +- @$(VALGRIND_EXEC_COMMAND) ./test/liberasurecode_test +- @$(VALGRIND_EXEC_COMMAND) ./test/test_xor_hd_code +- @$(VALGRIND_EXEC_COMMAND) ./test/libec_slap ++ $(eval SONAMES := $(shell find $(abs_top_builddir) -name '*.so')) ++ $(eval SODIRS := $(dir $(SONAMES))) ++ $(eval LD_LIBRARY_PATH := LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):$(subst / ,/:,$(SODIRS))") ++ $(eval DYLD_LIBRARY_PATH := DYLD_LIBRARY_PATH="$(DYLD_LIBRARY_PATH):$(subst / ,/:,$(SODIRS))") ++ $(eval DYLD_FALLBACK_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH=$(DYLD_FALLBACK_LIBRARY_PATH):"$(subst / ,/:,$(SODIRS))") ++ @$(LD_LIBRARY_PATH) $(DYLD_LIBRARY_PATH) $(DYLD_FALLBACK_LIBRARY_PATH) \ ++ $(VALGRIND_EXEC_COMMAND) ./test/alg_sig_test ++ @$(LD_LIBRARY_PATH) $(DYLD_LIBRARY_PATH) $(DYLD_FALLBACK_LIBRARY_PATH) \ ++ $(VALGRIND_EXEC_COMMAND) ./test/liberasurecode_test ++ @$(LD_LIBRARY_PATH) $(DYLD_LIBRARY_PATH) $(DYLD_FALLBACK_LIBRARY_PATH) \ ++ $(VALGRIND_EXEC_COMMAND) ./test/test_xor_hd_code ++ @$(LD_LIBRARY_PATH) $(DYLD_LIBRARY_PATH) $(DYLD_FALLBACK_LIBRARY_PATH) \ ++ $(VALGRIND_EXEC_COMMAND) ./test/libec_slap + + CLEANFILES = cscope.in.out cscope.out cscope.po.out + diff --git a/SOURCES/liberasurecode-1.6.1-fragswarn.patch b/SOURCES/liberasurecode-1.6.1-fragswarn.patch new file mode 100644 index 0000000..3bdba5e --- /dev/null +++ b/SOURCES/liberasurecode-1.6.1-fragswarn.patch @@ -0,0 +1,51 @@ +commit 4568188d77815697419c8d0b2c55bcbba7f65929 +Author: Pete Zaitcev +Date: Wed Feb 5 23:26:31 2020 -0600 + + Do not discard a technical return value in tests + + Compilers are getting smarter, and we started getting this: + + libec_slap.c: In function 'test_hd_code': + libec_slap.c:285:14: error: 'frags.array' may be used uninitialized + in this function [-Werror=maybe-uninitialized] + + The fix is to consume the error code in such a way that the + test proceeds further only when frags are indeed initialized. + + Change-Id: I54db0172a36419206d00b22608523a08818f41f6 + +diff --git a/test/libec_slap.c b/test/libec_slap.c +index 78d34a2..5d029ea 100644 +--- a/test/libec_slap.c ++++ b/test/libec_slap.c +@@ -280,8 +280,12 @@ static int test_hd_code(struct ec_args *args, + } + j++; + } +- create_frags_array_set(&frags,encoded_data, args->k, encoded_parity, +- args->m, mask); ++ rc = create_frags_array_set(&frags, encoded_data, args->k, ++ encoded_parity, args->m, mask); ++ if (rc) { ++ fprintf(stderr, "No core\n"); ++ exit(2); ++ } + rc = liberasurecode_decode(desc, frags.array, frags.num_fragments, + encoded_fragment_len, 1, + &out_data, &out_data_len); +@@ -305,8 +309,12 @@ static int test_hd_code(struct ec_args *args, + mi = mi + 1 % (args->k + args->m); + mask = add_item_to_missing_mask(mask, mi); + } +- create_frags_array_set(&frags,encoded_data, args->k, encoded_parity, +- args->m, mask); ++ rc = create_frags_array_set(&frags, encoded_data, args->k, ++ encoded_parity, args->m, mask); ++ if (rc) { ++ fprintf(stderr, "No core\n"); ++ exit(2); ++ } + rc = liberasurecode_decode(desc, frags.array, frags.num_fragments, + encoded_fragment_len, 1, + &out_data, &out_data_len); diff --git a/SOURCES/liberasurecode-1.6.1-nostrncpy.patch b/SOURCES/liberasurecode-1.6.1-nostrncpy.patch new file mode 100644 index 0000000..c13ce31 --- /dev/null +++ b/SOURCES/liberasurecode-1.6.1-nostrncpy.patch @@ -0,0 +1,64 @@ +commit 0eb6cd321e312e32b3ad12c34089466eae60cd88 +Author: Corey Bryant +Date: Tue Jan 14 15:47:44 2020 -0500 + + Fix create_fake_frags_no_meta to use memset to fill frags + + These aren't C strings; we shouldn't be using strncpy and friends. + + Change-Id: I50cd7922dfa377ea27f3c9558a8a7268120ec733 + Closes-Bug: #1859710 + +diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c +index d3ca200..e60140f 100644 +--- a/test/liberasurecode_test.c ++++ b/test/liberasurecode_test.c +@@ -385,8 +385,8 @@ int *create_skips_array(struct ec_args *args, int skip) + return buf; + } + +-static int create_fake_frags_no_meta(char ***array, int num_frags, +- const char *data, int data_len) ++inline static int create_fake_frags_no_meta(char ***array, int num_frags, ++ const char data, int data_len) + { + // N.B. The difference from creat_frags_arry is to creat new + // memory allocation and set a copy of data/parity there. The +@@ -404,8 +404,7 @@ static int create_fake_frags_no_meta(char ***array, int num_frags, + // add data and parity frags + ptr = *array; + for (i = 0; i < num_frags; i++) { +- *ptr = (char *) malloc(data_len); +- strncpy(*ptr++, data, data_len); ++ *ptr++ = create_buffer(data_len, data); + _num_frags++; + } + +@@ -660,7 +659,6 @@ static void test_decode_invalid_args() + // fake_data len should be bigger than fragment_header_t for + // the verifications + int fake_data_len = 1024; +- char *fake_data = create_buffer(fake_data_len, 'y'); + + desc = liberasurecode_instance_create(EC_BACKEND_NULL, &null_args); + if (-EBACKENDNOTAVAIL == desc) { +@@ -672,9 +670,8 @@ static void test_decode_invalid_args() + // test with invalid fragments (no metadata headers) + num_avail_frags = create_fake_frags_no_meta(&avail_frags, (null_args.k + + null_args.m), +- fake_data, fake_data_len); ++ 'y', fake_data_len); + assert(num_avail_frags > 0); +- free(fake_data); + + rc = liberasurecode_decode(desc, avail_frags, num_avail_frags, + fake_data_len, 1, +@@ -697,7 +694,7 @@ static void test_decode_invalid_args() + + // test with num_fragments < (k) + num_avail_frags = create_fake_frags_no_meta(&avail_frags, (null_args.k - 1), +- " ", 1); ++ ' ', 1); + assert(num_avail_frags > 0); + rc = liberasurecode_decode(desc, avail_frags, num_avail_frags, + fake_data_len, 1, diff --git a/SPECS/liberasurecode.spec b/SPECS/liberasurecode.spec new file mode 100644 index 0000000..fe1decf --- /dev/null +++ b/SPECS/liberasurecode.spec @@ -0,0 +1,190 @@ +Name: liberasurecode +Version: 1.6.1 +Release: 3%{?dist} +Summary: Erasure Code API library written in C with pluggable backends + +# Main license is a 2-clause BSD with clause numbers removed for some reason. +License: BSD and CRC32 +URL: https://bitbucket.org/tsg-/liberasurecode/ +# We pull the tag using git CLI. Save the current command for Source0 below. +# tag=1.6.1 eval 'git archive -o ../liberasurecode-$tag.tar.gz --prefix=liberasurecode-$tag/ $tag' +# Note that as of 1.2.0, liberasurecode migrated to github.com/openstack +# and switched to tags without the 'v' prefix. +Source0: %{name}-%{version}.tar.gz +Patch2: liberasurecode-1.0.5-docs.patch +Patch3: liberasurecode-1.5.0-ldtest.patch +Patch4: liberasurecode-1.6.1-nostrncpy.patch +Patch5: liberasurecode-1.6.1-fragswarn.patch + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: coreutils +BuildRequires: doxygen +BuildRequires: findutils +BuildRequires: gcc +BuildRequires: libtool +BuildRequires: make +BuildRequires: sed +BuildRequires: zlib-devel + +%description +An API library for Erasure Code, written in C. It provides a number +of pluggable backends, such as Intel ISA-L library. + +%package doc +Summary: Documentation for %{name} + +%description doc +The documentation for %{name}. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: gcc + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%setup -q +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 + +%build +autoreconf -i -v +%configure --disable-static --disable-mmi +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +make V=1 %{?_smp_mflags} + +%check +make test + +%install +%make_install +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' +find $RPM_BUILD_ROOT%{_datadir}/doc -type f -exec chmod a-x {} ';' + +%post +/sbin/ldconfig + +%postun +/sbin/ldconfig + +# N.B. We place .so to the main package because PyECLib insists on it. +%files +%license COPYING +%doc AUTHORS ChangeLog README.md +%{_libdir}/*.so +%{_libdir}/*.so.* + +%files doc +%{_datadir}/doc/liberasurecode/html/* + +%files devel +%{_includedir}/* +%{_libdir}/pkgconfig/erasurecode-1.pc + + +%changelog +* Tue Jan 26 2021 Fedora Release Engineering - 1.6.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 1.6.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Feb 05 2020 Pete Zaitcev 1.6.1-1 +- Upstream 1.6.1 +- Add a patch for using strncpy on binary data +- Add a patch for the warning about unitialized frags.array + +* Wed Jan 29 2020 Fedora Release Engineering - 1.6.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 1.6.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue Feb 12 2019 Pete Zaitcev 1.6.0-3 +- Hush warnings that prevent building with our "warning-is-error" settings +- Fix liberasurecode_crc32_alt on s390x + +* Fri Feb 01 2019 Fedora Release Engineering - 1.6.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Sep 21 2018 Pete Zaitcev 1.6.0-1 +- Upstream 1.6.0 + +* Tue Sep 11 2018 Pete Zaitcev 1.5.0-8 +- Ensure that we're using the correct checksum +- Get tests pass on s390x (a big-endian arch) + +* Fri Jul 13 2018 Fedora Release Engineering - 1.5.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 1.5.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jan 10 2018 Pete Zaitcev 1.5.0-4 +- Stop using -p in scrptlets, it's dangerous (#1532872) + +* Thu Aug 03 2017 Fedora Release Engineering - 1.5.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.5.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Jul 05 2017 Pete Zaitcev 1.5.0-1 +- Upstream 1.5.0: --disable-mmi is included upstream + +* Thu May 25 2017 Pete Zaitcev 1.4.0-3 +- Disable unportable optimizations, avoid crash with SIGILL (#1454543) + +* Fri Feb 10 2017 Fedora Release Engineering - 1.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Dec 08 2016 Pete Zaitcev 1.4.0-1 +- Upstream 1.4.0: add isa_l_rs_cauchy + +* Thu Oct 20 2016 Pete Zaitcev 1.2.0-2 +- Relocate the .so from -devel to the main package, sigh (#1331977) + +* Wed Oct 19 2016 Pete Zaitcev 1.2.0-1 +- Upstream 1.2.0: compatible with PyECLib 1.3.1 + +* Thu Mar 03 2016 Pete Zaitcev 1.1.1-1 +- Upstream 1.1.1: bugfixes for header locations and a segfault + +* Thu Feb 04 2016 Fedora Release Engineering - 1.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Oct 23 2015 Pete Zaitcev 1.1.0-1 +- Upstream 1.1.0: better built-in reference implementation +- Enable build-time tests + +* Tue Sep 22 2015 Pete Zaitcev 1.0.9-3 +- Address final review comments (#1208695) + +* Tue Sep 15 2015 Pete Zaitcev 1.0.9-2 +- Address review comments (#1208695) + +* Fri Sep 11 2015 Pete Zaitcev 1.0.9-1 +- Release 1.0.9: true plug-in architecture + +* Fri Jul 31 2015 Pete Zaitcev 1.0.8-1 +- Release 1.0.8: build and distribution fixes +- Drop the patch for CFLAGS that was merged upstream + +* Fri Apr 17 2015 Pete Zaitcev 1.0.7-2 +- Add a patch to obey CFLAGS from the build system +- Require doxygen, else -doc package fails to install + +* Wed Apr 15 2015 Pete Zaitcev 1.0.7-1 +- Release 1.0.7: needed by PyECLib 1.0.7 +- Fetch with "git archive": no more tsg--liberasurecode-4e1290ea61e5.tar.bz2 +- Drop patch for -ldl that upstream accepted + +* Sun Mar 29 2015 Pete Zaitcev 1.0.5-1 +- Initial release