Compare commits
No commits in common. "c8" and "c9s" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/protobuf-c-1.3.0.tar.gz
|
||||
/protobuf-c-*.tar.gz
|
||||
|
||||
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
@ -1,14 +1,14 @@
|
||||
Name: protobuf-c
|
||||
Version: 1.3.0
|
||||
Release: 8%{?dist}
|
||||
Version: 1.3.3
|
||||
Release: 13%{?dist}
|
||||
Summary: C bindings for Google's Protocol Buffers
|
||||
|
||||
License: BSD
|
||||
URL: https://github.com/protobuf-c/protobuf-c
|
||||
Source0: https://github.com/protobuf-c/protobuf-c/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
||||
Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
||||
Patch0: %{url}/commit/ec3d900001a13ccdaa8aef996b34c61159c76217.patch
|
||||
|
||||
BuildRequires: autoconf automake libtool
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: pkgconfig(protobuf)
|
||||
|
||||
@ -40,7 +40,6 @@ This package contains protobuf-c headers and libraries.
|
||||
%patch -P 0 -p 1
|
||||
|
||||
%build
|
||||
autoreconf -ifv
|
||||
%configure --disable-static
|
||||
%make_build
|
||||
|
||||
@ -69,17 +68,70 @@ rm -vf $RPM_BUILD_ROOT/%{_libdir}/libprotobuf-c.la
|
||||
%{_libdir}/pkgconfig/libprotobuf-c.pc
|
||||
|
||||
%changelog
|
||||
* Tue Apr 25 2023 Adrian Reber <areber@redhat.com> - 1.3.0-8
|
||||
- Rebuild for gating test
|
||||
* Fri Apr 14 2023 Adrian Reber <areber@redhat.com> - 1.3.3-13
|
||||
- Applied patch for for CVE-2022-48468 (#2186677)
|
||||
|
||||
* Mon Apr 24 2023 Adrian Reber <areber@redhat.com> - 1.3.0-7
|
||||
- Applied patch for for CVE-2022-48468 (#2186678)
|
||||
* Thu Feb 24 2022 Adrian Reber <areber@redhat.com> - 1.3.3-12
|
||||
- Adapt tests to protobuf-c 1.3.3
|
||||
|
||||
* Wed Feb 03 2021 Petr Menšík <pemensik@redhat.com> - 1.3.0-6
|
||||
- Rebuild for gating test (#1919904)
|
||||
* Wed Feb 23 2022 Adrian Reber <areber@redhat.com> - 1.3.3-11
|
||||
- Added gating tests
|
||||
|
||||
* Tue Feb 02 2021 Petr Menšík <pemensik@redhat.com> - 1.3.0-5
|
||||
- Move devel subpackage to AppStream
|
||||
* Wed Feb 23 2022 Adrian Reber <areber@redhat.com> - 1.3.3-10
|
||||
- Rebuilt for errata
|
||||
|
||||
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.3.3-9
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.3.3-8
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
|
||||
* Tue Mar 30 2021 Jonathan Wakely <jwakely@redhat.com> - 1.3.3-7
|
||||
- Rebuilt for removed libstdc++ symbol (#1937698)
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Jan 12 14:04:27 CET 2021 Adrian Reber <adrian@lisas.de> - 1.3.3-5
|
||||
- Rebuilt for protobuf 3.14
|
||||
|
||||
* Wed Sep 23 2020 Adrian Reber <adrian@lisas.de> - 1.3.3-4
|
||||
- Rebuilt for protobuf 3.13
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Sun Jun 14 2020 Adrian Reber <adrian@lisas.de> - 1.3.3-2
|
||||
- Rebuilt for protobuf 3.12
|
||||
|
||||
* Mon Mar 30 2020 Adrian Reber <adrian@lisas.de> - 1.3.3-1
|
||||
- Update to 1.3.3
|
||||
- Removed call to autoreconf
|
||||
|
||||
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Dec 19 2019 Orion Poplawski <orion@nwra.com> - 1.3.2-1
|
||||
- Update to 1.3.2
|
||||
|
||||
* Thu Dec 19 2019 Orion Poplawski <orion@nwra.com> - 1.3.1-4
|
||||
- Rebuild for protobuf 3.11
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Thu Nov 22 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.3.1-1
|
||||
- Update to 1.3.1
|
||||
|
||||
* Wed Nov 21 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.3.0-6
|
||||
- Rebuild for protobuf 3.6
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
||||
SHA512 (protobuf-c-1.3.3.tar.gz) = 85308348929487e3a89158c6078dab39cee0b39a0611a4d5ba73d20520e41d96915e42a0d6060ebd3eb7d922c82444f5ca000ea4f8791b37734485cbb7e283b1
|
||||
11
tests/Makefile
Normal file
11
tests/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
all: add_person_c
|
||||
|
||||
protoc_middleman: addressbook.proto
|
||||
protoc-c --c_out=. addressbook.proto
|
||||
|
||||
add_person_c: add_person.c protoc_middleman
|
||||
pkg-config --libs libprotobuf-c # fails if protobuf is not installed
|
||||
gcc add_person.c addressbook.pb-c.c -o add_person_c `pkg-config --libs libprotobuf-c`
|
||||
|
||||
clean:
|
||||
rm -f add_person_c addressbook.pb-c.c addressbook.pb-c.h
|
||||
63
tests/add_person.c
Normal file
63
tests/add_person.c
Normal file
@ -0,0 +1,63 @@
|
||||
// Based on the examples from protobuf-c
|
||||
|
||||
#include "addressbook.pb-c.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Foo__Person__PhoneNumber__Comment comment = FOO__PERSON__PHONE_NUMBER__COMMENT__INIT;
|
||||
Foo__Person__PhoneNumber phone = FOO__PERSON__PHONE_NUMBER__INIT;
|
||||
Foo__Person__PhoneNumber *phone_numbers[1];
|
||||
Foo__Person person = FOO__PERSON__INIT;
|
||||
Foo__Person *person2;
|
||||
unsigned char simple_pad[8];
|
||||
size_t size, size2;
|
||||
unsigned char *packed;
|
||||
ProtobufCBufferSimple bs = PROTOBUF_C_BUFFER_SIMPLE_INIT(simple_pad);
|
||||
|
||||
comment.comment = "protobuf-c guy";
|
||||
|
||||
phone.number = "1234";
|
||||
phone.has_type = 1;
|
||||
phone.type = FOO__PERSON__PHONE_TYPE__WORK;
|
||||
phone.comment = &comment;
|
||||
|
||||
phone_numbers[0] = ☎
|
||||
|
||||
person.name = "dave b";
|
||||
person.id = 42;
|
||||
person.n_phone = 1;
|
||||
person.phone = phone_numbers;
|
||||
|
||||
size = foo__person__get_packed_size(&person);
|
||||
packed = malloc(size);
|
||||
assert(packed);
|
||||
|
||||
size2 = foo__person__pack(&person, packed);
|
||||
|
||||
assert(size == size2);
|
||||
foo__person__pack_to_buffer(&person, &bs.base);
|
||||
assert(bs.len == size);
|
||||
assert(memcmp(bs.data, packed, size) == 0);
|
||||
|
||||
PROTOBUF_C_BUFFER_SIMPLE_CLEAR(&bs);
|
||||
|
||||
person2 = foo__person__unpack(NULL, size, packed);
|
||||
assert(person2 != NULL);
|
||||
assert(person2->id == 42);
|
||||
assert(person2->email == NULL);
|
||||
assert(strcmp(person2->name, "dave b") == 0);
|
||||
assert(person2->n_phone == 1);
|
||||
assert(strcmp(person2->phone[0]->number, "1234") == 0);
|
||||
assert(strcmp(person2->phone[0]->comment->comment, "protobuf-c guy") == 0);
|
||||
assert(person2->phone[0]->type == FOO__PERSON__PHONE_TYPE__WORK);
|
||||
|
||||
foo__person__free_unpacked(person2, NULL);
|
||||
free(packed);
|
||||
|
||||
printf("test succeeded.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
39
tests/addressbook.proto
Normal file
39
tests/addressbook.proto
Normal file
@ -0,0 +1,39 @@
|
||||
syntax = "proto2";
|
||||
package foo;
|
||||
|
||||
message Person
|
||||
{
|
||||
required string name = 1;
|
||||
required int32 id = 2;
|
||||
optional string email = 3;
|
||||
|
||||
enum PhoneType {
|
||||
MOBILE = 0;
|
||||
HOME = 1;
|
||||
WORK = 2;
|
||||
}
|
||||
|
||||
message PhoneNumber
|
||||
{
|
||||
message Comment
|
||||
{
|
||||
required string comment = 1;
|
||||
}
|
||||
|
||||
required string number = 1;
|
||||
optional PhoneType type = 2 [default = HOME];
|
||||
optional Comment comment = 3;
|
||||
}
|
||||
|
||||
repeated PhoneNumber phone = 4;
|
||||
}
|
||||
|
||||
message LookupResult
|
||||
{
|
||||
optional Person person = 1;
|
||||
}
|
||||
|
||||
message Name
|
||||
{
|
||||
optional string name = 1;
|
||||
};
|
||||
10
tests/run-simple-test.sh
Executable file
10
tests/run-simple-test.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
uname -a
|
||||
|
||||
make clean all
|
||||
|
||||
./add_person_c
|
||||
make clean
|
||||
exit 0
|
||||
16
tests/tests.yml
Normal file
16
tests/tests.yml
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-basic
|
||||
tags:
|
||||
- classic
|
||||
required_packages:
|
||||
- make
|
||||
- gcc
|
||||
- protobuf-c-devel
|
||||
- protobuf-c-compiler
|
||||
- pkgconf-pkg-config
|
||||
tests:
|
||||
- simple:
|
||||
dir: .
|
||||
run: ./run-simple-test.sh
|
||||
Loading…
Reference in New Issue
Block a user