diff --git a/build/rpm/liblinphone.spec.cmake b/build/rpm/liblinphone.spec.cmake
index 8990726cfaa2ac2318dc3de9a33d766d51e62ea5..6d3bae9c145d94b6e0d184867ab6b3037a27fa44 100755
--- a/build/rpm/liblinphone.spec.cmake
+++ b/build/rpm/liblinphone.spec.cmake
@@ -21,6 +21,10 @@
 %define build_number_ext -%{build_number}
 %endif
 
+# This is for debian builds where debug_package has to be manually specified,
+# whereas in centos it does not
+%define     lin_debug      %{!?_enable_debug_packages:%debug_package}%{?_enable_debug_package:%{nil}}
+
 Name:           %{pkg_name}
 Version:        @PROJECT_VERSION@
 Release:        %{build_number}%{?dist}
@@ -68,7 +72,7 @@ develop programs using the liblinphone library.
 %prep
 %setup -n %{name}-%{version}%{?build_number_ext}
 
-%debug_package
+%lin_debug
 
 %build
 %{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} -DENABLE_VIDEO=%{video} -DENABLE_LIME=%{lime} -DENABLE_TOOLS=NO -DENABLE_CONSOLE_UI=NO -DENABLE_DAEMON=NO