diff --git a/packaging/wrt-plugins-common.spec b/packaging/wrt-plugins-common.spec
-index 89ef703..7ab0e9f 100644
+index 89ef703..e50008b 100644
--- a/packaging/wrt-plugins-common.spec
+++ b/packaging/wrt-plugins-common.spec
-@@ -44,7 +44,7 @@ cp %{SOURCE1001} .
- %endif
+@@ -1,3 +1,8 @@
++%define with_tests 0
++%if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
++ %define with_tests 1
++%endif
++
+ Name: wrt-plugins-common
+ Summary: WebRuntime common library
+ Version: 0.3.86.2
+@@ -38,13 +43,10 @@ This package contains all needed header files for developing a WRT plugin
+ %setup -q
+ cp %{SOURCE1001} .
+
+-%define with_tests 0
+-%if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
+- %define with_tests 1
+-%endif
++
%build
-export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--hash-style=both"
diff --git a/packaging/wrt.spec b/packaging/wrt.spec
-index eb3b43a..b02cb8d 100644
+index eb3b43a..138dff5 100644
--- a/packaging/wrt.spec
+++ b/packaging/wrt.spec
-@@ -101,7 +101,7 @@ cp %{SOURCE1001} .
- %endif
+@@ -1,3 +1,8 @@
++%define with_tests 0
++%if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
++ %define with_tests 1
++%endif
++
+ %bcond_with mesa
+ %bcond_with wayland
+ %bcond_with decrypt
+@@ -95,13 +100,10 @@ wrt library development headers
+ %setup -q
+ cp %{SOURCE1001} .
+
+-%define with_tests 0
+-%if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
+- %define with_tests 1
+-%endif
++
%build
-export LDFLAGS+="-Wl,--rpath=%{_libdir}"