From 3149236849aa344b2bda033584ad3afd467cc5d0 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Thu, 16 Oct 2025 11:17:04 +0800 Subject: [PATCH] use standard cmake macro (cherry picked from commit 2dd9e6a60c20d24fa9f6d9c33d5806bb0a909659) --- leveldb.spec | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/leveldb.spec b/leveldb.spec index 68162de..90fe549 100644 --- a/leveldb.spec +++ b/leveldb.spec @@ -1,7 +1,7 @@ %undefine __cmake_in_source_build Name: leveldb Version: 1.23 -Release: 5 +Release: 6 Summary: A fast and lightweight key/value database library by Google License: BSD-3-Clause URL: https://github.com/google/leveldb @@ -51,42 +51,21 @@ EOF %build +%cmake \ + -S . \ + -B %{_vpath_builddir} \ + -G "Unix Makefiles" \ + -DLEVELDB_BUILD_TESTS:BOOL=OFF \ + -DLEVELDB_BUILD_BENCHMARKS:BOOL=OFF -%ifarch riscv64 loongarch64 sw_64 -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 - - -cmake -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=%{buildroot}/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -DLEVELDB_BUILD_TESTS:BOOL=OFF -DLEVELDB_BUILD_BENCHMARKS:BOOL=OFF .. - -cmake --build . +%make_build -C %{_vpath_builddir} %install +%make_install -C %{_vpath_builddir} + mkdir -p %{buildroot}%{_libdir}/pkgconfig install -p leveldb.pc %{buildroot}%{_libdir}/pkgconfig/leveldb.pc -cd build -make install - -%ldconfig_scriptlets - - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - - %files %license LICENSE %doc AUTHORS README.md NEWS @@ -102,6 +81,9 @@ make install %changelog +* Thu Oct 16 2025 Funda Wang - 1.23-6 +- use standard cmake macro + * Fri Oct 10 2025 zhangfeilong - 1.23-5 - fix -mtune for sw_64 -- Gitee