Resolves: #2023184 use system build flags

This commit is contained in:
Jan Horak 2022-01-17 20:02:59 +01:00
parent c49eff6694
commit d1b4cbf2f1

View File

@ -129,34 +129,14 @@ find . -name '*.h' | xargs chmod -x
dos2unix -k -q share/extensions/*.py
%build
#export CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection}"
#export CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection}"
#export FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules}"
#export FCFLAGS="${FCFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules}"
#export LDFLAGS="${LDFLAGS:--Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld}"
sed -i /FORTIFY_SOURCE/d CMakeLists.txt
cmake \
-DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags} -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags} -DNDEBUG" \
-DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \
%cmake3 \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
-DCMAKE_SHARED_LINKER_FLAGS:STRING="%{build_ldflags}" \
-DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
-DLIB_INSTALL_DIR:PATH=%{_libdir} \
-DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \
-DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \
-DCMAKE_SKIP_RPATH=TRUE \
%if "lib64" == "lib64"
-DLIB_SUFFIX=64 \
%endif
-DBUILD_SHARED_LIBS:BOOL=OFF .
%make_build
%cmake_build
%install
%make_install
%cmake_install
find $RPM_BUILD_ROOT -type f -name 'lib*.a' | xargs rm -f
# No skencil anymore