# License: MIT # http://opensource.org/licenses/MIT # # Please preserve changelog entries # %global libname libsodium %global soname 23 Name: libsodium Version: 1.0.18 Release: 1 Summary: The Sodium crypto library License: ISC URL: http://libsodium.org/ Source0: http://download.libsodium.org/libsodium/releases/%{name}-%{version}.tar.gz BuildRequires: gcc # manage update from 3rd party repository Obsoletes: %{libname}%{soname} <= %{version} %description Sodium is a new, easy-to-use software library for encryption, decryption, signatures, password hashing and more. It is a portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API, and an extended API to improve usability even further. Its goal is to provide all of the core operations needed to build higher-level cryptographic tools. The design choices emphasize security, and "magic constants" have clear rationales. The same cannot be said of NIST curves, where the specific origins of certain constants are not described by the standards. And despite the emphasis on higher security, primitives are faster across-the-board than most implementations of the NIST standards. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Obsoletes: %{libname}%{soname}-devel <= %{version} %description devel This package contains libraries and header files for developing applications that use %{name} libraries. %prep %setup -q 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 export CC=/opt/freeware/bin/gcc # build on 64bit mode cd 64bit export OBJECT_MODE=64 export CFLAGS="-O2 -maix64" export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" %configure \ --libdir=%{_libdir}64 \ --disable-silent-rules \ --disable-opt gmake gmake -k check #build for 32bit cd ../32bit export OBJECT_MODE=32 export CFLAGS="-O2 -maix32 -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" %configure \ --libdir=%{_libdir} \ --disable-silent-rules \ --disable-opt gmake gmake -k check %install #install in 64bit export OBJECT_MODE=64 cd 64bit %make_install rm -f %{buildroot}%{_libdir}64/%{libname}.la cp ./src/libsodium/.libs/libsodium.so.23 /var/tmp/libsodium-1.0.18-1.ppc/opt/freeware/lib64/ #install in 32 bit export OBJECT_MODE=32 cd ../32bit %make_install rm -f %{buildroot}%{_libdir}/%{libname}.la cp ./src/libsodium/.libs/libsodium.so.23 /var/tmp/libsodium-1.0.18-1.ppc/opt/freeware/lib/ # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a ${RPM_BUILD_ROOT}/opt/freeware/lib64/%{name}.so.23 %files %license 32bit/LICENSE %{_libdir}/libsodium.a %{_libdir}64/libsodium.a %files devel %doc 32bit/AUTHORS 32bit/ChangeLog 32bit/README.markdown 32bit/THANKS %doc 32bit/test/default/*.c 32bit/test/default/*.exp 32bit/test/default/*.h %doc 32bit/test/quirks/quirks.h %{_includedir}/sodium.h %{_includedir}/sodium/ %{_libdir}/pkgconfig/%{libname}.pc %{_libdir}64/pkgconfig/%{libname}.pc %changelog * Wed Jul 31 2019 Baanu Tumma -1.0.18-1 - Initial port to AIX Toolbox