distro rpm BUGFIX CMake issues on Rocky 8

Fixes: https://github.com/CESNET/libyang/issues/1983
diff --git a/distro/pkg/rpm/libyang.spec b/distro/pkg/rpm/libyang.spec
index 374fc4e..eccc4a5 100644
--- a/distro/pkg/rpm/libyang.spec
+++ b/distro/pkg/rpm/libyang.spec
@@ -1,3 +1,7 @@
+%if 0%{?rhel} == 8
+%undefine __cmake_in_source_build
+%endif
+
 Name: libyang
 Version: {{ version }}
 Release: {{ release }}%{?dist}
@@ -49,13 +53,13 @@
 %cmake_build
 
 %if "x%{?suse_version}" == "x"
-cd redhat-linux-build
+cd %{__cmake_builddir}
 %endif
 make doc
 
 %check
 %if "x%{?suse_version}" == "x"
-cd redhat-linux-build
+cd %{__cmake_builddir}
 %endif
 ctest --output-on-failure -V %{?_smp_mflags}