Add default-editor subpackage (#1854444)
Reference: https://fedoraproject.org/wiki/Changes/UseNanoByDefault
This commit is contained in:
parent
f1e1d2d934
commit
cf1ce689f1
5
nano-default-editor.csh
Normal file
5
nano-default-editor.csh
Normal file
@ -0,0 +1,5 @@
|
||||
# Ensure GNU nano is set as EDITOR if it isn't already set
|
||||
|
||||
if ( ! ($?EDITOR) ) then
|
||||
setenv EDITOR "/usr/bin/nano"
|
||||
endif
|
8
nano-default-editor.fish
Normal file
8
nano-default-editor.fish
Normal file
@ -0,0 +1,8 @@
|
||||
# Ensure GNU nano is set as EDITOR if it isn't already set
|
||||
# This is set as a universal variable so that any other definition
|
||||
# by the user would win
|
||||
# Cf. https://fishshell.com/docs/current/index.html#variables-scope
|
||||
|
||||
if ! set -q EDITOR;
|
||||
set -Ux EDITOR /usr/bin/nano
|
||||
end
|
5
nano-default-editor.sh
Normal file
5
nano-default-editor.sh
Normal file
@ -0,0 +1,5 @@
|
||||
# Ensure GNU nano is set as EDITOR if it isn't already set
|
||||
|
||||
if [ -z "$EDITOR" ]; then
|
||||
export EDITOR="/usr/bin/nano"
|
||||
fi
|
31
nano.spec
31
nano.spec
@ -1,12 +1,17 @@
|
||||
Summary: A small text editor
|
||||
Name: nano
|
||||
Version: 4.9.3
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: GPLv3+
|
||||
URL: https://www.nano-editor.org
|
||||
Source: https://www.nano-editor.org/dist/latest/%{name}-%{version}.tar.xz
|
||||
Source2: nanorc
|
||||
|
||||
# Shell snippets for default-editor setup
|
||||
Source11: nano-default-editor.sh
|
||||
Source12: nano-default-editor.csh
|
||||
Source13: nano-default-editor.fish
|
||||
|
||||
BuildRequires: file-devel
|
||||
BuildRequires: gettext-devel
|
||||
BuildRequires: gcc
|
||||
@ -20,6 +25,15 @@ Conflicts: filesystem < 3
|
||||
%description
|
||||
GNU nano is a small and friendly text editor.
|
||||
|
||||
%package default-editor
|
||||
Summary: Sets GNU nano as the default editor
|
||||
Requires: nano = %{version}-%{release}
|
||||
BuildArch: noarch
|
||||
|
||||
%description default-editor
|
||||
This package ensures the EDITOR shell variable
|
||||
is set in common shells to GNU nano.
|
||||
|
||||
%prep
|
||||
%autosetup -S git
|
||||
|
||||
@ -53,6 +67,11 @@ install -m 0644 ./nanorc %{buildroot}%{_sysconfdir}/nanorc
|
||||
|
||||
%find_lang %{name}
|
||||
|
||||
# install nano-default-editor snippets
|
||||
install -Dpm 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/profile.d/%{basename:%{S:11}}
|
||||
install -Dpm 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/profile.d/%{basename:%{S:12}}
|
||||
install -Dpm 0644 %{SOURCE13} %{buildroot}%{_datadir}/fish/vendor_conf.d/%{basename:%{S:13}}
|
||||
|
||||
%files -f build/%{name}.lang
|
||||
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README THANKS TODO
|
||||
%doc build/doc/sample.nanorc
|
||||
@ -63,7 +82,17 @@ install -m 0644 ./nanorc %{buildroot}%{_sysconfdir}/nanorc
|
||||
%{_infodir}/nano.info*
|
||||
%{_datadir}/nano
|
||||
|
||||
%files default-editor
|
||||
%dir %{_sysconfdir}/profile.d
|
||||
%config(noreplace) %{_sysconfdir}/profile.d/nano-default-editor.*
|
||||
%dir %{_datadir}/fish/vendor_conf.d
|
||||
%{_datadir}/fish/vendor_conf.d/nano-default-editor.fish
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Jul 16 2020 Neal Gompa <ngompa13@gmail.com> - 4.9.3-2
|
||||
- Add default-editor subpackage (#1854444)
|
||||
|
||||
* Mon May 25 2020 Kamil Dudka <kdudka@redhat.com> - 4.9.3-1
|
||||
- new upstream release
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user