df5f11d
Name:           libtomcrypt
df5f11d
Version:        1.17
21b73f1
Release:        25%{?dist}
185b14e
Summary:        A comprehensive, portable cryptographic toolkit
df5f11d
License:        Public Domain
da98e9c
URL:            http://www.libtom.net/
da98e9c
da98e9c
Source0:        https://github.com/libtom/%{name}/releases/download/%{version}/crypt-%{version}.tar.bz2
David Woodhouse 19d02a8
Patch0:         %{name}-makefile.patch
David Woodhouse 19d02a8
Patch1:         %{name}-pkgconfig.patch
9405af4
Patch2:         %{name}-two-key-triple-des.patch
21b73f1
Patch3:         %{name}-CVE-2016-6129.patch
df5f11d
253e6a3
BuildRequires:  ghostscript
28d3b3d
BuildRequires:  libtommath-devel >= 0.42.0-3
David Woodhouse 19d02a8
BuildRequires:  libtool
26f205b
26f205b
%if 0%{?fedora} || 0%{?rhel} >= 7
253e6a3
BuildRequires:  tex(dvips)
253e6a3
BuildRequires:  tex(latex)
253e6a3
%else
253e6a3
BuildRequires:  tetex-dvips
253e6a3
BuildRequires:  tetex-latex
253e6a3
%endif
253e6a3
26f205b
Requires:       libtommath >= 0.42.0
df5f11d
df5f11d
%description
David Woodhouse 19d02a8
A comprehensive, modular and portable cryptographic toolkit that provides
David Woodhouse 19d02a8
developers with a vast array of well known published block ciphers, one-way hash
David Woodhouse 19d02a8
functions, chaining modes, pseudo-random number generators, public key
David Woodhouse 19d02a8
cryptography and a plethora of other routines.
df5f11d
David Woodhouse 19d02a8
Designed from the ground up to be very simple to use. It has a modular and
David Woodhouse 19d02a8
standard API that allows new ciphers, hashes and PRNGs to be added or removed
David Woodhouse 19d02a8
without change to the overall end application. It features easy to use functions
David Woodhouse 19d02a8
and a complete user manual which has many source snippet examples. 
df5f11d
df5f11d
%package        devel
df5f11d
Summary:        Development files for %{name}
26f205b
Requires:       %{name}%{?_isa} = %{version}-%{release}
df5f11d
df5f11d
%description    devel
df5f11d
The %{name}-devel package contains libraries and header files for
df5f11d
developing applications that use %{name}.
df5f11d
185b14e
%package        doc
185b14e
Summary:        Documentation files for %{name}
26f205b
BuildArch:      noarch
26f205b
Provides:       %{name}-doc = %{version}-%{release}
26f205b
Obsoletes:      %{name}-doc < 1.17-19
David Woodhouse 19d02a8
185b14e
185b14e
%description    doc
185b14e
The %{name}-doc package contains documentation for use with %{name}.
185b14e
df5f11d
%prep
df5f11d
%setup -q
9405af4
%patch0 -p1
9405af4
%patch1 -p1
9405af4
%patch2 -p1
21b73f1
%patch3 -p1
df5f11d
df5f11d
%build
28d3b3d
# No configure script ships with libtomcrypt. Its only requirement is ANSI C and
28d3b3d
# libtommath. Explicitly force it to be built against libtommath.
28d3b3d
export CFLAGS="$RPM_OPT_FLAGS -DLTM_DESC"
f9ac773
make %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile.shared 
Jaromir Capik 998026a
Jaromir Capik 998026a
# workaround only - ghostscript segfaults on ppc64le -> can't build docs
Jaromir Capik 998026a
%ifnarch ppc64le
Jaromir Capik 998026a
  DOCS="docs"
