Archive for the ‘editors’ Category

rpm spec for gnu nano on aix

Thursday, February 1st, 2007

I’m kind of divided about which editor I prefer, GNU nano or vim. They both have their merits and their problems. Anyway, one day while using AIX I was missing nano. Since IBM doesn’t provide an RPM for it I tried using the SRPM from the nano website. Of course it didn’t work out of the box like it should have. The main issues were the configure options and the dependencies. IBM distributes gettext-devel and gettext as one package named gettext, so requiring gettext-devel doesn’t make much sense. My modified nano.spec file is below:

# GNU nano packaged for IBM's AIX Toolbox for Linux Apps
# Based on the nano.spec from nano-editor.org

%define name nano
%define version 2.0.3
%define release 1

Summary : Pico editor clone with enhancements
Name : %{name}
Version : %{version}
Release : %{release}
License : GPL
Group : Applications/Editors
URL : http://www.nano-editor.org/
Source : http://www.nano-editor.org/dist/v2.0/%{name}-%{version}.tar.gz
Requires : gettext, ncurses
BuildRoot : %{_tmppath}/%{name}-%{version}-root
BuildRequires : autoconf, automake, gettext, ncurses-devel

%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 \
--prefix=/opt/freeware \
--exec-prefix=/opt/freeware \
--bindir=/opt/freeware/bin \
--sbindir=/opt/freeware/sbin \
--sysconfdir=/opt/freeware/etc \
--datadir=/opt/freeware/share \
--includedir=/opt/freeware/include \
--libdir=/opt/freeware/lib \
--libexecdir=/opt/freeware/libexec \
--localstatedir=/opt/freeware/var \
--sharedstatedir=/opt/freeware/com \
--mandir=/opt/freeware/man \
--infodir=/opt/freeware/info
make

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

%files
%defattr(-,root,root)
%doc doc/nanorc.sample
%{_bindir}/*
%{_mandir}/man*/*
%{_mandir}/fr/man*/*
%{_infodir}/nano.info*
%{_datadir}/locale/*/LC_MESSAGES/nano.mo

You can build the binary (.rpm) using the following command:

rpm -bb nano.spec