# Tests by default. No tests: rpmbuild -ba --define 'dotests 0' lz4*.spec %{!?dotests: %define dotests 1} Name: lz4 Version: 1.9.3 Release: 1 Summary: Extremely fast compression algorithm Group: System Environment/Libraries License: GPLv2+ and BSD URL: https://lz4.github.io/lz4/ Source0: https://github.com/Cyan4973/lz4/archive/v%{version}/%{name}-%{version}.tar.gz Source1: create_exp_file.sh Patch0: lz4-1.9.2-Makefile-aix.patch BuildRequires: make Requires: libgcc >= 8.3.0 %define _libdir64 %{_prefix}/lib64 %description LZ4 is an extremely fast loss-less compression algorithm, providing compression speed at 400 MB/s per core, scalable with multi-core CPU. It also features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for lz4 Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} %description devel This package contains the header(.h) and library(.so) files required to build applications using liblz4 library. 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". %prep %setup -q %patch0 # Copy the export file creation script inside lib directory /usr/bin/cp %{SOURCE1} ./lib /usr/bin/rm -rf /tmp/%{name}-%{version}-32bit /usr/bin/cp -pr . /tmp/%{name}-%{version}-32bit /usr/bin/rm -fr * /usr/bin/mv /tmp/%{name}-%{version}-32bit 32bit /usr/bin/cp -pr 32bit 64bit %build # There is no need to export -O2/-O3 in CFLAGS since it is already taken care by Makefile cd 32bit export CC="gcc -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" gmake if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi cd ../64bit export CC="gcc -maix64" export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" gmake if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 32bit gmake install DESTDIR=${RPM_BUILD_ROOT} PREFIX=%{_prefix} LIBDIR=%{_libdir} cd ../64bit export OBJECT_MODE=64 gmake install DESTDIR=${RPM_BUILD_ROOT} PREFIX=%{_prefix} LIBDIR=%{_libdir64} # Add 64 bit library in /opt/freeware/lib/liblz4.a archive as well /usr/bin/ar -q ${RPM_BUILD_ROOT}%{_libdir}/lib%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}.so.1 /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc 32bit/programs/COPYING 32bit/lib/LICENSE 32bit/NEWS %{_bindir}/* %{_datadir}/man/man1/* %{_libdir}/*.a %{_libdir64}/*.a %files devel %defattr(-,root,system) %{_includedir}/* %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc %changelog * Fri Jun 03 2022 Reshma V Kumar - 1.9.3-1 - Update to latest version * Thu Oct 24 2019 Ayappan P - 1.9.2-1 - First port to AIX Toolbox * Wed Apr 17 2019 Tony Reix - 1.8.0-1 - Port for BullFreeware * Wed Nov 15 2017 Michael Perzl - 1.8.0-1 - updated to version 1.8.0 * Tue Jan 03 2017 Michael Perzl - 1.7.4.2-1 - updated to version 1.7.4.2 * Tue Dec 13 2016 Michael Perzl - 1.7.3-1 - first version for AIX V5.1 and higher