msedit.spec
· 1.9 KiB · RPMSpec
Bruto
# Partially generated by rust2rpm 27
%bcond check 1
# prevent library files from being installed
%global cargo_install_lib 0
# icu soversion
%global icu_sover 76
%if "%{__isa_bits}" == "64"
%global lib64_suffix ()(64bit)
%endif
Name: msedit
Version: 1.2.0
Release: %autorelease
Summary: Simple editor inspired by the MS-DOS Editor
SourceLicense: MIT
# MIT OR Apache-2.0: libc v0.2.172
# MIT: edit v1.2.0
License: MIT AND (MIT OR Apache-2.0)
URL: https://github.com/microsoft/edit
Source: %{url}/archive/v%{version}/edit-%{version}.tar.gz
Patch: edit-fix-metadata.diff
BuildRequires: cargo-rpm-macros >= 26
BuildRequires: libicu-devel
# For dlopen() libicu
Requires: libicuuc.so.%{icu_sover}%{?lib64_suffix}
Requires: libicui18n.so.%{icu_sover}%{?lib64_suffix}
%global _description %{expand:
%{summary}
A text editor that pays homage to the classic MS-DOS Editor, but with a modern
interface and input controls similar to VS Code. The goal is to provide an
accessible editor that even users largely unfamiliar with terminals can easily
use.
}
%description %{_description}
%prep
%autosetup -n edit-%{version} -p1
# Patch the code to load the correct icu libraries
# To avoid requiring the libicu-devel package at runtime
sed -i src/sys/unix.rs \
-e "s/libicuuc.so/libicuuc.so.%{icu_sover}/g" \
-e "s/libicui18n.so/libicui18n.so.%{icu_sover}/g"
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%build
%cargo_build
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies
%install
%cargo_install
# de-conflict with vim
mv %{buildroot}%{_bindir}/edit %{buildroot}%{_bindir}/%{name}
%if %{with check}
%check
%cargo_test
%endif
%files
%license LICENSE
%license LICENSE.dependencies
%doc CODE_OF_CONDUCT.md
%doc CONTRIBUTING.md
%doc README.md
%doc SECURITY.md
%{_bindir}/%{name}
%changelog
%autochangelog
| 1 | # Partially generated by rust2rpm 27 |
| 2 | %bcond check 1 |
| 3 | |
| 4 | # prevent library files from being installed |
| 5 | %global cargo_install_lib 0 |
| 6 | |
| 7 | # icu soversion |
| 8 | %global icu_sover 76 |
| 9 | %if "%{__isa_bits}" == "64" |
| 10 | %global lib64_suffix ()(64bit) |
| 11 | %endif |
| 12 | |
| 13 | Name: msedit |
| 14 | Version: 1.2.0 |
| 15 | Release: %autorelease |
| 16 | Summary: Simple editor inspired by the MS-DOS Editor |
| 17 | SourceLicense: MIT |
| 18 | # MIT OR Apache-2.0: libc v0.2.172 |
| 19 | # MIT: edit v1.2.0 |
| 20 | License: MIT AND (MIT OR Apache-2.0) |
| 21 | |
| 22 | URL: https://github.com/microsoft/edit |
| 23 | Source: %{url}/archive/v%{version}/edit-%{version}.tar.gz |
| 24 | Patch: edit-fix-metadata.diff |
| 25 | |
| 26 | BuildRequires: cargo-rpm-macros >= 26 |
| 27 | BuildRequires: libicu-devel |
| 28 | |
| 29 | # For dlopen() libicu |
| 30 | Requires: libicuuc.so.%{icu_sover}%{?lib64_suffix} |
| 31 | Requires: libicui18n.so.%{icu_sover}%{?lib64_suffix} |
| 32 | |
| 33 | %global _description %{expand: |
| 34 | %{summary} |
| 35 | |
| 36 | A text editor that pays homage to the classic MS-DOS Editor, but with a modern |
| 37 | interface and input controls similar to VS Code. The goal is to provide an |
| 38 | accessible editor that even users largely unfamiliar with terminals can easily |
| 39 | use. |
| 40 | } |
| 41 | |
| 42 | %description %{_description} |
| 43 | |
| 44 | %prep |
| 45 | %autosetup -n edit-%{version} -p1 |
| 46 | |
| 47 | # Patch the code to load the correct icu libraries |
| 48 | # To avoid requiring the libicu-devel package at runtime |
| 49 | sed -i src/sys/unix.rs \ |
| 50 | -e "s/libicuuc.so/libicuuc.so.%{icu_sover}/g" \ |
| 51 | -e "s/libicui18n.so/libicui18n.so.%{icu_sover}/g" |
| 52 | |
| 53 | %cargo_prep |
| 54 | |
| 55 | %generate_buildrequires |
| 56 | %cargo_generate_buildrequires |
| 57 | |
| 58 | %build |
| 59 | %cargo_build |
| 60 | %{cargo_license_summary} |
| 61 | %{cargo_license} > LICENSE.dependencies |
| 62 | |
| 63 | %install |
| 64 | %cargo_install |
| 65 | # de-conflict with vim |
| 66 | mv %{buildroot}%{_bindir}/edit %{buildroot}%{_bindir}/%{name} |
| 67 | |
| 68 | %if %{with check} |
| 69 | %check |
| 70 | %cargo_test |
| 71 | %endif |
| 72 | |
| 73 | %files |
| 74 | %license LICENSE |
| 75 | %license LICENSE.dependencies |
| 76 | %doc CODE_OF_CONDUCT.md |
| 77 | %doc CONTRIBUTING.md |
| 78 | %doc README.md |
| 79 | %doc SECURITY.md |
| 80 | %{_bindir}/%{name} |
| 81 | |
| 82 | %changelog |
| 83 | %autochangelog |
| 84 |