Last active 1754125897

MS Edit specfile for Fedora

Revision 8af8a679c7284b66c0cec6444378bb5d67fc58b9

msedit.spec Raw
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
13Name: msedit
14Version: 1.2.0
15Release: %autorelease
16Summary: Simple editor inspired by the MS-DOS Editor
17SourceLicense: MIT
18# MIT OR Apache-2.0: libc v0.2.172
19# MIT: edit v1.2.0
20License: MIT AND (MIT OR Apache-2.0)
21
22URL: https://github.com/microsoft/edit
23Source: %{url}/archive/v%{version}/edit-%{version}.tar.gz
24Patch: edit-fix-metadata.diff
25
26BuildRequires: cargo-rpm-macros >= 26
27BuildRequires: libicu-devel
28
29# For dlopen() libicu
30Requires: libicuuc.so.%{icu_sover}%{?lib64_suffix}
31Requires: libicui18n.so.%{icu_sover}%{?lib64_suffix}
32
33%global _description %{expand:
34%{summary}
35
36A text editor that pays homage to the classic MS-DOS Editor, but with a modern
37interface and input controls similar to VS Code. The goal is to provide an
38accessible editor that even users largely unfamiliar with terminals can easily
39use.
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
49sed -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
66mv %{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