On 02/01/18 21:30, Klaas Freitag wrote:
Am 28.12.2017 um 17:39 schrieb Martin Pluskal:
On 12/28/2017 3:54 PM, Klaas Freitag wrote:
Hi Martin,
Not related to issues you are facing, but please use %cmake and %cmake_install macros ...
I'd appreciate a short sentence of explanation why you feel that this specifically is important here, but I followed your advise nevertheless.
Thanks for pointing out :)
Klaas
The main reason is if there is a change to distro policy regarding build flags or install locations your package will be automatically modified rather then someone needing to come through and change it manually. Some of the flags automatically set help for security reasons others might make your life a bit easier. simon@tek-top ~ ➤ rpm --eval "%cmake" find . -name CMakeLists.txt \ -exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\)/{s/^/#IGNORE /}' {} + mkdir -p build cd build /usr/bin/cmake $OLDPWD/. \ %if "/usr/bin/make" == "/usr/bin/make" -G"Unix Makefiles" \ %else -GNinja \ %endif -DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DINCLUDE_INSTALL_DIR:PATH=/usr/include \ -DLIB_INSTALL_DIR:PATH=/usr/lib64 \ -DSYSCONF_INSTALL_DIR:PATH=/etc \ -DSHARE_INSTALL_PREFIX:PATH=/usr/share \ -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_C_FLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \ -DCMAKE_CXX_FLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \ -DCMAKE_Fortran_FLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \ -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \ %if "lib64" == "lib64" -DLIB_SUFFIX=64 \ %endif -DCMAKE_SKIP_RPATH:BOOL=ON \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DBUILD_STATIC_LIBS:BOOL=OFF \ -DCMAKE_COLOR_MAKEFILE:BOOL=OFF \ -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \ -DCMAKE_MODULES_INSTALL_DIR=/usr/share/cmake/Modules -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B