%define dotests 1 Name: libgcrypt Version: 1.8.5 Release: 1 Source0: https://www.gnupg.org/ftp/gcrypt/libgcrypt//libgcrypt-%{version}.tar.bz2 Source1: ftp://ftp.gnupg.org/gcrypt/%{name}/%{name}-%{version}.tar.bz2.sig Source2: %{name}-%{version}-%{release}.build.log Source3: libgcrypt.so.11-aix32 Source4: libgcrypt.so.11-aix64 Patch0: %{name}-%{version}-aix.patch Group: System Environment/Libraries License: LGPL Summary: A general-purpose cryptography library. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: libgpg-error-devel pkg-config Requires: libgpg-error Requires: libgcc >= 6.3.0 %description Libgcrypt is a general purpose crypto library based on the code used in GNU Privacy Guard. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for the %{name} package. Group: Development/Libraries PreReq: /sbin/install-info Requires: info Requires: libgpg-error-devel Requires: %{name} = %{version}-%{release} %description devel Libgcrypt is a general purpose crypto library based on the code used in GNU Privacy Guard. This package contains files needed to develop applications using libgcrypt. 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 -q64" or "gcc -maix64". %prep %setup -q %patch0 rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -fr * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit %build # setup environment for 32-bit and 64-bit builds export AR="ar -X32_64" export NM="nm -X32_64" export RM="/usr/bin/rm -f" # first build the 64-bit version cd 64bit export OBJECT_MODE=64 export CC="gcc -maix64 -O2" export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir}64 \ --infodir=%{_infodir} \ --enable-shared --enable-static \ --disable-asm gmake %{?_smp_mflags} if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi cp src/.libs/%{name}.so.20 ../32bit/ #make distclean slibclean # now build the 32-bit version cd ../32bit export OBJECT_MODE=32 export CC="gcc -maix32 -O2 -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export GPG_ERROR_CONFIG="/opt/freeware/bin/gpg-error-config_32" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --infodir=%{_infodir} \ --enable-static --enable-shared \ --disable-asm gmake %{?_smp_mflags} if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi slibclean # add the 64-bit shared objects to the shared library containing already the # 32-bit shared objects ${AR} -q src/.libs/%{name}.a ./%{name}.so.20 %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} #Install 64bit version cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_64 done ) #Install 32bit version cd ../32bit make DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_32 ln -sf "$fic"_64 $fic done ) #libgcrypt 32bit cp %{SOURCE3} libgcrypt.so.11 /usr/bin/strip -X32 -e libgcrypt.so.11 /usr/bin/ar -X32 -q ${RPM_BUILD_ROOT}%{_libdir}/libgcrypt.a libgcrypt.so.11 #libgcrypt 64bit cp %{SOURCE4} libgcrypt.so.11 /usr/bin/strip -X64 -e libgcrypt.so.11 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/libgcrypt.a libgcrypt.so.11 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}64/libgcrypt.a libgcrypt.so.11 rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir gzip --best ${RPM_BUILD_ROOT}%{_infodir}/gcrypt.info ( cd ${RPM_BUILD_ROOT} for dir in bin include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %post devel /sbin/install-info %{_infodir}/gcrypt.info.gz %{_infodir}/dir %preun devel if [ $1 = 0 ]; then /sbin/install-info --delete %{_infodir}/gcrypt.info.gz %{_infodir}/dir fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %{_bindir}/dumpsexp* %{_bindir}/hmac256* %{_libdir}/*.a %{_libdir}64/*.a /usr/bin/dumpsexp* /usr/bin/hmac256* /usr/lib/*.a /usr/lib64/*.a %files devel %defattr(-,root,system) %{_bindir}/%{name}-config* %{_includedir}/* %{_datadir}/aclocal/* %{_infodir}/gcrypt.info* /usr/bin/%{name}-config* /usr/include/* %changelog * Tue Nov 26 2019 Reshma V Kumar -1.8.5-1 - Update to fix CVE-2019-13627 * Fri Jun 15 2018 Reshma V Kumar -1.8.2-1 - Updated to latest version * Fri Jan 19 2018 Reshma V Kumar -1.5.4-1 - Update to 1.5.4 * Thu Nov 09 2017 Tony Reix - 1.5.4-1 - port on AIX 6.1 * Fri Aug 15 2014 Michael Perzl - 1.5.4-1 - updated to version 1.5.4 * Sat Jul 27 2013 Michael Perzl - 1.5.3-1 - updated to version 1.5.3 * Fri May 03 2013 Michael Perzl - 1.5.2-1 - updated to version 1.5.2 * Fri Apr 05 2013 Michael Perzl - 1.5.1-1 - updated to version 1.5.1 * Sat Jul 30 2011 Michael Perzl - 1.5.0-1 - updated to version 1.5.0 * Thu Jul 22 2010 Michael Perzl - 1.4.6-1 - updated to version 1.4.6 * Tue Dec 22 2009 Michael Perzl - 1.4.5-1 - updated to version 1.4.5 * Tue Mar 10 2009 Michael Perzl - 1.4.4-1 - updated to version 1.4.4 * Thu Oct 23 2008 Michael Perzl - 1.4.3-1 - updated to version 1.4.3 * Fri May 16 2008 Michael Perzl - 1.4.1-1 - updated to version 1.4.1 * Fri Mar 28 2008 Michael Perzl - 1.4.0-2 - corrected some SPEC file errors * Fri Feb 22 2008 Michael Perzl - 1.4.0-1 - updated to version 1.4.0 * Thu Jan 03 2008 Michael Perzl - 1.2.4-2 - included both 32-bit and 64-bit shared objects * Fri Oct 05 2007 Michael Perzl - 1.2.4-1 - first version for AIX V5.1 and higher