summaryrefslogtreecommitdiff
path: root/loggpt.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-10-16 11:14:16 +0000
committerCoprDistGit <infra@openeuler.org>2025-10-16 11:14:16 +0000
commite3bb5c32f6be19ad07cc5f759afb38cc86176a47 (patch)
tree1262a878417122eea83ec92ce54547cc1da16b03 /loggpt.spec
parent9ea738c84c562d0572230949a7cb74aa00ce2e8d (diff)
automatic import of loggpt
Diffstat (limited to 'loggpt.spec')
-rw-r--r--loggpt.spec13
1 files changed, 11 insertions, 2 deletions
diff --git a/loggpt.spec b/loggpt.spec
index 871498a..7acdd20 100644
--- a/loggpt.spec
+++ b/loggpt.spec
@@ -36,9 +36,13 @@ mkdir -p %{_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 --index-url https://download.pytorch.org/whl/cpu
+ 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}
@@ -48,7 +52,8 @@ mkdir -p %{buildroot}/opt/%{name}
mkdir -p %{buildroot}/opt/%{name}/wheelhouse
# 复制wheelhouse离线包
-cp -r %{_builddir}/%{name}-%{version}/wheelhouse/* %{buildroot}/opt/%{name}/wheelhouse/
+tar -zxf %{_builddir}/%{name}-%{version}/wheelhouse.tar.gz -C %{buildroot}/opt/%{name}/
+rm -rf %{_builddir}/%{name}-%{version}/wheelhouse.tar.gz
# 复制项目代码(排除不需要的文件)
find %{_builddir}/%{name}-%{version} -maxdepth 1 \
@@ -97,6 +102,10 @@ find /opt/%{name}/venv/bin -type f -exec \
# systemd 配置
%systemd_post loggpt.service
+%preun
+# 卸载前停止服务
+%systemd_preun loggpt.service
+
%postun
# 清理配置
rm -rf /opt/%{name}