diff --git a/508.patch b/508.patch deleted file mode 100644 index 18b757d..0000000 --- a/508.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 6e389ce2c34355d36009a8fb1666bed29fa2d4f4 Mon Sep 17 00:00:00 2001 -From: "Todd C. Miller" -Date: Mon, 6 Jun 2022 13:57:38 -0600 -Subject: [PATCH] Only shift unsigned values to avoid implementation-specific - behavior. This converts the arithmetic shifts to logical shifts. It is based - in part on a stackoverflow answer by John Schultz, - https://stackoverflow.com/questions/4533076/google-protocol-buffers-zigzag-encoding - ---- - protobuf-c/protobuf-c.c | 23 +++++++++++------------ - 1 file changed, 11 insertions(+), 12 deletions(-) - -diff --git a/protobuf-c/protobuf-c.c b/protobuf-c/protobuf-c.c -index ad1bdb1..98052cd 100644 ---- a/protobuf-c/protobuf-c.c -+++ b/protobuf-c/protobuf-c.c -@@ -316,9 +316,8 @@ int32_size(int32_t v) - static inline uint32_t - zigzag32(int32_t v) - { -- // Note: the right-shift must be arithmetic -- // Note: left shift must be unsigned because of overflow -- return ((uint32_t)(v) << 1) ^ (uint32_t)(v >> 31); -+ // Note: Using unsigned types prevents undefined behavior -+ return ((uint32_t)v << 1) ^ -((uint32_t)v >> 31); - } - - /** -@@ -380,9 +379,8 @@ uint64_size(uint64_t v) - static inline uint64_t - zigzag64(int64_t v) - { -- // Note: the right-shift must be arithmetic -- // Note: left shift must be unsigned because of overflow -- return ((uint64_t)(v) << 1) ^ (uint64_t)(v >> 63); -+ // Note: Using unsigned types prevents undefined behavior -+ return ((uint64_t)v << 1) ^ -((uint64_t)v >> 63); - } - - /** -@@ -802,7 +800,8 @@ uint32_pack(uint32_t value, uint8_t *out) - } - - /** -- * Pack a signed 32-bit integer and return the number of bytes written. -+ * Pack a signed 32-bit integer and return the number of bytes written, -+ * passed as unsigned to avoid implementation-specific behavior. - * Negative numbers are encoded as two's complement 64-bit integers. - * - * \param value -@@ -813,14 +812,14 @@ uint32_pack(uint32_t value, uint8_t *out) - * Number of bytes written to `out`. - */ - static inline size_t --int32_pack(int32_t value, uint8_t *out) -+int32_pack(uint32_t value, uint8_t *out) - { -- if (value < 0) { -+ if ((int32_t)value < 0) { - out[0] = value | 0x80; - out[1] = (value >> 7) | 0x80; - out[2] = (value >> 14) | 0x80; - out[3] = (value >> 21) | 0x80; -- out[4] = (value >> 28) | 0x80; -+ out[4] = (value >> 28) | 0xf0; - out[5] = out[6] = out[7] = out[8] = 0xff; - out[9] = 0x01; - return 10; -@@ -2425,7 +2424,7 @@ static inline int32_t - unzigzag32(uint32_t v) - { - // Note: Using unsigned types prevents undefined behavior -- return (int32_t)((v >> 1) ^ (~(v & 1) + 1)); -+ return (int32_t)((v >> 1) ^ -(v & 1)); - } - - static inline uint32_t -@@ -2467,7 +2466,7 @@ static inline int64_t - unzigzag64(uint64_t v) - { - // Note: Using unsigned types prevents undefined behavior -- return (int64_t)((v >> 1) ^ (~(v & 1) + 1)); -+ return (int64_t)((v >> 1) ^ -(v & 1)); - } - - static inline uint64_t diff --git a/changelog b/changelog deleted file mode 100644 index 446336c..0000000 --- a/changelog +++ /dev/null @@ -1,148 +0,0 @@ -* Tue Mar 30 2021 Jonathan Wakely - 1.3.3-7 -- Rebuilt for removed libstdc++ symbol (#1937698) - -* Wed Jan 27 2021 Fedora Release Engineering - 1.3.3-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Tue Jan 12 14:04:27 CET 2021 Adrian Reber - 1.3.3-5 -- Rebuilt for protobuf 3.14 - -* Wed Sep 23 2020 Adrian Reber - 1.3.3-4 -- Rebuilt for protobuf 3.13 - -* Tue Jul 28 2020 Fedora Release Engineering - 1.3.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Sun Jun 14 2020 Adrian Reber - 1.3.3-2 -- Rebuilt for protobuf 3.12 - -* Mon Mar 30 2020 Adrian Reber - 1.3.3-1 -- Update to 1.3.3 -- Removed call to autoreconf - -* Thu Jan 30 2020 Fedora Release Engineering - 1.3.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Dec 19 2019 Orion Poplawski - 1.3.2-1 -- Update to 1.3.2 - -* Thu Dec 19 2019 Orion Poplawski - 1.3.1-4 -- Rebuild for protobuf 3.11 - -* Fri Jul 26 2019 Fedora Release Engineering - 1.3.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Sat Feb 02 2019 Fedora Release Engineering - 1.3.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Thu Nov 22 2018 Igor Gnatenko - 1.3.1-1 -- Update to 1.3.1 - -* Wed Nov 21 2018 Igor Gnatenko - 1.3.0-6 -- Rebuild for protobuf 3.6 - -* Fri Jul 13 2018 Fedora Release Engineering - 1.3.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Fri Feb 09 2018 Fedora Release Engineering - 1.3.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Wed Jan 31 2018 Igor Gnatenko - 1.3.0-3 -- Switch to %%ldconfig_scriptlets - -* Wed Nov 29 2017 Igor Gnatenko - 1.3.0-2 -- Rebuild for protobuf 3.5 - -* Tue Nov 14 2017 Igor Gnatenko - 1.3.0-1 -- Update to 1.3.0 - -* Mon Nov 13 2017 Igor Gnatenko - 1.2.1-8 -- Rebuild for protobuf 3.4 - -* Thu Aug 03 2017 Fedora Release Engineering - 1.2.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 1.2.1-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Tue Jun 13 2017 Orion Poplawski - 1.2.1-5 -- Rebuild for protobuf 3.3 - -* Sat Feb 11 2017 Fedora Release Engineering - 1.2.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Mon Jan 23 2017 Orion Poplawski - 1.2.1-3 -- Rebuild for protobuf 3.2.0 - -* Sat Nov 19 2016 Orion Poplawski - 1.2.1-2 -- Rebuild for protobuf 3.1.0 - -* Sun Mar 27 2016 Jan Vcelak 1.2.1-1 -- New upstream release: - + fix: negative value packing - + fix: eliminate undefined behavior in zigzag functions - + fix: generate code that uses universal zero initializer for oneof unions - -* Thu Feb 04 2016 Fedora Release Engineering - 1.1.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Wed Nov 25 2015 Nikos Mavrogiannopoulos - 1.1.1-3 -- Added protobuf-c-compiler subpackage to reduce runtime - -* Thu Jun 18 2015 Fedora Release Engineering - 1.1.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Thu Apr 23 2015 Nikos Mavrogiannopoulos - 1.1.1-1 -- new upstream release (#1142988) - -* Sat Feb 21 2015 Till Maas - 1.0.1-3 -- Rebuilt for Fedora 23 Change - https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code - -* Sun Aug 17 2014 Fedora Release Engineering - 1.0.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Wed Aug 06 2014 Nikos Mavrogiannopoulos - 1.0.1-1 -- new upstream release - -* Mon Aug 04 2014 Nikos Mavrogiannopoulos - 1.0.0-1 -- new upstream release (#1126116) - -* Sat Jun 07 2014 Fedora Release Engineering - 0.15-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Sun Aug 04 2013 Fedora Release Engineering - 0.15-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Mon Mar 11 2013 David Robinson - 0.15-7 -- rebuilt for protobuf-2.5.0 - -* Thu Feb 14 2013 Fedora Release Engineering - 0.15-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Sat Jul 21 2012 Fedora Release Engineering - 0.15-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Sat Jan 14 2012 Fedora Release Engineering - 0.15-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Sun Jun 12 2011 David Robinson - 0.15-3 -- rebuilt for protobuf-2.4.1 - -* Sun Apr 24 2011 David Robinson - 0.15-2 -- Spec file cleanup - -* Wed Apr 20 2011 David Robinson - 0.15-1 -- New upstream release -- Spec file cleanup - -* Mon Jan 17 2011 Bobby Powers - 0.14-1 -- New upstream release -- Removed -devel dependency on protobuf-devel -- Small specfile cleanups - -* Wed May 19 2010 David Robinson - 0.13-2 -- Spec file cleanup - -* Wed May 19 2010 David Robinson - 0.13-1 -- Initial packaging diff --git a/protobuf-c.spec b/protobuf-c.spec index 38a28c2..2bdfc99 100644 --- a/protobuf-c.spec +++ b/protobuf-c.spec @@ -1,15 +1,11 @@ -# Without this building protobuf-c fails -%global _lto_cflags %%{nil} - Name: protobuf-c -Version: 1.4.0 +Version: 1.4.1 Release: %autorelease Summary: C bindings for Google's Protocol Buffers License: BSD -URL: https://github.com/protobuf-c/protobuf-c +URL: https://github.com/%{name}/%{name} Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz -Patch0: https://patch-diff.githubusercontent.com/raw/protobuf-c/protobuf-c/pull/508.patch BuildRequires: make BuildRequires: gcc-c++ @@ -24,7 +20,7 @@ It uses a modified version of protoc called protoc-c. %package compiler Summary: Protocol Buffers C compiler -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %description compiler This package contains a modified version of the Protocol Buffers @@ -32,15 +28,14 @@ compiler for the C programming language called protoc-c. %package devel Summary: Protocol Buffers C headers and libraries -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: %{name}-compiler%{?_isa} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: %{name}-compiler%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %description devel This package contains protobuf-c headers and libraries. %prep -%setup -q -%patch0 -p1 +%autosetup -p1 %build %configure --disable-static @@ -51,13 +46,12 @@ make check %install %make_install -rm -vf $RPM_BUILD_ROOT/%{_libdir}/libprotobuf-c.la - -%ldconfig_scriptlets +find %{buildroot} -type f -name '*.la' -delete %files -%{_libdir}/libprotobuf-c.so.* -%doc TODO LICENSE ChangeLog +%doc TODO ChangeLog README.md +%license LICENSE +%{_libdir}/lib%{name}.so.* %files compiler %{_bindir}/protoc-c @@ -65,10 +59,10 @@ rm -vf $RPM_BUILD_ROOT/%{_libdir}/libprotobuf-c.la %files devel %dir %{_includedir}/google -%{_includedir}/protobuf-c/ -%{_includedir}/google/protobuf-c/ -%{_libdir}/libprotobuf-c.so -%{_libdir}/pkgconfig/libprotobuf-c.pc +%{_includedir}/%{name}/ +%{_includedir}/google/%{name}/ +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/lib%{name}.pc %changelog %autochangelog diff --git a/sources b/sources index 305ea45..dcefd63 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (protobuf-c-1.4.0.tar.gz) = 6a2e5031b85b5986e863661437dea002eba217257a50a27db88d29fa1a3db1014ed6ec7c21d89df700d181b18e169d1037146cb6475c10cd5a068a91e522e3c3 +SHA512 (protobuf-c-1.4.1.tar.gz) = 190a4aa5c607853e6bf860b0974deb21e4f7f6209e810251eaca9612b59ea676779b0ca217fb1572914ffb8de3315a7d24f162b14d447ee671a9adc5b1271e41