summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--loggpt.spec13
-rw-r--r--sources2
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}
diff --git a/sources b/sources
index 057f33e..4cec6ec 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-cbd26a6abbf2e40166790b8fa7bdd09e loggpt-1.0.0.tar.gz
+6caf46ebbf7744af7974f5f3a5e61af6 loggpt-1.0.0.tar.gz