File less.spec of Package less-v530

Name:		less
Version:	530
Release:        1	
Summary:	Less is a pager that displays text files.
License:	GPLv3+ or BSD
URL:		http://www.greenwoodsoftware.com/less
Source0:	%{name}-%{version}.tar.gz
BuildRequires:	git gcc make ncurses-devel autoconf automake libtool
BuildRequires:  autoconf automake libtool python3

%description
Less is a pager. A pager is a program that displays text files.
Other pagers commonly in use are more and pg. Pagers are often
used in command-line environments like the Unix shell and the MS-DOS
command prompt to display files.

Less is not an editor. You can't change the contents of the file
you're viewing. Less is not a windowing system. It doesn't have
fancy scroll bars or other GUI (graphical user interface) elements.

%package help
Summary:	Help documents for less
BuildArch:	noarch

%description help
Help documents for less.

%prep
%autosetup -n %{name}-%{version}

%build
export CFLAGS="%{optflags} -Wno-error -Wno-error=implicit-function-declaration -std=gnu11"
export CXXFLAGS="%{optflags} -Wno-error"

rm -f ./configure
autoreconf -ivf
# less-530 uses K&R-style prototypes that conflict with modern termcap prototypes.
# Keep changes in spec by patching during build instead of changing upstream sources.
sed -i \
    -e 's/^static char \*cheaper();/static char *cheaper(char *, char *, char *);/' \
    -e 's/^static void tmodes();/static void tmodes(char *, char *, char **, char **, char *, char *, char **);/' \
    -e 's/^extern char \*tgetstr();/extern char *tgetstr(const char *, char **);/' \
    -e 's/^extern char \*tgoto();/extern char *tgoto(const char *, int, int);/' \
    screen.c
%configure LIBS="-lncursesw -ltinfo"
%make_build CFLAGS="%{optflags} -std=gnu11 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"

%install
%make_install


%files
%defattr(-,root,root)
%license LICENSE COPYING
%{_bindir}/less*

%files help
%doc README NEWS INSTALL
%{_mandir}/man1/*

%changelog
* Thu Jan 09 2020 openEuler Buildteam <buildteam@openeuler.org> - 551-3
- Delete unneeded files

* Fri Sep 27 2019 yefei <yefei25@huawei.com> - 551-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: delete irrelevant comment

* Tue Sep 10 2019 openEuler Buildteam <buildteam@openeuler.org> - 551-1
- Package Init
openSUSE Build Service is sponsored by