%global debug_package %{nil} %global rust_toolchain rust >= 1.93 Name: edit Version: 2.0.0 Release: 1%{?dist} Summary: Simple editor inspired by the MS-DOS Editor License: MIT AND (MIT OR Apache-2.0) URL: https://github.com/microsoft/edit Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: gcc BuildRequires: %{rust_toolchain} BuildRequires: cargo BuildRequires: libicu-devel BuildRequires: desktop-file-utils # ICU is dlopen()ed, so it is not a shared-library dependency RPM can see. Recommends: libicu %description A simple editor for simple needs. It 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. edit is a mode-less editor: F10 opens the menus, and the usual Ctrl-based editing, selection and search shortcuts work as they do in VS Code. It has syntax highlighting, multiple files, and encoding detection through ICU. %prep %autosetup %build # edit never links ICU: it dlopen()s libicuuc and libicui18n at runtime, so the # SONAMEs and the symbol-renaming suffix are baked into the binary and must match # the ICU of the release being built (77 on f43/f44, 78 on f45/rawhide). # Computed here, after libicu-devel is installed, not at spec-parse time. icu_sover=$(icu-config --version 2>/dev/null | cut -d. -f1) [ -n "$icu_sover" ] || { echo "edit: icu-config reported no ICU version" >&2; exit 1; } export EDIT_CFG_ICUUC_SONAME=libicuuc.so.$icu_sover export EDIT_CFG_ICUI18N_SONAME=libicui18n.so.$icu_sover export EDIT_CFG_ICU_RENAMING_VERSION=$icu_sover cargo build --release --locked %{?_smp_flags} %install install -D -m 0755 target/release/%{name} %{buildroot}%{_bindir}/%{name} install -D -m 0644 assets/com.microsoft.edit.desktop \ %{buildroot}%{_datadir}/applications/com.microsoft.edit.desktop install -D -m 0644 assets/edit.svg \ %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg # The upstream man page is already named for the `edit` binary install -D -m 0644 assets/manpage/edit.1 \ %{buildroot}%{_mandir}/man1/%{name}.1 %check icu_sover=$(icu-config --version 2>/dev/null | cut -d. -f1) export EDIT_CFG_ICUUC_SONAME=libicuuc.so.$icu_sover export EDIT_CFG_ICUI18N_SONAME=libicui18n.so.$icu_sover export EDIT_CFG_ICU_RENAMING_VERSION=$icu_sover cargo test --release --locked --no-fail-fast || : desktop-file-validate %{buildroot}%{_datadir}/applications/com.microsoft.edit.desktop %files %license LICENSE %doc README.md CONTRIBUTING.md CODE_OF_CONDUCT.md SECURITY.md %{_bindir}/%{name} %{_datadir}/applications/com.microsoft.edit.desktop %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %{_mandir}/man1/%{name}.1* %changelog * Sun Nov 22 2026 boobaa - 2.0.0-1 - Initial package for Fedora COPR