Skip to content

Commit

Permalink
Add fend.spec based on sd.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
cyqsimon committed Dec 28, 2023
1 parent c155d0b commit 96bb9c5
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,35 @@ You can install the built packages from [COPR](https://copr.fedorainfracloud.org
<span>)</span>
</td>
<td align="center"><a href="https://github.com/sharkdp/fd">fd</a></td>
<td align="center"><a href="https://git.sr.ht/~mzhang/garbage">garbage</a></td>
<td align="center"><a href="https://github.com/printfn/fend">fend</a></td>
</tr>
<tr>
<td align="center"><a href="https://git.sr.ht/~mzhang/garbage">garbage</a></td>
<td align="center"><a href="https://github.com/dandavison/delta">git-delta</a></td>
<td align="center"><a href="https://github.com/sstadick/hck">hck</a></td>
<td align="center"><a href="https://github.com/thecoshman/http">httplz</a></td>
<td align="center"><a href="https://github.com/svenstaro/miniserve">miniserve</a></td>
<td align="center"><a href="https://github.com/pvolok/mprocs">mprocs</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/pvolok/mprocs">mprocs</a></td>
<td align="center"><a href="https://github.com/ouch-org/ouch">ouch</a></td>
<td align="center"><a href="https://github.com/k9withabone/podlet">podlet</a></td>
<td align="center"><a href="https://github.com/dalance/procs">procs</a></td>
<td align="center"><a href="https://github.com/Nukesor/pueue">pueue</a></td>
<td align="center"><a href="https://github.com/BurntSushi/ripgrep">ripgrep</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/BurntSushi/ripgrep">ripgrep</a></td>
<td align="center"><a href="https://github.com/RustScan/RustScan">rustscan</a></td>
<td align="center"><a href="https://github.com/chmln/sd">sd</a></td>
<td align="center"><a href="https://github.com/dbrgn/tealdeer">tealdeer</a></td>
<td align="center"><a href="https://github.com/XAMPPRocky/tokei">tokei</a></td>
<td align="center"><a href="https://github.com/ducaale/xh">xh</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/ducaale/xh">xh</a></td>
<td align="center">More to come</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
</tr>
<tr>
<td align="center"><img width=200/></td>
Expand Down
71 changes: 71 additions & 0 deletions specs/fend.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
%global debug_package %{nil}

Name: fend
Version: 1.4.0
Release: 1%{?dist}
Summary: Arbitrary-precision unit-aware calculator

License: GPLv3+
URL: https://github.com/printfn/fend
Source0: %{url}/archive/v%{version}.tar.gz

BuildRequires: gcc
# pandoc shipped by EL7/8 cannot build man page successfully
%if 0%{?rhel} >= 9
BuildRequires: pandoc
%endif

%description
fend is an arbitrary-precision unit-aware calculator

Unique features:

- Arbitrary-precision arithmetic using rational numbers
- Full support for complex numbers
- D&D-style dice rolls
- Variables
- Binary, octal, hexadecimal and all other bases between 2 and 36
- Keep track of units, with support for SI, US and UK customary and many
historical units
- Emacs-style CLI shortcuts
- Trigonometric functions
- Lambda calculus

%prep
%autosetup

# use latest stable version from rustup
curl -Lf "https://sh.rustup.rs" | sh -s -- --profile minimal -y

%build
source ~/.cargo/env
RUSTFLAGS="-C strip=symbols" cargo build --release --package %{name}

%if 0%{?rhel} >= 9
./documentation/build.sh
%endif

%check
source ~/.cargo/env
cargo test --package %{name} --package %{name}-core

%install
# bin
install -Dpm 755 target/release/%{name} %{buildroot}%{_bindir}/%{name}

%if 0%{?rhel} >= 9
# manpage
install -Dpm 644 documentation/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
%endif

%files
%license LICENSE.md
%doc CHANGELOG.md README.md
%{_bindir}/%{name}
%if 0%{?rhel} >= 9
%{_mandir}/man1/%{name}.1*
%endif

%changelog
* Wed Dec 27 2023 cyqsimon - v1.4.0-1
- Release v1.4.0

0 comments on commit 96bb9c5

Please sign in to comment.