summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-10-17 04:42:41 +0000
committerCoprDistGit <infra@openeuler.org>2025-10-17 04:42:41 +0000
commitf2db2ca46bbf7e6d96d00dc44f147dee5769619d (patch)
treed3b62c1dadfb72be1f9b6444abb4ec3901887436
parentb88aaaa28e9f36717dbdb55b825e8ed958e76d7a (diff)
automatic import of loggpt
-rw-r--r--.gitignore3
-rw-r--r--loggpt.spec29
-rw-r--r--sources3
3 files changed, 17 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
index e0a2a60..85db02c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
/loggpt-1.0.0.tar.gz
+/wheelhouse_1.tar
+/wheelhouse_2.tar
+/wheelhouse_3.tar
diff --git a/loggpt.spec b/loggpt.spec
index 7acdd20..3ca8e75 100644
--- a/loggpt.spec
+++ b/loggpt.spec
@@ -9,6 +9,9 @@ Summary: loggpt Service
License: MulanPSL-2.0
URL: https://gitee.com/Victeo/AOPS_MCP_Server
Source0: %{name}-%{version}.tar.gz
+Source1: wheelhouse_1.tar
+Source2: wheelhouse_2.tar
+Source3: wheelhouse_3.tar
%global debug_package %{nil}
%global _enable_debug_package 0
@@ -26,34 +29,25 @@ loggpt Service packaged as RPM.
%prep
%setup -q
+cp -f %{SOURCE1} %{_builddir}
+cp -f %{SOURCE2} %{_builddir}
+cp -f %{SOURCE3} %{_builddir}
%build
mkdir -p %{_builddir}/%{name}-%{version}/wheelhouse
# 下载项目依赖包(包括构建依赖)
-%{__python3} -m pip download \
- --only-binary :all: \
- -d %{_builddir}/%{name}-%{version}/wheelhouse \
- -r requirements.txt \
- setuptools wheel pip \
- -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
-export https_proxy=http://185.239.85.89:3128
-export http_proxy=http://185.239.85.89:3128
-%{__python3} -m pip download \
- -d %{_builddir}/%{name}-%{version}/wheelhouse \
- torch==2.8.0+cpu --index-url https://download.pytorch.org/whl/cpu
-cd %{_builddir}/%{name}-%{version}/ && tar -zcf wheelhouse.tar.gz wheelhouse
-rm -rf %{_builddir}/%{name}-%{version}/wheelhouse
%install
rm -rf %{buildroot}
# 创建应用目录
mkdir -p %{buildroot}/opt/%{name}
-mkdir -p %{buildroot}/opt/%{name}/wheelhouse
# 复制wheelhouse离线包
-tar -zxf %{_builddir}/%{name}-%{version}/wheelhouse.tar.gz -C %{buildroot}/opt/%{name}/
-rm -rf %{_builddir}/%{name}-%{version}/wheelhouse.tar.gz
+tar -x -M -f %{_builddir}/wheelhouse_1.tar -f %{_builddir}/wheelhouse_2.tar -f %{_builddir}/wheelhouse_3.tar -C %{buildroot}/opt/%{name}/
+rm -rf %{_builddir}/wheelhouse_1.tar
+rm -rf %{_builddir}/wheelhouse_2.tar
+rm -rf %{_builddir}/wheelhouse_3.tar
# 复制项目代码(排除不需要的文件)
find %{_builddir}/%{name}-%{version} -maxdepth 1 \
@@ -96,7 +90,7 @@ deactivate
# rm -rf /opt/%{name}/wheelhouse
# 修复shebang路径
-find /opt/%{name}/venv/bin -type f -exec \
+find /opt/%{name}/venv/bin -type f -executable -exec \
sed -i "1s|^#!.*|#!/opt/%{name}/venv/bin/python|" {} \;
# systemd 配置
@@ -109,7 +103,6 @@ find /opt/%{name}/venv/bin -type f -exec \
%postun
# 清理配置
rm -rf /opt/%{name}
-%systemd_postun_with_restart loggpt.service
%files
%dir /opt/%{name}
diff --git a/sources b/sources
index 4cec6ec..e8f387b 100644
--- a/sources
+++ b/sources
@@ -1 +1,4 @@
6caf46ebbf7744af7974f5f3a5e61af6 loggpt-1.0.0.tar.gz
+6c340c7268563e739df21a5f5ddb2d55 wheelhouse_1.tar
+af701b1a7d31b17f0aab47b98a0651e9 wheelhouse_2.tar
+d52be6405ccb43df580fc323517a7b64 wheelhouse_3.tar