File indent.spec of Package indent.28683

#
# spec file for package indent
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           indent
BuildRequires:  texinfo
Version:        2.2.10
Release:        0
Source:         %{name}-%{version}.tar.bz2
Patch0:         %{name}-%{version}-nothing_is_void.diff
Patch1:         %{name}-%{version}-warnings.diff
Patch2:         %{name}-%{version}-lcall.diff
Patch3:         %{name}-%{version}-cdw.diff
Patch4:         %{name}-%{version}-man.diff
# PATCH-FIX-UPSTREAM danilo.spinella@suse.com bsc#1209718
# c2b74c05435c59225badaeeb2a5e40c20284528a
# use-after-free in handle_token_preesc
Patch5:         fix-use-after-free.patch
# 1af3c2f85bbd24aea4edfc9f92e2bb5a11f9f643
# buffer over-read in found_keyword
Patch6:         fix-buffer-overflow-print_comment.patch
# 02cd75a75903122c503bb6f43ef09c1e70b283eb
# buffer over-flow in print_comment
Patch7:         fix-buffer-overread-found_keyword.patch
URL:            http://www.gnu.org/software/indent
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Indent Formats C Source Code
License:        GPL-3.0-or-later
Group:          Development/Languages/C and C++
PreReq:         %install_info_prereq

%description
indent can be used to make code easier to read. It can also convert
from one style of writing C code to another. indent understands a
substantial amount of C syntax, but it also tries to cope with
incomplete and malformed syntax.

%prep
%setup -q
%patch0 -p1
%patch1
%patch2
%patch3 -p1
%patch4
%patch5 -p1
%patch6 -p1
%patch7 -p1

%build
%configure --with-pic
# Parallel make doesn't work
make

%install
make DESTDIR=$RPM_BUILD_ROOT install
# indent.html is installed with %doc below
rm -f $RPM_BUILD_ROOT/usr/doc/indent/indent.html $RPM_BUILD_ROOT%{_bindir}/texinfo2man $RPM_BUILD_ROOT/%{_infodir}/dir
mv $RPM_BUILD_ROOT%{_datadir}/locale/zh_TW.Big5 $RPM_BUILD_ROOT%{_datadir}/locale/zh_TW
%find_lang %{name}

%check
echo =============== TEST BEGIN ===============
make -C regression
echo =============== TEST  END  ===============

%clean
rm -rf $RPM_BUILD_ROOT

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

%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%files -f %{name}.lang
%defattr(-, root, root)
%{_bindir}/*
%doc doc/indent.html
%{_infodir}/indent.info*.gz
%{_mandir}/man1/indent.1.gz

%changelog
openSUSE Build Service is sponsored by