# Need googletest for running testcases. Please look into it in the future updates. Summary: A fast compressor/decompressor library Name: snappy Version: 1.1.9 Release: 1 Group: Development/Libraries/C and C++ License: BSD URL: https://github.com/google/snappy Source0: https://github.com/google/snappy/releases/download/%{version}/%{name}-%{version}.tar.gz Source1: libsnappy.so.1.7.0-aix32 Source2: libsnappy.so.1.7.0-aix64 Source3: libsnappy.so.1.8.0-aix32 Source4: libsnappy.so.1.8.0-aix64 BuildRequires: cmake >= 3.22.0 BuildRequires: gcc-c++ >= 10-2 BuildRequires: coreutils #BuildRequires: gtest-devel Requires: libgcc >= 10.3.0 Requires: libstdc++ >= 10.3.0 Patch0: snappy-1.1.9-static-fct_inline.patch %description Snappy is a compression/decompression library. It does not aim for maximum compression, or compatibility with any other compression library; instead, it aims for very high speeds and reasonable compression. For instance, compared to the fastest mode of zlib, Snappy is an order of magnitude faster for most inputs, but the resulting compressed files are anywhere from 20% to 100% bigger. %package devel Summary: Development files for snappy Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %setup %patch0 -p1 -b .static rm -rf /tmp/%{name}-%{version}-32bit mkdir /tmp/%{name}-%{version}-32bit mv * /tmp/%{name}-%{version}-32bit mkdir 32bit mv /tmp/%{name}-%{version}-32bit/* 32bit rm -rf /tmp/%{name}-%{version}-32bit mkdir 64bit cp -rp 32bit/* 64bit/ %build # 64 bit cd 64bit export CC="gcc -maix64 -O2" export CXX="g++ -maix64 -O2" export OBJECT_MODE=64 # -blibpath ignored by cmake. Need to check how we can make cmake accept it. export LDFLAGS="-L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib" mkdir build cd build cmake -DBUILD_SHARED_LIBS=ON -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF -DCMAKE_INSTALL_PREFIX=/opt/freeware -DCMAKE_CXX_STANDARD=14 .. gmake # 32bit cd ../../32bit export CC="gcc -maix32 -D_LARGE_FILES -O2" export CXX="g++ -maix32 -D_LARGE_FILES -O2" export OBJECT_MODE=32 mkdir build cd build cmake -DBUILD_SHARED_LIBS=ON -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF -DCMAKE_INSTALL_PREFIX=/opt/freeware -DCMAKE_CXX_STANDARD=14 .. gmake # Create pkgconfig file for snappy as it is not coming with the package itself. cat << EOF >snappy.pc prefix=%{_prefix} exec_prefix=%{_exec_prefix} includedir=%{_includedir} libdir=%{_libdir} Name: %{name} Description: A fast compression/decompression library Version: %{version} Cflags: -I\${includedir} Libs: -L\${libdir} -lsnappy EOF %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 32bit/build gmake install DESTDIR=${RPM_BUILD_ROOT} /opt/freeware/bin/install -m644 -D snappy.pc ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/snappy.pc ( cd ${RPM_BUILD_ROOT}%{_libdir} /usr/bin/ar -x libsnappy.a ) cd ../../64bit/build gmake install DESTDIR=${RPM_BUILD_ROOT} /usr/bin/ar -q $RPM_BUILD_ROOT%{_libdir}/libsnappy.a $RPM_BUILD_ROOT%{_libdir}/libsnappy.so.1 cd ../.. # Add the older version shared members for compatibility with older apps # (make sure they're set for LOADONLY with 'strip -e') #32-bit cp %{SOURCE1} libsnappy.so.1.7.0 /usr/bin/strip -X32 -e libsnappy.so.1.7.0 /usr/bin/ar -X32 -q $RPM_BUILD_ROOT%{_libdir}/libsnappy.a libsnappy.so.1.7.0 cp %{SOURCE3} libsnappy.so.1.8.0 /usr/bin/strip -X32 -e libsnappy.so.1.8.0 /usr/bin/ar -X32 -q $RPM_BUILD_ROOT%{_libdir}/libsnappy.a libsnappy.so.1.8.0 #64-bit cp %{SOURCE2} libsnappy.so.1.7.0 /usr/bin/strip -X64 -e libsnappy.so.1.7.0 /usr/bin/ar -X64 -q $RPM_BUILD_ROOT%{_libdir}/libsnappy.a libsnappy.so.1.7.0 cp %{SOURCE4} libsnappy.so.1.8.0 /usr/bin/strip -X64 -e libsnappy.so.1.8.0 /usr/bin/ar -X64 -q $RPM_BUILD_ROOT%{_libdir}/libsnappy.a libsnappy.so.1.8.0 %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %{_libdir}/libsnappy.a %doc 32bit/AUTHORS 32bit/COPYING 32bit/NEWS 32bit/README.md %files devel %defattr(-,root,system,-) %{_includedir}/snappy-c.h %{_includedir}/snappy-sinksource.h %{_includedir}/snappy-stubs-public.h %{_includedir}/snappy.h %{_libdir}/pkgconfig/snappy.pc %changelog * Wed Jun 21 2023 Ayappan - 1.1.9-1 - Update to version 1.1.9 - Fix license and other things in the spec file * Fri Nov 20 2020 Megha Khedekar - 1.1.8-1 - Update to version - 1.1.8-1 - No longer shipping files from /usr directory * Thu Sep 05 2019 Harshita Jain - 1.1.7-1 - Update to latest version - 1.1.7-1 * Tue Aug 14 2018 Ravi Hirekurabar - 1.1.3-2 - Rebuilt adding Requires: libgcc >= 6.3.0 - Added Requires: libstdc++ >= 6.3.0 * Wed May 09 2018 Ravi Hirekurabar - 1.1.3-1 - Initial Port to AIX - Built with gcc and added -blibpath