forked from chmln/sd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsd.spec
61 lines (49 loc) · 1.56 KB
/
sd.spec
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
57
58
59
60
61
%define name sd
%define version 1.0.0
%define release 6%{?dist}
Summary: Intuitive find & replace CLI (sed alternative)
Name: %{name}
Version: %{version}
Release: %{release}
License: MIT License
URL: https://github.com/chmln/sd
Source0: https://github.com/chmln/sd/archive/refs/tags/v%{version}.tar.gz
%define debug_package %{nil}
BuildRequires: curl
BuildRequires: gcc
BuildRequires: gzip
%description
sd is an intuitive find & replace CLI.
%prep
%setup -q
%build
# Install Rust using curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$PATH:$HOME/.cargo/bin"
cargo build --release
%install
# Create the necessary directory structure in the buildroot
mkdir -p %{buildroot}/bin
mkdir -p %{buildroot}/etc/bash_completion.d/
mkdir -p %{buildroot}/usr/share/man/man1
# Copy the binary to /bin in the buildroot
install -m 755 target/release/%{name} %{buildroot}/bin/
# Copy Bash completion
install -m 755 gen/completions/%{name}.bash %{buildroot}/etc/bash_completion.d/
# Copy the man page to /usr/share/man/man1 in the buildroot
gzip gen/sd.1
install -m 644 gen/sd.1.gz %{buildroot}/usr/share/man/man1/
%files
# List all the files to be included in the package
/bin/sd
/etc/bash_completion.d/sd.bash
/usr/share/man/man1/sd.1.gz
%changelog
* Mon Nov 25 2024 Danie de Jager - 1.0.0-6
- Rebuilt using rustc 1.82
* Mon Aug 5 2024 Danie de Jager - 1.0.0-5
- Rebuilt using rustc 1.80
* Fri Apr 26 2024 Danie de Jager - 1.0.0-4
- Rebuilt using rustc 1.77.2
* Wed Nov 22 2023 Danie de Jager - 1.0.0-3
- Initial RPM build using rustc 1.75.0