diff --git a/build/rpm/liblinphone.spec.cmake b/build/rpm/liblinphone.spec.cmake
index f2841b7d70c523c664600029b3122062a81ffbaa..b4890ef483889ea29d842c5dc2ab645e12cefe12 100755
--- a/build/rpm/liblinphone.spec.cmake
+++ b/build/rpm/liblinphone.spec.cmake
@@ -39,7 +39,7 @@ Requires:	%{pkg_prefix}ortp
 Requires:	%{pkg_prefix}mediastreamer
 Requires:	%{pkg_prefix}belle-sip
 Requires:	%{pkg_prefix}belr
-%if 0%{?_with_soci}
+%if %{?_with_soci:1}%{!?_with_soci:0}
 Requires:	%{pkg_prefix}soci
 %endif