%define name python3-msgpack %define srcname msgpack %define version 0.6.2 %define release 1 # Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %global dotests 1} # To use XLC : --define 'gcc_compiler=0' %{!?gcc_compiler: %global gcc_compiler 1} %{!?default_bits: %global default_bits 32} %define is_python %(test -e /opt/freeware/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(/opt/freeware/bin/python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /opt/freeware/bin/python3_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Name: %{name} Version: %{version} Release: %{release} Summary: A Python MessagePack (de)serializer Group: Applications/System License: ASL 2.0 #URL: https://pypi.python.org/pypi/msgpack-python/ URL: https://files.pythonhosted.org/packages/74/0a/de673c1c987f5779b65ef69052331ec0b0ebd22958bda77a8284be831964/msgpack-0.6.2.tar.gz Source0: %{srcname}-%{version}.tar.gz # RPM 3.0.5 does not recognize or initialise %{buildroot} without following BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildRequires: python3-devel >= 3.7.4 BuildRequires: python3-pytest >= 5.3.1 %description MessagePack is a fast, compact binary serialization format, suitable for data similar to JSON. This package provides CPython bindings for reading and writing MessagePack data. %if %{gcc_compiler} == 1 This version has been compiled with GCC. %else This version has been compiled with XLC. %endif # %package -n python3-%{srcname} # Summary: A Python MessagePack (de)serializer # Group: Applications/System # Provides: python3-%{srcname} # %description -n python3-%{srcname} # MessagePack is a fast, compact binary serialization format, suitable # for data similar to JSON. # This package provides CPython bindings for reading and writing #MessagePack data. # This is a Python python3 (de)serializer for MessagePack. %prep %setup -q -n %{srcname}-%{version} echo "dotests=%{dotests}" echo "default_bits=%{default_bits}" echo "gcc_compiler="%{gcc_compiler}"" if [ "%{gcc_compiler}" == 1 ] then echo "GCC version=`/opt/freeware/bin/gcc --version | head -1`" fi %build #Choose XLC or GCC if [ %{gcc_compiler} == 1 ] then export NM="/opt/freeware/bin/nm" export CC__="/opt/freeware/bin/gcc" export LDFLAGS="-L./.libs -L/opt/freeware/lib" echo "CC Version:" $CC__ --version export FLAG64="-maix64" else export NM="/usr/bin/nm -X32_64" export CC__="xlc_r" export FLAG64="-q64" echo "CC Version:" $CC__ -qversion fi type $CC__ export CC64=" ${CC__} ${FLAG64} -D_LARGE_FILES" export LDFLAGS="-Wl" export OBJECT_MODE=64 export CC="${CC64} $GLOBAL_CC_OPTIONS" python3 setup.py build # %py3_build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} # %check is not recogized by RPM 3.0.5 #%check # py.test and py.test-%{python_version} are delivered in python-pytest # py.test-3 and py.test-%{python3_version} are delivered in python3-pytest if [ "%{dotests}" == 1 ] then export PYTHONPATH=$(pwd) (py.test -v test || true) fi # %py3_install %files -n %{name} %doc README.rst #%license is not recogized by RPM 3.0.5 %license COPYING %doc COPYING %{python_sitelib64}/* %changelog * Thu Jan 23 2020 Ashwini Chandrappa - 0.6.2 -Built with python3 and updated to latest version * Wed Sep 20 2017 Ravi Hirekurabar - 0.4.8 -1 - Built with bmaxdata not set for 64 bit compilation * Fri May 19 2017 Michael Wilson - 0.4.8-1 - Initial version 0.4.8