fix devel packaging and -mtune options
Fix libleveldb.so as a link to libleveldb.so.1. Modify -mtune options to adapt more architectures.
This commit is contained in:
parent
ddca73dca4
commit
e4c4b90889
22
leveldb.spec
22
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 <zhangkai@iscas.ac.cn> - 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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user