Name: chr Version: 0.1.81 Release: 0~dev1%{?dist} Summary: Terminal-based text editor License: BSL-1.0 AND MIT URL: https://github.com/chr-editor/chr/ Source0: https://github.com/chr-editor/chr/releases/download/%{version}/chr-%{version}.tar.gz # cherry picked from upstream -- tests: readWrite: Fix memory leak. Patch0: https://github.com/chr-editor/chr/commit/9657fd3ad95536c19c8b3f68987614d81b04845c.patch BuildRequires: meson BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: qt6-qtbase-devel BuildRequires: pkgconfig BuildRequires: pkgconfig(termpaint) BuildRequires: pkgconfig(PosixSignalManagerQt6) BuildRequires: pkgconfig(TuiWidgetsQt6) BuildRequires: cmake(KF6SyntaxHighlighting) BuildRequires: pkgconfig(catch2) Requires(post): /usr/sbin/alternatives Requires(preun): /usr/sbin/alternatives %description chr is a simple editor that is easy to use for users coming from desktop environments. Keyboard shortcuts are similar to the default editors in Gnome, KDE and other desktop environments. For example text is selected using shift+arrow keys, copy and paste uses ctrl+c and ctrl+v and there is a drop down menu(F10) to discover additional features and settings. The look and feel is a blend of modern GUI editors and late 90s PC text mode editors (e.g. Turbo Vision based or edit.com) adapted to fit into terminal based workflows. It implements many features like: - selecting text by holding Shift - usable without a complicated config file - block selection - multi windows (overlapping, tiled, full-screen) - text from full width windows can be copied from the terminal without window borders, scroll bars or additional spaces interfering. - syntax highlighting - undo/redo - display line numbers - soft-wrapping of long lines - interactive search and replace (with regular expression support) - go-to line (and column) command - support stdin buffers - drop down menus %package tiny Summary: Terminal-based text editor - without syntax highlighting Requires(post): /usr/sbin/alternatives Requires(preun): /usr/sbin/alternatives %description -n chr-tiny chr is a simple editor that is easy to use for users coming from desktop environments. Keyboard shortcuts are similar to the default editors in Gnome, KDE and other desktop environments. For example text is selected using shift+arrow keys, copy and paste uses ctrl+c and ctrl+v and there is a drop down menu(F10) to discover additional features and settings. The look and feel is a blend of modern GUI editors and late 90s PC text mode editors (e.g. Turbo Vision based or edit.com) adapted to fit into terminal based workflows. It implements many features like: - selecting text by holding Shift - usable without a complicated config file - block selection - multi windows (overlapping, tiled, full-screen) - text from full width windows can be copied from the terminal without window borders, scroll bars or additional spaces interfering. - undo/redo - display line numbers - soft-wrapping of long lines - interactive search and replace (with regular expression support) - go-to line (and column) command - support stdin buffers - drop down menus The tiny version is compiled without support for syntax highlighting. %prep %autosetup -p1 rm -rf third-party/catch2 # This leaves *.theme data files not problematic under bundling policy %build %define _vpath_builddir %_target_platform-tiny %meson \ -Dversion=%{version} \ -Dqt=qt6 \ -Dsystem-catch2=enabled \ %{nil} %meson_build %define _vpath_builddir %_target_platform-normal %meson \ -Dversion=%{version} \ -Dqt=qt6 \ -Dsystem-catch2=enabled \ -Dsyntax_highlighting=true \ %{nil} %meson_build %install %define _vpath_builddir %_target_platform-tiny %meson_install mv %{buildroot}%{_bindir}/chr %{buildroot}%{_bindir}/chr-tiny mv %{buildroot}%{_mandir}/man1/chr.1 %{buildroot}%{_mandir}/man1/chr-tiny.1 mv %{buildroot}%{_mandir}/de/man1/chr.1 %{buildroot}%{_mandir}/de/man1/chr-tiny.1 %define _vpath_builddir %_target_platform-normal %meson_install mv %{buildroot}%{_bindir}/chr %{buildroot}%{_bindir}/chr-default mv %{buildroot}%{_mandir}/man1/chr.1 %{buildroot}%{_mandir}/man1/chr-default.1 mv %{buildroot}%{_mandir}/de/man1/chr.1 %{buildroot}%{_mandir}/de/man1/chr-default.1 %check %define _vpath_builddir %_target_platform-tiny %meson_test %define _vpath_builddir %_target_platform-normal %meson_test %posttrans # check for nodocs mode if [ -d %{_mandir}/man1 -a -d %{_mandir}/de/man1 ] ; then /usr/sbin/alternatives --install %{_bindir}/chr chr %{_bindir}/chr-default 40 \ --follower %{_mandir}/man1/chr.1.gz chr-man %{_mandir}/man1/chr-default.1.gz \ --follower %{_mandir}/de/man1/chr.1.gz chr-man-de %{_mandir}/de/man1/chr-default.1.gz else /usr/sbin/alternatives --install %{_bindir}/chr chr %{_bindir}/chr-default 40 fi %posttrans -n chr-tiny # check for nodocs mode if [ -d %{_mandir}/man1 -a -d %{_mandir}/de/man1 ] ; then /usr/sbin/alternatives --install %{_bindir}/chr chr %{_bindir}/chr-tiny 20 \ --follower %{_mandir}/man1/chr.1.gz chr-man %{_mandir}/man1/chr-tiny.1.gz \ --follower %{_mandir}/de/man1/chr.1.gz chr-man-de %{_mandir}/de/man1/chr-tiny.1.gz else /usr/sbin/alternatives --install %{_bindir}/chr chr %{_bindir}/chr-tiny 20 fi %preun if [ $1 = 0 ]; then /usr/sbin/alternatives --remove chr %{_bindir}/chr-default || : fi %preun -n chr-tiny if [ $1 = 0 ]; then /usr/sbin/alternatives --remove chr %{_bindir}/chr-tiny || : fi %files /usr/bin/chr-default %ghost %attr(0755,root,root) %{_bindir}/chr # posttrans depends on the exact names, not using # globs makes sure we don't create a package broken at install time %doc %{_mandir}/de/man1/chr-default.1.gz %doc %{_mandir}/man1/chr-default.1.gz %ghost %attr(0644,root,root) %{_mandir}/de/man1/chr.1.gz %ghost %attr(0644,root,root) %{_mandir}/man1/chr.1.gz %license COPYING %files -n chr-tiny /usr/bin/chr-tiny %ghost %attr(0755,root,root) %{_bindir}/chr # posttrans depends on the exact names, not using # globs makes sure we don't create a package broken at install time %doc %{_mandir}/de/man1/chr-tiny.1.gz %doc %{_mandir}/man1/chr-tiny.1.gz %ghost %attr(0644,root,root) %{_mandir}/de/man1/chr.1.gz %ghost %attr(0644,root,root) %{_mandir}/man1/chr.1.gz %license COPYING %changelog * Fri Sep 11 2026 Martin Hostettler - 0.1.81-0~dev1 * Initial packaging for fedora