Skip to content

Commit

Permalink
Adding basic RPM spec file (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianSipos authored and Laurence Lundblade committed Jan 4, 2025
1 parent 89f926d commit 3bc24ae
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,6 @@ install(
)

if (NOT BUILD_QCBOR_TEST STREQUAL "OFF")
enable_testing()
add_subdirectory(test)
endif()
57 changes: 57 additions & 0 deletions pkg/qcbor.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Guidelines from https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/

Name: qcbor
Version: 1.5.0
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.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
%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
* Fri Dec 20 2024 Laurence Lundblade <[email protected]> - 1.5.0-0
- Initial library RPM packaging.
6 changes: 6 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,10 @@ if (BUILD_QCBOR_TEST STREQUAL "APP")
qcbor
qcbor_test
)

message(STATUS "Adding test qcbortest")
add_test(
NAME qcbortest
COMMAND qcbortest
)
endif()

0 comments on commit 3bc24ae

Please sign in to comment.