File htmldoc.spec of Package htmldoc.17396

#
# spec file for package htmldoc
#
# Copyright (c) 2015 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:           htmldoc
BuildRequires:  autoconf
BuildRequires:  fltk-devel
BuildRequires:  freeglut-devel
BuildRequires:  gcc-c++
BuildRequires:  libdrm-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  openssl-devel
Url:            http://htmldoc.org/
Version:        1.8.28
Release:        0
Summary:        HTML Processor that Generates HTML, PostScript, and PDF Files
License:        GPL-2.0-or-later
Group:          Productivity/Publishing/HTML/Tools
Source:         https://github.com/michaelrsweet/htmldoc/releases/download/release-%{version}/htmldoc-%{version}-source.tar.bz2
Patch:          %{name}-docpath.diff
# PATCH-FIX-UPSTREAM htmldoc-cups_rand.patch upstream bug #510
Patch1:         htmldoc-cups_rand.patch
# PATCH-FIX-UPSTREAM 0001-Fix-crash-bug-with-bad-GIFs-Issue-423.patch -- https://github.com/michaelrsweet/htmldoc/commit/6a8322a718b2ba5c440bd33e6f26d9e281c39654
Patch2:         0001-Fix-crash-bug-with-bad-GIFs-Issue-423.patch
# CVE-2021-40985 [bsc#1192357], buffer overflow may lead to DoS via a crafted BMP image
Patch3:         htmldoc.openSUSE_Backports_SLE-12-SP1-CVE-2021-40985.patch
# CVE-2021-43579 [bsc#1194487], stack-based buffer overflow in image_load_bmp() results in remote code execution if the victim converts an HTML document linking to a crafted BMP file
Patch4:         htmldoc.openSUSE_Backports_SLE-12-SP1-CVE-2021-43579.patch
# CVE-2022-0534 [bsc#1195758], stack out-of-bounds read in gif_get_code() when opening a malicious GIF file results in a segmentation fault
Patch5:         htmldoc.openSUSE_Backports_SLE-12-SP1-CVE-2022-0534.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define       DOCDIR %{_datadir}/doc/packages/%{name}

%description
HTMLDOC converts HTML source files into indexed HTML, PostScript, or
Portable Document Format (PDF) files that can be viewed online or
printed.

%prep
%setup -q
%patch
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1

%build
export CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing"
autoconf
./configure \
	--bindir=%{_bindir} \
	--prefix=%{_usr} \
	--mandir=%{_mandir} \
	--with-gui
make

%install
[ x"${RPM_BUILD_ROOT}" = x"/" ] && ( echo "your buildroot is /" && exit 0) || rm -rf "${RPM_BUILD_ROOT}"
make \
	bindir=${RPM_BUILD_ROOT}/%{_bindir} \
	prefix=${RPM_BUILD_ROOT}/%{_usr} \
	mandir=${RPM_BUILD_ROOT}/%{_mandir} \
	datadir=${RPM_BUILD_ROOT}/%{_datadir} \
install

%files 
%defattr(-,root,root)
%{_bindir}/htmldoc
%{_datadir}/htmldoc
%doc %{_mandir}/man1/htmldoc.1.gz
%doc cgi-bin/ CHANGES.txt COPYING.txt README.txt

%changelog
openSUSE Build Service is sponsored by