summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glog.spec26
1 files changed, 21 insertions, 5 deletions
diff --git a/glog.spec b/glog.spec
index 301ba62..68396c7 100644
--- a/glog.spec
+++ b/glog.spec
@@ -4,7 +4,7 @@
Name: glog
Version: 0.7.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Google Logging Library (glog)
License: BSD-3-Clause
@@ -50,6 +50,11 @@ file for %{name}.
%autosetup -n %{name}-%{version} -p1
%build
+# 显式 out-of-source build:openEuler 24.03 LTS SP3 chroot 的 %cmake 宏执行
+# in-source configure(写到 source 目录 glog-0.7.1),但 %cmake_build 期望
+# %_vpath_builddir 子目录(%_target_platform=aarch64-openEuler-linux-gnu),
+# 二者不一致触发 "is not a directory" 错误(build_id=113742 %build 阶段失败)。
+# 改用裸 cmake 命令显式管理 build dir,规避 chroot 宏不一致,且跨 chroot 兼容。
# CMake 选项说明(与 CMakeLists.txt option() 一致):
# -DBUILD_SHARED_LIBS=ON : 默认 ON,构建 libglog.so.*(SOVERSION=2)
# -DWITH_GFLAGS=ON : 启用 gflags 集成(openEuler 官方源已提供 2.2.2)
@@ -59,7 +64,10 @@ file for %{name}.
# -DWITH_TLS=ON : 启用 Thread Local Storage 支持(默认 ON)
# CMAKE_INSTALL_LIBDIR/INCLUDEDIR 显式传入,避免 GNUInstallDirs 在 aarch64
# 上推导出非标准路径(与 %files 中 %{_libdir}/%{_includedir} 宏保持一致)。
-%cmake \
+mkdir -p %{_target_platform}
+cd %{_target_platform}
+cmake .. \
+ -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DBUILD_SHARED_LIBS=ON \
-DWITH_GFLAGS=ON \
-DWITH_GTEST=ON \
@@ -68,14 +76,16 @@ file for %{name}.
-DWITH_TLS=ON \
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}
-%cmake_build
+make %{?_smp_mflags}
%install
-%cmake_install
+cd %{_target_platform}
+make install DESTDIR=%{buildroot}
%check
# 运行 glog 自带的单元测试(依赖 gtest-devel 构建出的可执行文件)
-%ctest
+cd %{_target_platform}
+ctest %{?_smp_mflags}
%files
%license COPYING
@@ -91,5 +101,11 @@ file for %{name}.
%{_datadir}/glog/
%changelog
+* Mon Oct 19 2026 openEuler Builder <builder@openeuler.org> - 0.7.1-2
+- Replace %%cmake/%%cmake_build/%%cmake_install/%%ctest macros with explicit
+ out-of-source cmake invocation to fix "is not a directory" %%build failure
+ on openeuler-24.03_LTS_SP3-aarch64 (in-source configure vs. out-of-source
+ build dir mismatch in chroot cmake-rpm-macros, build_id=113742)
+
* Mon Oct 19 2026 openEuler Builder <builder@openeuler.org> - 0.7.1-1
- Initial package of glog 0.7.1