Dernière activité 1754125897

MS Edit specfile for Fedora

Révision 4396a4aaa07a91d9d04186be536c322d5c390719

msedit.spec Brut
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# Temporarily use a Git revision until next stable release
8%global commit e16b4abffc5e23d20e49de5f1461aebfc692268d
9%global shortcommit %{sub %{commit} 1 7}
10%global commitdate 20250710
11
12# icu soversion
13%global icu_sover 76
14%if "%{__isa_bits}" == "64"
15%global lib64_suffix ()(64bit)
16%endif
17
18Name: msedit
19Version: 1.2.0^1.%{shortcommit}
20Release: %autorelease
21Summary: Simple editor inspired by the MS-DOS Editor
22SourceLicense: MIT
23# MIT OR Apache-2.0: libc v0.2.172
24# MIT: edit v1.2.0
25License: MIT AND (MIT OR Apache-2.0)
26
27URL: https://github.com/microsoft/edit
28Source: %{url}/archive/%{shortcommit}.tar.gz
29Patch: edit-fix-metadata.diff
30
31BuildRequires: cargo-rpm-macros >= 26
32BuildRequires: desktop-file-utils
33BuildRequires: libicu-devel
34
35# For dlopen() libicu
36Requires: libicuuc.so.%{icu_sover}%{?lib64_suffix}
37Requires: libicui18n.so.%{icu_sover}%{?lib64_suffix}
38
39%global _description %{expand:
40%{summary}
41
42A text editor that pays homage to the classic MS-DOS Editor, but with a modern
43interface and input controls similar to VS Code. The goal is to provide an
44accessible editor that even users largely unfamiliar with terminals can easily
45use.
46}
47
48%description %{_description}
49
50%prep
51%autosetup -n edit-%{commit} -p1
52%cargo_prep
53
54%generate_buildrequires
55%cargo_generate_buildrequires
56
57%build
58# Set environment variables for ICU libraries
59EDIT_CFG_ICUUC_SONAME=libicuuc.so.%{icu_sover}
60EDIT_CFG_ICUI18N_SONAME=libicui18n.so.%{icu_sover}
61
62%cargo_build
63%{cargo_license_summary}
64%{cargo_license} > LICENSE.dependencies
65
66%install
67%cargo_install
68
69# de-conflict with vim
70mv %{buildroot}%{_bindir}/edit %{buildroot}%{_bindir}/%{name}
71
72# Change binary and icon in .desktop file then install it
73sed -i \
74 -e "s|Icon=edit|Icon=%{_datadir}/pixmaps/%{name}.ico|g" \
75 -e "s|Exec=edit %%F|Exec=%{name} %%F|g" assets/com.microsoft.edit.desktop
76desktop-file-install --dir=%{buildroot}%{_datadir}/applications assets/com.microsoft.edit.desktop
77
78# Install icon
79install -Dpm 0644 assets/edit.ico %{buildroot}%{_datadir}/pixmaps/%{name}.ico
80install -Dpm 0644 assets/edit.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
81
82# Change manpage to match binary name and install it
83sed -i \
84 -e "s|edit |msedit |g" \
85 -e "s|EDIT 1|MSEDIT 1|g" \
86 -e "s|fBedit|fBmsedit|g" assets/manpage/edit.1
87install -Dpm0644 -t %{buildroot}%{_mandir}/man1 assets/manpage/*.1
88mv %{buildroot}%{_mandir}/man1/edit.1 %{buildroot}%{_mandir}/man1/%{name}.1
89
90%if %{with check}
91%check
92%cargo_test
93%endif
94
95%files
96%license LICENSE
97%license LICENSE.dependencies
98%doc CODE_OF_CONDUCT.md
99%doc CONTRIBUTING.md
100%doc README.md
101%doc SECURITY.md
102%{_bindir}/%{name}
103%{_datadir}/applications/com.microsoft.edit.desktop
104%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
105%{_datadir}/pixmaps/%{name}.ico
106%{_mandir}/man1/%{name}.1*
107
108%changelog
109%autochangelog
110