%define dotests 1 # spec file for package snappy # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: snappy Version: 1.1.3 Release: 2 License: MIT Group: Development/Libraries/C and C++ BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://code.google.com/p/snappy/ Source: snappy-%{version}.tar.gz BuildRequires: gcc-c++ zlib-devel lzo-devel Requires: libgcc >= 6.3.0 Requires: libstdc++ >= 6.3.0 #Source100: snappy-%{version}-%{release}.build.log Patch: snappy-%{version}-static-fct.patch %ifos aix6.1 %define buildhost powerpc-ibm-aix6.1.0.0 %define osplat aix6 %define _libdir64 %{_prefix}/lib64 %endif # Summary: A fast compressor/decompressor library %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. On a single core of a Core i7 processor in 64-bit mode, Snappy compresses at about 250 MB/sec or more and decompresses at about 500 MB/sec or more. This package holds the shared library of snappy. %package devel License: MIT Group: Development/Libraries/C and C++ Requires: %{name} = %{version} # Summary: Development files for snappy %description devel 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. On a single core of a Core i7 processor in 64-bit mode, Snappy compresses at about 250 MB/sec or more and decompresses at about 500 MB/sec or more. This package holds the development files for snappy. %prep export PATH=/opt/freeware/bin:/usr/bin:/bin %setup %patch0 -p1 -b .static %build export CONFIG_SHELL=/usr/bin/sh export CONFIG_ENV_ARGS=/usr/bin/sh export RM="/usr/bin/rm -f" export AR="ar -X32_64" export NM="nm -X32_64" # 64 bit export CC="gcc -maix64" export CXX="g++ -maix64" $CC --version export OBJECT_MODE=64 export CFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export CXXFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export CPPFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export LDFLAGS="-L`pwd` -L`pwd`/.libs -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-brtl" %configure\ --prefix=%{_prefix} \ --with-pic \ --disable-static \ --host=%{buildhost} \ --target=%{buildhost} \ --build=%{buildhost} gmake %{?_smp_flags} if [ "%{dotests}" == 1 ] then ( gmake -k check || true ) /usr/sbin/slibclean fi mkdir .libs64 cp -P .libs/*so* .libs64 gmake distclean export CC="gcc -maix32 -D_LARGE_FILES" export CXX="g++ -maix32 -D_LARGE_FILES" export OBJECT_MODE=32 export CFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export CPPFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export LDFLAGS="-L`pwd` -L`pwd`/.libs -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000 -Wl,-brtl" %configure\ --prefix=%{_prefix} \ --with-pic \ --disable-static \ --host=%{buildhost} \ --target=%{buildhost} \ --build=%{buildhost} gmake %{?_smp_flags} # create .a with the 64-bit shared objects and the 32-bit shared objects ${AR} -q .libs/libsnappy.a .libs/libsnappy.so.1.3.0 .libs64/libsnappy.so.1.3.0 if [ "%{dotests}" == 1 ] then ( gmake check || true ) /usr/sbin/slibclean fi %install rm -rf %{buildroot} export CONFIG_SHELL=/usr/bin/ksh export CONFIG_ENV_ARGS=/usr/bin/ksh %makeinstall /opt/freeware/bin/find %{buildroot} -name \*.la -delete -print cp %{_prefix}/src/packages/BUILD/%{name}-%{version}/.libs/*.a $RPM_BUILD_ROOT/%{_prefix}/lib mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib64 cp -P %{_prefix}/src/packages/BUILD/%{name}-%{version}/.libs64/* $RPM_BUILD_ROOT/%{_prefix}/lib64 cd $RPM_BUILD_ROOT/%{_prefix}/lib64 %{__ln_s} ../lib/*.a . cd - mkdir -p $RPM_BUILD_ROOT/usr/lib cd $RPM_BUILD_ROOT/usr/lib %{__ln_s} ../../opt/freeware/lib/libsnappy* . cd - mkdir -p $RPM_BUILD_ROOT/usr/lib64 cd $RPM_BUILD_ROOT/usr/lib64 %{__ln_s} ../../opt/freeware/lib64/libsnappy* . cd - %clean rm -rf %{buildroot} %files %define _libdir64 /opt/freeware/lib64 %defattr(-,root,root,-) %{_libdir}/libsnappy.a %{_libdir}/libsnappy.so* %{_libdir64}/libsnappy.a %{_libdir64}/libsnappy.so* /usr/lib/libsnappy.a /usr/lib/libsnappy.so* /usr/lib64/libsnappy.a /usr/lib64/libsnappy.so* %doc AUTHORS COPYING NEWS README %files devel %defattr(-,root,root,-) %{_includedir}/snappy-c.h %{_includedir}/snappy-sinksource.h %{_includedir}/snappy-stubs-public.h %{_includedir}/snappy.h %changelog * 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