package: add hardening flags, fix install location
@@ -4,22 +4,25 @@ ELEKTRA_PLUGINS='ALL;mozprefs;multifile;-gitresolver;-jni;-ruby;-haskell;-yamlcp
ELEKTRA_TOOLS='ALL'
ELEKTRA_BINDINGS='cpp;lua;python;INTERCEPT'
-# #workaround for hardening flags
-# CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS)
-# CFLAGS=$(dpkg-buildflags --get CFLAGS $CPPFLAGS)
-# CXXFLAGS=$(dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
-# LDFLAGS=$(dpkg-buildflags --get LDFLAGS)
+# workaround for hardening flags
+CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS)
+CFLAGS=$(dpkg-buildflags --get CFLAGS)
+CXXFLAGS=$(dpkg-buildflags --get CXXFLAGS)
+LDFLAGS=$(dpkg-buildflags --get LDFLAGS)
PY3VER=$(py3versions -d -v)
-#DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \
-DBUILD_STATIC=OFF \
-DPython_ADDITIONAL_VERSIONS=$PY3VER \
-DGTEST_ROOT='/usr/src/gtest' \
+ -DCMAKE_INSTALL_PREFIX=/usr \
-DPLUGINS=$ELEKTRA_PLUGINS \
-DTOOLS=$ELEKTRA_TOOLS \
-DBINDINGS=$ELEKTRA_BINDINGS \
+ -DKDB_DB_SYSTEM:PATH=/etc/kdb \
+ -DKDB_DB_HOME:PATH=/home \
+ -DKDB_DB_USER:PATH=.config \
-DINSTALL_DOCUMENTATION=ON \
-DSWIG_EXECUTABLE=/usr/bin/swig3.0 \
-DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 \
@@ -28,14 +31,15 @@ CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \
-DENABLE_KDB_TESTING=OFF \
-DINSTALL_SYSTEM_FILES=ON \
-DBUILD_PDF=OFF \
- -DBUILD_FULL=ON"
+ -DBUILD_FULL=ON \
+ -DTARGET_DOCUMENTATION_HTML_FOLDER=share/doc/libelektra-doc/html \
+ -DTARGET_TEST_DATA_FOLDER=share/libelektra-test/test-data \
+ -DCMAKE_C_FLAGS=$CFLAGS \
+ -DCMAKE_CXX_FLAGS=$CXXFLAGS \
+ -DCMAKE_EXE_LINKER_FLAGS=$LDFLAGS \
+ -DCMAKE_MODULE_LINKER_FLAGS=$LDFLAGS \
+ -DCMAKE_SHARED_LINKER_FLAGS=$LDFLAGS"
- # \
- #-DTARGET_TEST_DATA_FOLDER=share/libelektra-test/test-data"
-
-# DEBUG pls remove
-cpu_count=`nproc --all`
-export MAKEFLAGS="-j$(($cpu_count+2)) -l$(($cpu_count*2))"
-# end debug
cmake $CMAKE_ARGS ..
-LD_LIBRARY_PATH=/home/libelektra/build/lib:${LD_LIBRARY_PATH} make package
+# TODO: change to relative path ./lib:.... instead of full path
+LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} make package
