%global upstream_version 0.4.0-devel3 Name: blesh Version: 0.4.0~devel3 Release: 4%{?dist} Summary: Command line editor written in pure Bash which replaces the default GNU Readline # contrib/ is MIT License: BSD-3-Clause AND MIT URL: https://github.com/akinomyoga/ble.sh # the official tarball does not have Makefile and other files we need # upstream uses submodules github tag's archive is not helpful ## I cannot use git-archive as we need .git too # you can generate the tarball using $SOURCE2 # generate-tarball.sh %%{upstream_version} Source0: ble.sh-0.4.0-devel3.tar.gz Source1: README-Fedora.txt Source2: generate-tarball.sh BuildArch: noarch BuildRequires: git BuildRequires: make BuildRequires: gawk Requires: bash # ps Requires: procps-ng # for faster processing Suggests: gawk # tput Suggests: ncurses Suggests: gzip Suggests: bzip2 # benchmark Suggests: ksh # tests # ps BuildRequires: procps-ng BuildRequires: glibc-langpack-en %description Enhanced Bash Line Editor with features like: * Syntax highlighting: Highlight command lines input by users as in fish and zsh-syntax-highlighting. Unlike the simple highlighting in zsh-syntax-highlighting, ble.sh performs syntactic analysis to enable the correct highlighting of complex structures such as nested command substitutions, multiple here documents, etc. Highlighting colors and styles are fully configurable. * Enhanced completion: Extend completion by syntax-aware completion, completion with quotes and parameter expansions in prefix texts, ambiguous candidate generation, etc. Also, menu-complete supports the selection of candidates in the menu (candidate list) by cursor keys, TAB, and S-TAB. The feature auto-complete supports the automatic suggestion of completed texts as in fish and zsh-autosuggestions (with Bash 4.0+). The feature menu-filter integrates automatic filtering of candidates into menu completion (with Bash 4.0+). There are other functionalities such as dabbrev and sabbrev like zsh abbreviations or zsh-abbr. * Vim editing mode: Enhance readline's vi editing mode available with set -o vi. Vim editing mode supports various vim modes such as char/line/block visual/select mode, replace mode, command mode, operator pending mode as well as insert mode and normal mode. Vim editing mode supports various operators, text objects, registers, keyboard macros, marks, etc. It also provides vim-surround as an option. * Other interesting features include status line, history share, right prompt, transient prompt, xterm title, etc. %prep %autosetup -c %build %{make_build} %install mkdir -p %{buildroot}%{_libexecdir}/blesh/ cp -a * %{buildroot}%{_libexecdir}/blesh/ %{make_install} INSDIR=%{buildroot}%{_libexecdir}/blesh/ #make install PREFIX=%{buildroot}%{_libexecdir}/blesh/ mkdir -p %{buildroot}%{_pkgdocdir} mv %{buildroot}%{_libexecdir}/blesh/doc/* %{buildroot}%{_pkgdocdir}/ mv %{buildroot}%{_libexecdir}/blesh/docs/* %{buildroot}%{_pkgdocdir}/ install -m 644 -p %{SOURCE1} %{buildroot}%{_pkgdocdir} rmdir %{buildroot}%{_libexecdir}/blesh/doc rmdir %{buildroot}%{_libexecdir}/blesh/docs rm -f %{buildroot}%{_libexecdir}/blesh/LICENSE.md %{buildroot}%{_pkgdocdir}/LICENSE.md rm -f %{buildroot}%{_libexecdir}/blesh/contrib/LICENSE %{buildroot}%{_pkgdocdir}/contrib/LICENSE mkdir -p %{buildroot}%{_pkgdocdir}/contrib/ mv %{buildroot}%{_libexecdir}/blesh/contrib/README*.md %{buildroot}%{_pkgdocdir}/contrib/ # downstream fixes chmod a+x %{buildroot}%{_libexecdir}/blesh/lib/benchmark.ksh for file in bash-preexec.bash fzf-completion.bash fzf-git.bash fzf-initialize.bash fzf-key-bindings.bash; do ln -sf "integration/$file" "%{buildroot}%{_libexecdir}/blesh/contrib/$file" done # shebang mangling for i in %{buildroot}%{_libexecdir}/blesh/{make_command.sh,memo/benchmark/201903-mapfile.sh,memo/benchmark/string-split-lines.sh} ; do sed -i -e 's|^\#!/usr/bin/env bash|#!/bin/bash|' "$i" done %check export LANG="C.utf8" export LC_MESSAGES="C" export LC_ALL="C.utf8" bash -c "source %{buildroot}%{_libexecdir}/blesh/out/ble.sh --test" %files %doc %{_pkgdocdir} #%%doc README-ja_JP.md README.md %{_libexecdir}/blesh # contrib/LICENSE is identical %license LICENSE.md %exclude %{_libexecdir}/blesh/contrib/.git %exclude %{_libexecdir}/blesh/out %exclude %{_libexecdir}/blesh/memo/D1894/.gitignore %exclude %{_libexecdir}/blesh/lib/*.c %exclude %{_libexecdir}/blesh/GNUmakefile %exclude %{_libexecdir}/blesh/Makefile %exclude %{_libexecdir}/blesh/README-ja_JP.md %exclude %{_libexecdir}/blesh/README.md %exclude %{_libexecdir}/blesh/make/*.cpp %exclude %{_libexecdir}/blesh/memo/*.c %changelog * Sat Sep 21 2024 msuchy - 0.4.0~devel3-4 - add script generate-tarball.sh * Mon Aug 19 2024 msuchy - 0.4.0~devel3-3 - improvements to met requirements of Fedora Package Review * Fri Feb 16 2024 msuchy 0.4.0~devel3-2 - initial release