!10 修正devel打包实体文件问题并修改-mtune参数

From: @laokz 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-05-04 12:37:39 +00:00 committed by Gitee
commit 049b8fe76a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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