File indent.spec of Package indent

#
# spec file for package indent
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           indent
Version:        2.2.11
Release:        0
Summary:        Indent Formats C Source Code
License:        GPL-3.0+
Group:          Development/Languages/C and C++
Url:            http://www.gnu.org/software/indent
#Source0:        ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz
#Source1:        ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz.sig
#Source2:        %{name}.keyring
# Version 2.2.11 is not available at ftp.gnu.org as it has been developed outside the GNU project
# see https://lists.gnu.org/archive/html/bug-indent/2015-11/msg00004.html
Source0:        http://debian.lagis.at/debian/pool/main/i/indent/indent_%{version}.orig.tar.gz
Patch1:         indent-2.2.10-warnings.diff
Patch2:         indent-2.2.10-lcall.diff
Patch4:         indent-2.2.10-man.diff
Patch5:         indent-texi2html-5.0.patch
# PATCH-FIX-UPSTREAM danilo.spinella@suse.com bsc#1209718
# c2b74c05435c59225badaeeb2a5e40c20284528a
# use-after-free in handle_token_preesc
Patch6:         fix-use-after-free.patch
# 1af3c2f85bbd24aea4edfc9f92e2bb5a11f9f643
# buffer over-read in found_keyword
Patch7:         fix-buffer-overflow-print_comment.patch
# 02cd75a75903122c503bb6f43ef09c1e70b283eb
# buffer over-flow in print_comment
Patch8:         fix-buffer-overread-found_keyword.patch
# PATCH-FIX-SECURITY fix-out-of-buffer-read-CVE-2023-40305.patch fix-heap-buffer-overwrite-search_brace-CVE-2023-40305 bsc#1214243 CVE-2023-40305 antonio.teixeira@suse.com -- indent: heap-based buffer overflow in search_brace() in indent.c via a crafted file
Patch9:         fix-out-of-buffer-read-CVE-2023-40305.patch
Patch10:        fix-heap-buffer-overwrite-search_brace-CVE-2023-40305.patch
# CVE-2024-0911 [bsc#1219210], heap-based buffer overflow in set_buf_break()
Patch11:        indent-CVE-2024-0911.patch
BuildRequires:  makeinfo
BuildRequires:  texi2html
Requires(pre):  %{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
%patch1
%patch2
%patch4
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1

%build
%configure
make %{?_smp_mflags}

%install
%make_install
# indent.html is installed with doc below
rm -f %{buildroot}%{_prefix}/doc/indent/indent.html %{buildroot}%{_bindir}/texinfo2man %{buildroot}/%{_infodir}/dir
mv %{buildroot}%{_datadir}/locale/zh_TW.Big5 %{buildroot}%{_datadir}/locale/zh_TW
%find_lang %{name}

%check
make %{?_smp_mflags} -C regression

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

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

%files -f %{name}.lang
%{_bindir}/*
%doc COPYING NEWS README ChangeLog doc/indent.html
%{_infodir}/%{name}.info%{ext_info}
%{_mandir}/man1/indent.1%{ext_man}

%changelog
openSUSE Build Service is sponsored by