Jaromir Capik 998026a
%endif
Jaromir Capik 998026a
make %{?_smp_mflags} LIBPATH=%{_libdir} -f makefile $DOCS
df5f11d
df5f11d
%check
28d3b3d
export CFLAGS="$RPM_OPT_FLAGS -DLTM_DESC -DUSE_LTM"
df5f11d
make %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" test
df5f11d
./test
df5f11d
df5f11d
%install
df5f11d
# There is no configure script that ships with libtomcrypt but it does
26f205b
# understand DESTDIR and its installs via that and the INSTALL_USER and
26f205b
# INSTALL_GROUP environment variables.
df5f11d
export INSTALL_USER=$(id -un)
df5f11d
export INSTALL_GROUP=$(id -gn)
df5f11d
export CFLAGS="$RPM_OPT_FLAGS -DLTM_DESC -DUSE_LTM"
df5f11d
28d3b3d
make install DESTDIR=%{buildroot} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile.shared
237ab51
find %{buildroot} -name '*.h' -exec chmod 644 {} \;
237ab51
find %{buildroot} -name '*.c' -exec chmod 644 {} \;
26f205b
chmod 644 LICENSE
df5f11d
28d3b3d
# Remove unneeded files
26f205b
find %{buildroot} -name '*.la' -delete
26f205b
find %{buildroot} -name '*.a' -delete
26f205b
find %{buildroot} -name 'libtomcrypt_prof*' -delete
df5f11d
df5f11d
%post -p /sbin/ldconfig
df5f11d
df5f11d
%postun -p /sbin/ldconfig
df5f11d
df5f11d
%files
da98e9c
%license LICENSE
df5f11d
%{_libdir}/*.so.*
df5f11d
df5f11d
%files devel
28d3b3d
%{_includedir}/*.h
df5f11d
%{_libdir}/*.so
David Woodhouse 19d02a8
%{_libdir}/pkgconfig/libtomcrypt.pc
df5f11d
185b14e
%files doc
185b14e
%doc LICENSE doc/crypt.pdf
185b14e
df5f11d
%changelog
21b73f1
* Sun Jun 25 2017 Simone Caronni <negativo17@gmail.com> - 1.17-25
21b73f1
- Fix CVE-2016-6129 (#1370955, #1370957).
21b73f1
da98e9c
* Sun Jun 25 2017 Simone Caronni <negativo17@gmail.com> - 1.17-24
da98e9c
- Update URLs (#1463608, #1463547)
da98e9c
Jaromir Capik 998026a
* Tue Dec 08 2015 Jaromir Capik <jcapik@redhat.com> - 1.17-23
Jaromir Capik 998026a
- Workaround for ghostscript segfault on ppc64le
Jaromir Capik 998026a
9405af4
* Thu May 15 2014 Paul Howarth <paul@city-fan.org> - 1.17-22
9405af4
- Add two-key 3DES support, needed by pycrypto.
9405af4
28d3b3d
* Sun Sep 29 2013 Simone Caronni <negativo17@gmail.com> - 1.17-21
28d3b3d
- Move headers to default location.
28d3b3d
26f205b
* Thu Aug 08 2013 Simone Caronni <negativo17@gmail.com> - 1.17-20
26f205b
- Make doc package noarch.
26f205b
- Remove executable bits from LICENSE file and source files.
26f205b
- Require isaed library for devel subpackage.
26f205b
- Require CVE fixed libtommath library.
26f205b
5cf0168
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-19
5cf0168
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
5cf0168
253e6a3
* Thu Jun 06 2013 Simone Caronni <negativo17@gmail.com> - 1.17-18
253e6a3
- Fix build requirements for RHEL 6 and Fedora 17.
253e6a3
David Woodhouse ee6c659
* Tue Jun 04 2013 David Woodhouse <David.Woodhouse@intel.com> - 1.17-17
David Woodhouse ee6c659
- Fix tex/latex BuildRequires
David Woodhouse ee6c659
David Woodhouse 19d02a8
* Mon Jun 03 2013 Simone Caronni <negativo17@gmail.com> - 1.17-16
David Woodhouse 19d02a8
- Update SPEC, remove obsolete tags, fix formatting.
David Woodhouse 19d02a8
- Add patch for pkg config (libtomcrypt.pc).
David Woodhouse 19d02a8
- Add correct build requirements for Fedora 19+ and RHEL 7+.
David Woodhouse 19d02a8
04155bd
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-15
04155bd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
04155bd
7033a9d
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-14
7033a9d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
7033a9d
28002cb
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-13
28002cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
28002cb
ab28215
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-12
ab28215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
ab28215
8b8da9e
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-11
8b8da9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
8b8da9e
94cccdc
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-10
94cccdc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
94cccdc
9f3e4f9
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.17-9
9f3e4f9
- Autorebuild for GCC 4.3
9f3e4f9
185b14e
* Sun Nov 25 2007 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.17-8
185b14e
- Resolve multilib conflicts from Bug #342431 by splitting out 
185b14e
  documentation to libtomcrypt-docs subpackage
185b14e
- fix rpmlint Summary: warning
185b14e
9d92b2d
* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 1.17-7
9d92b2d
- Rebuild for selinux ppc32 issue.
9d92b2d
f9ac773
* Tue Jul 10 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 1.17-6
f9ac773
- turn off optimization for ppc64 to work around Bug #239003
f9ac773
df5f11d
* Sat Jun 30 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 1.17-5
df5f11d
- removed package name from summary
df5f11d
- fixed URL and Source0 links
df5f11d
- really fixed linkage flag this time, added it to the build section not
df5f11d
  just the check.
df5f11d
df5f11d
* Fri Jun 29 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 1.17-4
df5f11d
- fixed linkage flag with correct tommath name
df5f11d
- added check section
df5f11d
- removed libtomcrypt_prof libraries from package
df5f11d
- remove package name from summary
df5f11d
df5f11d
* Wed Jun 27 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 1.17-3
df5f11d
- create makefile patch to ensure RPM_OPT_FLAGS is honored
df5f11d
- install headers into _includedir/tomcrypt
df5f11d
- add location of libtommath headers to CFLAGS
df5f11d
df5f11d
* Sat Jun 23 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 1.17-2
df5f11d
- update build process to pass LIBPATH to make
df5f11d
df5f11d
* Fri Jun 22 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 1.17-1
df5f11d
- Initial spec file creation