From b8456d15666ce03ef1c5c3a4b05652f8380afecc Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Fri, 10 Jan 2025 06:54:59 +0000 Subject: automatic import of file-reorganize --- file-reorganize.spec | 35 ++++++++++++++++++++--------------- sources | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/file-reorganize.spec b/file-reorganize.spec index 6e50456..4e408ca 100644 --- a/file-reorganize.spec +++ b/file-reorganize.spec @@ -12,24 +12,30 @@ BuildRequires: wget, dnf-plugins-core, binutils, glibc-devel, gcc-c++, openssl %define debug_package %{nil} %description - +Move files to the corresponding category directory according to file extension or file type. For example: text files are stored in the file directory, executable files are stored in the exe directory, doc files are stored in the doc directory, and txt files are stored in the txt directory. %prep %autosetup # 安装cangjie -if [[ `uname -m` == "x86_64" ]]; then - wget -O Cangjie-0.53.13-linux_x64.tar.gz "https://cangjie-lang.cn/v1/files/auth/downLoad?nsId=142267&fileName=Cangjie-0.53.13-linux_x64.tar.gz&objectKey=6719f1eb3af6947e3c6af327" - tar -xzvf Cangjie-0.53.13-linux_x64.tar.gz - source cangjie/envsetup.sh +cjpm -v +if [[ $? -eq 0 ]]; then + echo "已经安装仓颉" else - wget -O Cangjie-0.53.13-linux_aarch64.tar.gz "https://cangjie-lang.cn/v1/files/auth/downLoad?nsId=142267&fileName=Cangjie-0.53.13-linux_aarch64.tar.gz&objectKey=6719f1ec3af6947e3c6af328" - tar -xzvf Cangjie-0.53.13-linux_aarch64.tar.gz - source cangjie/envsetup.sh + echo "安装仓颉" + if [[ `uname -m` == "x86_64" ]]; then + wget -O Cangjie-0.53.13-linux_x64.tar.gz "https://cangjie-lang.cn/v1/files/auth/downLoad?nsId=142267&fileName=Cangjie-0.53.13-linux_x64.tar.gz&objectKey=6719f1eb3af6947e3c6af327" + tar -xzvf Cangjie-0.53.13-linux_x64.tar.gz + else + wget -O Cangjie-0.53.13-linux_aarch64.tar.gz "https://cangjie-lang.cn/v1/files/auth/downLoad?nsId=142267&fileName=Cangjie-0.53.13-linux_aarch64.tar.gz&objectKey=6719f1ec3af6947e3c6af328" + tar -xzvf Cangjie-0.53.13-linux_aarch64.tar.gz + fi + mv cangjie /root/ + source /root/cangjie/envsetup.sh fi %build -source %{_builddir}/%{name}-%{version}/cangjie/envsetup.sh +source /root/cangjie/envsetup.sh if [[ `uname -m` == "x86_64" ]]; then cp /usr/lib/gcc/x86_64-openEuler-linux/12/crtbeginS.o %{_builddir}/%{name}-%{version} @@ -44,16 +50,15 @@ cjpm build %install # 将需要打包的文件拷贝到buildroot目录中去 -mkdir -p %{buildroot}/root/file-reorganize/bin +plt=`uname -m` +mkdir -p %{buildroot}/root/file-reorganize mkdir -p %{buildroot}/root/file-reorganize/config -cp -r %{_builddir}/%{name}-%{version}/target/release/bin/* %{buildroot}/root/file-reorganize/bin -cp -r %{_builddir}/%{name}-%{version}/config/* %{buildroot}/root/file-reorganize/config +cp -r %{_builddir}/%{name}-%{version}/target/release/bin/* %{buildroot}/root/file-reorganize +cp -r %{_builddir}/%{name}-%{version}/config/* %{buildroot}/root/file-reorganize %files # 指定将要部署的文件有哪些 -/root/file-reorganize/bin/* -/root/file-reorganize/config/* - +/root/file-reorganize/* %changelog * Tue Dec 24 2024 x_haihua diff --git a/sources b/sources index 9be5471..dc6fa56 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5da5e72a63206b895abd5dea3772d408 file-reorganize-1.0.tar.gz +490cae4d8d6369b861ddb73e4478dbdb file-reorganize-1.0.tar.gz -- cgit v1.2.3