6aeb452
Name:           libtommath
Pokorra, Gerd 7160541
Version:        1.2.0
5c1144a
Release:        %autorelease
c79674a
Summary:        A portable number theoretic multiple-precision integer library
6aeb452
License:        Public Domain
71763c3
URL:            http://www.libtom.net/
077a591
7e93531
Source0:        https://github.com/libtom/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
077a591
832e40d
Patch:          CVE-2023-36328.patch
832e40d
d265503
BuildRequires:  make
25d7dd7
BuildRequires:  libtool
25d7dd7
25d7dd7
%if ! 0%{?flatpak}
077a591
BuildRequires:  ghostscript
caf5481
BuildRequires:  ghostscript-tools-dvipdf
0e64544
BuildRequires:  libtiff-tools
0e64544
BuildRequires:  tex(amssymb.sty)
c92091c
BuildRequires:  tex(cmr10.tfm)
0e64544
BuildRequires:  tex(epstopdf-base.sty)
0e64544
BuildRequires:  tex(expl3.sty)
c92091c
BuildRequires:  tex(fancyhdr.sty)
c92091c
BuildRequires:  tex(hyphen.tex)
d265503
BuildRequires:  tex(l3backend-dvips.def)
0e64544
BuildRequires:  texlive-appendix
0e64544
BuildRequires:  texlive-dvips-bin
0e64544
BuildRequires:  texlive-kpathsea
0e64544
BuildRequires:  texlive-latex-bin-bin
0e64544
BuildRequires:  texlive-makeindex-bin
0e64544
BuildRequires:  texlive-metafont
0e64544
BuildRequires:  texlive-mfware-bin
25d7dd7
%endif
6aeb452
6aeb452
%description
077a591
A free open source portable number theoretic multiple-precision integer library
077a591
written entirely in C. (phew!). The library is designed to provide a simple to
077a591
work with API that provides fairly efficient routines that build out of the box
077a591
without configuration.
6aeb452
6aeb452
%package        devel
6aeb452
Summary:        Development files for %{name}
fe1e6ed
Requires:       %{name}%{?_isa} = %{version}-%{release}
6aeb452
6aeb452
%description    devel
077a591
The %{name}-devel package contains libraries and header files for developing
077a591
applications that use %{name}.
6aeb452
25d7dd7
%if ! 0%{?flatpak}
c79674a
%package        doc
c79674a
Summary:        Documentation files for %{name}
fe1e6ed
BuildArch:      noarch
fe1e6ed
Provides:       %{name}-doc = %{version}-%{release}
fe1e6ed
Obsoletes:      %{name}-doc < 0.42-1
c79674a
c79674a
%description    doc
077a591
The %{name}-doc package contains PDF documentation for using %{name}.
25d7dd7
%endif
c79674a
6aeb452
%prep
832e40d
%autosetup -p1
c92091c
# Fix permissions on installed library
c92091c
sed -i -e 's/644 $(LIBNAME)/755 $(LIBNAME)/g' makefile.shared
c92091c
# Fix pkgconfig path
1cf292d
sed -i \
c92091c
    -e 's|^prefix=.*|prefix=%{_prefix}|g' \
c92091c
    -e 's|^libdir=.*|libdir=%{_libdir}|g' \
c92091c
    %{name}.pc.in
6aeb452
6aeb452
%build
0c2ccf0
%set_build_flags
0c2ccf0
%make_build V=1 CFLAGS="$CFLAGS -I./" -f makefile.shared
25d7dd7
%if ! 0%{?flatpak}
Pokorra, Gerd 7160541
make V=1 -f makefile manual docs
25d7dd7
%endif
6aeb452
6aeb452
%install
0c2ccf0
%make_install V=1 CFLAGS="$CFLAGS -I./" PREFIX=%{_prefix} LIBPATH=%{_libdir} -f makefile.shared
54c3dd9
fe1e6ed
find %{buildroot} -name '*.la' -delete
fe1e6ed
find %{buildroot} -name '*.a' -delete
6aeb452
e7206f5
%ldconfig_scriptlets
6aeb452
6aeb452
%files
1cf292d
%license LICENSE
6aeb452
%{_libdir}/*.so.*
6aeb452
6aeb452
%files devel
ec40d2f
%{_includedir}/*.h
6aeb452
%{_libdir}/*.so
c92091c
%{_libdir}/pkgconfig/*.pc
6aeb452
25d7dd7
%if ! 0%{?flatpak}
c79674a
%files doc
Pokorra, Gerd 7160541
%doc doc/bn.pdf
25d7dd7
%endif
c79674a
6aeb452
%changelog
5c1144a
%autochangelog