From 74e5ee988123b1d0b9a9bd1e16d0751e85deb8cd Mon Sep 17 00:00:00 2001 From: baizg1107 Date: Fri, 29 Apr 2022 10:53:59 +0800 Subject: [PATCH] add old so for loongarch --- jsoncpp.spec | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/jsoncpp.spec b/jsoncpp.spec index d432321..211a4a4 100644 --- a/jsoncpp.spec +++ b/jsoncpp.spec @@ -1,12 +1,26 @@ +%ifarch loongarch64 +%global bump_soname 1 +%else +%global bump_soname 0 +%endif + +%global sover 25 +%if 0%{?bump_soname} +%global old_sover %(echo $((%{sover}-1))) +%endif + Name: jsoncpp Version: 1.9.5 -Release: 3 +Release: 4 Summary: JSON C++ library License: Public Domain or MIT URL: https://github.com/open-source-parsers/jsoncpp Source0: https://github.com/open-source-parsers/jsoncpp/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: gcc-c++ cmake >= 3.1 python3-devel - +%if 0%{?bump_soname} +Provides: libjsoncpp.so.%{old_sover}()(64bit) +BuildRequires: jsoncpp +%endif %description JsonCpp is a C++ library that allows manipulating JSON values, including serialization and deserialization to and from strings. @@ -62,7 +76,9 @@ touch %{buildroot}%{_docdir}/%{name}/html hardlink -cfv %{buildroot}%{_docdir}/%{name} # When the .so file name changes during version upgrade, you need to copy the lower version of .so file -# cp -a %{_libdir}/libjsoncpp.so.* $RPM_BUILD_ROOT%{_libdir} +%if 0%{?bump_soname} +cp %{buildroot}/%{_libdir}/libjsoncpp.so.%{sover} %{buildroot}/%{_libdir}/libjsoncpp.so.%{old_sover} +%endif %check %make_build -C %{_vpath_builddir} jsoncpp_check @@ -91,6 +107,9 @@ hardlink -cfv %{buildroot}%{_docdir}/%{name} %changelog +* Thu Apr 28 2022 baizhonggui - 1.9.5-4 +- Add old version so file in openEuler:22.03:LTS:LoongArch + * Mon Jan 10 2022 shixuantong - 1.9.5-3 - Delete so files of lower versions -- Gitee