diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0afbe11..050cf1b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,3 +119,42 @@ jobs: } & $exe + rpm-package: + name: Build RPM packages on RHEL-9 + runs-on: ubuntu-latest + container: quay.io/centos/centos:stream9 + permissions: + contents: read + actions: write + steps: + - name: Set up OS + run: | + dnf config-manager --set-enabled crb + dnf install -y epel-release + dnf install -y \ + git tito rpm-build rpmlint + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + - name: Set up environment + run: | + git config --global --add safe.directory ${PWD} + dnf builddep -y qcbor.spec + - name: Build + run: tito build --rpm --test + - name: Check + working-directory: /tmp/tito + run: | + set -o pipefail + rpmlint *.rpm | tee rpmlint.txt + - name: Summarize Results + if: always() + run: | + echo "## rpmlint results:" >> $GITHUB_STEP_SUMMARY + echo >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + cat /tmp/tito/rpmlint.txt >> $GITHUB_STEP_SUMMARY || true + echo >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY diff --git a/pkg/qcbor.spec b/pkg/qcbor.spec deleted file mode 100644 index b0728212..00000000 --- a/pkg/qcbor.spec +++ /dev/null @@ -1,76 +0,0 @@ -# Guidelines from https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/ - -Name: qcbor -Version: 1.6.1 -Release: 0%{?dist} -Summary: A CBOR encoder/decoder library -URL: https://github.com/laurencelundblade/QCBOR -License: BSD-3-Clause -Source0: %{URL}/archive/refs/tags/v1.5.3.tar.gz - -BuildRequires: cmake -BuildRequires: gcc - -%description -Comprehensive, powerful, commercial-quality CBOR encoder and decoder -that is still suited for small devices. - - -%package devel -Summary: Development files for the QCBOR library -Requires: %{name}%{?_isa} = %{version} -%description devel -Development files needed to build and link to the QCBOR library. - - -%prep -%setup -q -n QCBOR-1.5.3 -%cmake -DBUILD_QCBOR_TEST=APP - - -%build -%cmake_build - -%install -%cmake_install - - -%check -# TODO use %ctest when supported by QCBOR config -./%{_vpath_builddir}/test/qcbortest - - -%files -%license LICENSE -%doc README.md -%{_libdir}/*.so.* - -%files devel -%license LICENSE -%doc README.md -%{_includedir}/qcbor -%{_libdir}/*.so - - -%changelog -* March 20, 2026 Laurence Lundblade - 1.6.1 -- Modernize cmake build and install -- Minor QCBORDecode_EnteryArray() error handling bugfix -* Nov 12 2025 Laurence Lundblade - 1.6 -- Better Windows/MSVC support -- Bug fix for GetArray() and GetMap() -- Fix gcc warnings -- Bug fix for OpenBstr on empty map at end of input -- Bug fix for floating-point NaN payload conversion for preferred serialization -- Don't use strcpy() -* Jun 16 2025 Laurence Lundblade - 1.5.3 -- Bug fix for GetArray() from empty map -- Increase test coverage -- Documentation improvements -* Jun 16 2025 Laurence Lundblade - 1.5.2 -- Bug fix for QCBORDecode_GetMap() and QCBORDecode_GetArray() -- Fix warning for compilers compliant with C23 standard -- Minor documentation fix -- Fix for embedded platforms with partial implementations of llround() -* Jan 8 2024 Laurence Lundblade - 1.5.1 -- Initial library RPM packaging. diff --git a/qcbor.spec b/qcbor.spec new file mode 100644 index 00000000..3712825a --- /dev/null +++ b/qcbor.spec @@ -0,0 +1,106 @@ +# Guidelines from https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/ + +Name: qcbor +Version: 1.6.1 +Release: 2%{?dist} +Summary: A CBOR encoder/decoder library +URL: https://github.com/laurencelundblade/QCBOR +License: BSD-3-Clause +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz + +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: doxygen +BuildRequires: coreutils + +%description +Comprehensive, powerful, commercial-quality CBOR encoder and decoder +that is still suited for small devices. + + +%package devel +Summary: Development files for the QCBOR library +Requires: %{name}%{?_isa} = %{version}-%{release} +%description devel +Development files needed to build and link to the QCBOR library. + +%package doc +Summary: API documentation for QCBOR library +Requires: %{name}%{?_isa} = %{version}-%{release} +%description doc +API documentation in the form of Docbook XML generated +from the API with Doxygen. + + +%prep +%setup -q -n QCBOR-%{version} + + +%build +%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_QCBOR_TEST=APP +%cmake_build + +pushd doxygen +sed -i 's|GENERATE_DOCBOOK.*=.*|GENERATE_DOCBOOK = YES|g' Doxyfile +sed -i 's|GENERATE_HTML.*=.*|GENERATE_HTML = NO|g' Doxyfile +sed -i 's|GENERATE_MAN.*=.*|GENERATE_MAN = NO|g' Doxyfile +doxygen +popd + + +%install +%cmake_install + +install -m644 doxygen/docbook/*.xml -D -t %{buildroot}%{_datadir}/help/en/qcbor/ + + +%check +%ctest + + +%files +%license LICENSE +%doc README.md +%{_libdir}/libqcbor.so.1{,.*} + +%files devel +%license LICENSE +%doc README.md +%{_includedir}/qcbor/ +%{_libdir}/libqcbor.so +%{_libdir}/cmake/qcbor/ + +%files doc +%license LICENSE +%doc %lang(en) %{_datadir}/help/en/qcbor/ + + +%changelog +* Tue Jun 09 2026 Brian Sipos - 1.6.1-2 +- Import into Fedora + +* Fri Mar 20 2026 Laurence Lundblade - 1.6.1-1 +- Modernize cmake build and install +- Minor QCBORDecode_EnteryArray() error handling bugfix + +* Wed Nov 12 2025 Laurence Lundblade - 1.6.0-1 +- Better Windows/MSVC support +- Bug fix for GetArray() and GetMap() +- Fix gcc warnings +- Bug fix for OpenBstr on empty map at end of input +- Bug fix for floating-point NaN payload conversion for preferred serialization +- Don't use strcpy() + +* Mon Jun 16 2025 Laurence Lundblade - 1.5.3-1 +- Bug fix for GetArray() from empty map +- Increase test coverage +- Documentation improvements + +* Mon Jun 16 2025 Laurence Lundblade - 1.5.2-1 +- Bug fix for QCBORDecode_GetMap() and QCBORDecode_GetArray() +- Fix warning for compilers compliant with C23 standard +- Minor documentation fix +- Fix for embedded platforms with partial implementations of llround() + +* Mon Jan 8 2024 Laurence Lundblade - 1.5.1-1 +- Initial library RPM packaging.