From a56e2efa82f13fa463157e0cd6c0c6c41e5c22607ad3ad0148af406d68038dc8 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Thu, 31 Dec 2020 13:44:40 +0000 Subject: [PATCH] Accepting request 859603 from home:Pharaoh_Atem:branches:editors - Install a useful default nanorc configuration - Enable useful extra definitions for syntax highlighting OBS-URL: https://build.opensuse.org/request/show/859603 OBS-URL: https://build.opensuse.org/package/show/editors/nano?expand=0&rev=142 --- nano.changes | 6 ++++++ nano.spec | 16 ++++++++++++++++ nanorc | 6 ++++++ 3 files changed, 28 insertions(+) create mode 100644 nanorc diff --git a/nano.changes b/nano.changes index 290b93f..13286c1 100644 --- a/nano.changes +++ b/nano.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Dec 31 12:40:05 UTC 2020 - Neal Gompa + +- Install a useful default nanorc configuration +- Enable useful extra definitions for syntax highlighting + ------------------------------------------------------------------- Thu Dec 3 07:35:47 UTC 2020 - Andreas Stieger diff --git a/nano.spec b/nano.spec index d44e237..48f2901 100644 --- a/nano.spec +++ b/nano.spec @@ -27,6 +27,7 @@ URL: https://nano-editor.org/ Source0: https://nano-editor.org/dist/v%{_version}/%{name}-%{version}.tar.xz Source1: https://nano-editor.org/dist/v%{_version}/%{name}-%{version}.tar.xz.asc Source2: https://savannah.gnu.org/people/viewgpg.php?user_id=42085#/%{name}.keyring +Source3: nanorc BuildRequires: file-devel BuildRequires: groff-full BuildRequires: makeinfo @@ -51,6 +52,13 @@ the Pico text editor while also offering a few enhancements. --enable-utf8 %make_build +# generate default /etc/nanorc +# - set hunspell as the default spell-checker +# - enable syntax highlighting by default +sed -e 's/^#.*set speller.*$/set speller "hunspell"/' \ + -e 's|^# \(include "/usr/share/nano/\*.nanorc"\)|\1|' \ + %{SOURCE3} doc/sample.nanorc > ./nanorc + %install %make_install @@ -58,6 +66,13 @@ the Pico text editor while also offering a few enhancements. mkdir -p %{buildroot}%{_docdir}/ mv -f %{buildroot}%{_datadir}/doc/%{name}/ %{buildroot}%{_docdir}/%{name}/ +# install default /etc/nanorc +mkdir -p %{buildroot}%{_sysconfdir} +install -m 0644 ./nanorc %{buildroot}%{_sysconfdir}/nanorc + +# enable useful extra syntax highlighting files by default +mv %{buildroot}%{_datadir}/nano/extra/{ada,fortran,haskell,spec}.* %{buildroot}%{_datadir}/nano + %find_lang %{name} --with-man --all-name %post @@ -72,6 +87,7 @@ mv -f %{buildroot}%{_datadir}/doc/%{name}/ %{buildroot}%{_docdir}/%{name}/ %doc %{_docdir}/nano/ %{_bindir}/nano %{_bindir}/rnano +%config(noreplace) %{_sysconfdir}/nanorc %{_datadir}/nano/ %{_infodir}/nano.info%{?ext_info} %{_mandir}/man1/nano.1%{?ext_man} diff --git a/nanorc b/nanorc new file mode 100644 index 0000000..6a1736d --- /dev/null +++ b/nanorc @@ -0,0 +1,6 @@ +## This is a system-wide configuration file for the nano editor. +## +## Each user can save his own configuration to ~/.nanorc +## +## See the nanorc(5) man page for details. +