blob: 2be8f0ef6af7efb6761c032512141a17d07f0d5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
Name: file-reorganize
Version: 1.0
Release: 1%{?dist}
Summary: file reoganize
License: MulanPSL2.0
URL: https://atomgit.com/openeuler123/x_haihua.git
Source0: %{name}-%{version}.tar.gz
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
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
source cangjie/envsetup.sh
%build
source cangjie/envsetup.sh
if [[ `uname -m` == "x86_64" ]]; then
cp /usr/lib/gcc/x86_64-openEuler-linux/12/crtbeginS.o %{_builddir}/%{name}-%{version}
cp /usr/lib/gcc/x86_64-openEuler-linux/12/crtendS.o %{_builddir}/%{name}-%{version}
else
cp /usr/lib/gcc/aarch64-openEuler-linux/12/crtbeginS.o %{_builddir}/%{name}-%{version}
cp /usr/lib/gcc/aarch64-openEuler-linux/12/crtendS.o %{_builddir}/%{name}-%{version}
fi
cjpm build
%install
# 将需要打包的文件拷贝到buildroot目录中去
plt=`uname -m`
mkdir -p %{buildroot}/usr/bin
cp -r %{_builddir}/%{name}-%{version}/target/release/bin/main %{buildroot}/usr/bin/
%files
# 指定将要部署的文件有哪些
/usr/bin/main
%changelog
* Tue Dec 24 2024 x_haihua <x_haihua@163.com>
-
|