Name: nano
Summary: Pico editor clone with enhancements
Version: 2.2.6
Release: 2%{?_dist_release}

Group: Applications/Editors
License: GPLv3+ and GFDL
URL: http://www.nano-editor.org/

Source0: http://www.nano-editor.org/dist/v2.2/%{name}-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: gettext
BuildRequires: ncurses-devel
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info

%description
GNU nano is a small and friendly text editor.  It aims to emulate the
Pico text editor while also offering a few enhancements.

%prep
%setup -q

%build
%configure --enable-all
make

%install
rm -rf %{buildroot}
make DESTDIR="%{buildroot}" install

rm -f $RPM_BUILD_ROOT%{_infodir}/dir

%clean
rm -rf %{buildroot}

%post
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/nano.info.gz

%preun
if [ $1 = 0 ] ;then
    /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/nano.info.gz
fi

%files
%defattr(-,root,root)
%doc AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS TODO 
%doc doc/faq.html doc/nanorc.sample
%{_bindir}/*
%{_mandir}/man*/*
%{_mandir}/fr/man*/*
%{_infodir}/nano.info*
%{_datadir}/locale/*/LC_MESSAGES/nano.mo
%{_datadir}/nano/*

%changelog
* Sat Aug 31 2019 Toshiaki Ara <ara_t@384.jp> 2.2.6-2
- rebuild with ncurses-6.1

* Sun Dec 01 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.2.6-1
- new upstream release

* Tue Oct 12 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.5-1
- new upstream release

* Fri Mar 19 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.3-1
- new upstream release

* Fri Jan  1 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.1-1
- new upstream release
- added %post, %preun section

* Fri Mar 20 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.9-1
- Initial build for Vine Linux.
