diff options
author | CoprDistGit <infra@openeuler.org> | 2025-10-16 11:14:16 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2025-10-16 11:14:16 +0000 |
commit | e3bb5c32f6be19ad07cc5f759afb38cc86176a47 (patch) | |
tree | 1262a878417122eea83ec92ce54547cc1da16b03 | |
parent | 9ea738c84c562d0572230949a7cb74aa00ce2e8d (diff) |
automatic import of loggpt
-rw-r--r-- | loggpt.spec | 13 | ||||
-rw-r--r-- | sources | 2 |
2 files changed, 12 insertions, 3 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} @@ -1 +1 @@ -cbd26a6abbf2e40166790b8fa7bdd09e loggpt-1.0.0.tar.gz +6caf46ebbf7744af7974f5f3a5e61af6 loggpt-1.0.0.tar.gz |