Name: libtomcrypt Version: 1.18.2 Release: 1 Summary: A comprehensive, portable cryptographic toolkit Group: System Environment/Libraries License: Public Domain URL: https://github.com/libtom/libtomcrypt Source0: https://github.com/libtom/libtomcrypt/archive/%{name}-%{version}.tar.gz Source1: crypt-%{version}.pdf Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: coreutils, libtommath-devel >= 1.0.1-1, gcc >= 4.5.4-1 Requires: libtommath >= 1.0.1-1 %description A comprehensive, modular and portable cryptographic toolkit that provides developers with a vast array of well known published block ciphers, one-way hash functions, chaining modes, pseudo-random number generators, public key cryptography and a plethora of other routines. Designed from the ground up to be very simple to use. It has a modular and standard API that allows new ciphers, hashes and PRNGs to be added or removed without change to the overall end application. It features easy to use functions and a complete user manual which has many source snippet examples. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "cc_r -q64" or "gcc -maix64". %package doc Summary: Documentation files for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} %description doc The %{name}-doc package contains documentation for use with %{name}. %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CFLAGS="-O3 -DLTM_DESC -DUSE_LTM -I%{_includedir}/tommath" # ------------------- 64-bits start ------------------ # first build the 64-bit version cd 64bit export OBJECT_MODE=64 export CC="gcc -maix64" gmake %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile # create shared object CreateExportList -X64 %{name}.exp %{name}.a ${CC} -shared %{name}.a -o shr64.o -Wl,-bE:%{name}.exp -Wl,-bernotok -L%{_libdir} -ltommath rm -f %{name}.exp # ------------------- 64-bits end ------------------ # ------------------- 32-bits start ------------------ # now build the 32-bit version cd ../32bit export OBJECT_MODE=32 export CC="gcc -maix32" gmake %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile # create shared object CreateExportList -X32 %{name}.exp %{name}.a ${CC} -shared %{name}.a -o shr32.o -Wl,-bE:%{name}.exp -Wl,-bernotok -L%{_libdir} -ltommath rm -f %{name}.exp # ------------------- 32-bits end ------------------ # now create the AIX-style shared library rm -f %{name}.a /usr/bin/ar -X32 -rv %{name}.a shr32.o /usr/bin/ar -X64 -q %{name}.a ../64bit/shr64.o %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export PATH=/opt/freeware/bin:$PATH cd 32bit cp %{SOURCE1} . gmake install NODOCS=1 INCPATH=%{_includedir}/tomcrypt DESTDIR=${RPM_BUILD_ROOT} LIBPATH=%{_libdir} -f makefile find ${RPM_BUILD_ROOT} -name '*.h' -exec chmod 644 {} ';' # remove unneeded files find ${RPM_BUILD_ROOT} -name 'libtomcrypt_prof*' -exec rm -f {} ';' ( cd ${RPM_BUILD_ROOT} for dir in include lib do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/LICENSE %{_libdir}/*.a /usr/lib/*.a %files devel %defattr(-,root,system,-) %doc 32bit/LICENSE %{_includedir}/* /usr/include/* %files doc %defattr(-,root,system,-) %doc 32bit/LICENSE 32bit/crypt-%{version}.pdf %changelog * Wed Jul 18 2018 Michael Perzl - 1.18.2-1 - updated to version 1.18.2 * Wed Jul 18 2018 Michael Perzl - 1.18.1-1 - updated to version 1.18.1 * Wed Jul 18 2018 Michael Perzl - 1.18.0-1 - updated to version 1.18.0 * Tue Feb 22 2011 Michael Perzl - 1.17-1 - first version for AIX V5.1 and higher