summaryrefslogtreecommitdiff
path: root/file-reorganize.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-01-10 06:54:59 +0000
committerCoprDistGit <infra@openeuler.org>2025-01-10 06:54:59 +0000
commitb8456d15666ce03ef1c5c3a4b05652f8380afecc (patch)
tree33edd32c9d2a2a29481079d23b7d80af10cbd11f /file-reorganize.spec
parent36feb2b86ca0ee035fc9916a5da85de912d18c38 (diff)
automatic import of file-reorganize
Diffstat (limited to 'file-reorganize.spec')
-rw-r--r--file-reorganize.spec35
1 files changed, 20 insertions, 15 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 <x_haihua@163.com>