summaryrefslogtreecommitdiff
path: root/packaging/nano.spec
blob: b549caf5830f443fdc3aa2777060b2a639674266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Name:           nano
Version:        2.3.1
Release:        1
Summary:        Pico Editor Clone with Enhancements

License:        GPL-3.0+
Url:            http://www.nano-editor.org/
Group:          Productivity/Editors/Other
Source0:        %{name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  file-devel
BuildRequires:  pkgconfig(ncurses)
Recommends:     %{name}-locale = %{version}

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

%lang_package

%prep
%setup -q

# Remove build time references so build-compare can do its work
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" src/nano.c
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" src/nano.c

%build
%configure --disable-rpath --enable-utf8
make %{?_smp_mflags}

%install
%make_install

# Remove doc files from /usr/share/nano (they should be in defaultdocdir)
rm -rf %{buildroot}%{_datadir}/nano/man-html/
rm -rf %{buildroot}%{_mandir}/fr

%find_lang %{name} --all-name

%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info}

%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info}

%files
%defattr(-,root,root,-)
%{_bindir}/nano
%{_bindir}/rnano
%{_datadir}/nano/

%docs_package

%changelog