msgpack-c/msgpack.spec
2021-11-22 17:30:37 +08:00

72 lines
1.5 KiB
RPMSpec

%global __cmake_in_source_build 1
Name: msgpack
Version: 3.1.0
Release: 1
Summary: Binary-based efficient object serialization library
License: Boost
URL: http://msgpack.org
Source0: https://github.com/msgpack/msgpack-c/releases/download/cpp-%{version}/%{name}-%{version}.tar.gz
Patch: 0001-Fixed-724.patch
BuildRequires: make cmake gcc-c++ doxygen gtest-devel zlib-devel
%description
MessagePack is a binary-based efficient object serialization
library. It enables to exchange structured objects between many
languages like JSON. But unlike JSON, it is very fast and small.
%package devel
Summary: Libraries and header files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Libraries and header files for %{name}
%prep
%autosetup -p1
sed -i "s|-std=c++98|-std=gnu++11|g" CMakeLists.txt
%build
if test ! -e "obj"; then
mkdir obj
fi
pushd obj
%cmake .. -DCMAKE_INSTALL_LIBDIR=%{_libdir} -Dlibdir=%{_libdir} -DBUILD_SHARED_LIBS=ON
%make_build
popd
%check
pushd obj
# https://github.com/msgpack/msgpack-c/issues/697
export GTEST_FILTER=-object_with_zone.ext_empty
make test || {
cat Testing/Temporary/LastTest.log;
exit 1;
}
popd
%install
make install/fast DESTDIR=$RPM_BUILD_ROOT -C obj
%ldconfig_scriptlets
%files
%license LICENSE_1_0.txt COPYING
%doc AUTHORS ChangeLog NOTICE README README.md
%{_libdir}/*.so.*
%files devel
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/msgpack.pc
%{_libdir}/cmake/msgpack
%changelog
* Thu Jul 22 2021 lipanpan <lipanpan@lipanpana@uniontech.com> - 3.1.0-1
- package init