From e4c4b90889fb7f0fa7cdb066b18de753b6ce5333 Mon Sep 17 00:00:00 2001 From: laokz Date: Fri, 24 Feb 2023 09:52:24 +0000 Subject: [PATCH] fix devel packaging and -mtune options Fix libleveldb.so as a link to libleveldb.so.1. Modify -mtune options to adapt more architectures. --- leveldb.spec | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/leveldb.spec b/leveldb.spec index d3c5eec..014abe8 100644 --- a/leveldb.spec +++ b/leveldb.spec @@ -1,7 +1,7 @@ %undefine __cmake_in_source_build Name: leveldb Version: 1.23 -Release: 1 +Release: 2 Summary: A fast and lightweight key/value database library by Google License: BSD-3-Clause URL: https://github.com/google/leveldb @@ -52,10 +52,15 @@ EOF %build -export CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection ' -export CXXFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection ' -export FFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -I/usr/lib64/gfortran/modules' -export FCFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -I/usr/lib64/gfortran/modules' +%ifarch riscv64 +MTUNE= +%else +MTUNE="-mtune=generic" +%endif +export CFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 $MTUNE -fasynchronous-unwind-tables -fstack-clash-protection" +export CXXFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 $MTUNE -fasynchronous-unwind-tables -fstack-clash-protection" +export FFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 $MTUNE -fasynchronous-unwind-tables -fstack-clash-protection -I/usr/lib64/gfortran/modules" +export FCFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 $MTUNE -fasynchronous-unwind-tables -fstack-clash-protection -I/usr/lib64/gfortran/modules" export LDFLAGS='-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/generic-hardened-ld' mkdir build && cd build @@ -71,7 +76,8 @@ install -d %{buildroot}{%{_libdir}/pkgconfig,%{_includedir}} mkdir -p %{buildroot}%{_libdir}/pkgconfig install -p leveldb.pc %{buildroot}%{_libdir}/pkgconfig/leveldb.pc cp -a include/leveldb/ %{buildroot}%{_includedir}/ -cp build/libleveldb.so* %{buildroot}%{_libdir}/ +cp build/libleveldb.so.1* %{buildroot}%{_libdir}/ +ln -s libleveldb.so.1 %{buildroot}%{_libdir}/libleveldb.so cd build @@ -102,6 +108,10 @@ make install %changelog +* Fri Feb 24 2023 laokz - 1.23-2 +- fix devel libleveldb.so to a symbolic +- fix -mtune for riscv64 + * Fri Dec 16 2022 huyab<1229981468@qq.com> - 1.23-1 - update version to 1.23 -- Gitee