depend on file-devel
[platform/upstream/nano.git] / packaging / nano.spec
1 Name:           nano
2 Version:        2.3.1
3 Release:        1
4 Summary:        Pico Editor Clone with Enhancements
5
6 License:        GPL-3.0+
7 Url:            http://www.nano-editor.org/
8 Group:          Productivity/Editors/Other
9 Source0:        %{name}-%{version}.tar.bz2
10 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
11
12 BuildRequires:  file-devel
13 BuildRequires:  pkgconfig(ncurses)
14 Recommends:     %{name}-locale = %{version}
15
16 %description
17 GNU nano is a small and friendly text editor. It aims to emulate the
18 Pico text editor while also offering a few enhancements.
19
20 %lang_package
21
22 %prep
23 %setup -q
24
25 # Remove build time references so build-compare can do its work
26 FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
27 FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
28 sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" src/nano.c
29 sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" src/nano.c
30
31 %build
32 %configure --disable-rpath --enable-utf8
33 make %{?_smp_mflags}
34
35 %install
36 %make_install
37
38 # Remove doc files from /usr/share/nano (they should be in defaultdocdir)
39 rm -rf %{buildroot}%{_datadir}/nano/man-html/
40 rm -rf %{buildroot}%{_mandir}/fr
41
42 %find_lang %{name} --all-name
43
44 %post
45 %install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info}
46
47 %preun
48 %install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info}
49
50 %files
51 %defattr(-,root,root,-)
52 %{_bindir}/nano
53 %{_bindir}/rnano
54 %{_datadir}/nano/
55
56 %docs_package
57
58 %changelog