# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define name python3-pyasn1 %define srcname pyasn1 %define version 0.4.8 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(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 /usr/bin/python3_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3_64 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif Summary: ASN.1 types and codecs Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz License: BSD Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: Ilya Etingof Url: http://sourceforge.net/projects/pyasn1/ BuildRequires: python3 >= 3.7.4-1 , python3-devel >= 3.7.4-1 Requires: python3 >= 3.7.4-1 %description A pure-Python implementation of ASN.1 types and DER/BER/CER codecs (X.208). %prep %setup -q -n %{srcname}-%{version} %build python3_64 setup.py build if [ "%{dotests}" == 1 ] then python3 setup.py test fi %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3_64 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc CHANGES.* LICENSE.* PKG-INFO README.* TODO.* %{python_sitelib}/* %changelog * Fri Jan 17 2020 Rishita Saha - 0.4.8-1 - update to the latest version * Tue May 9 2017 Ravi Hirekurabar - 0.2.3-1 - first version for AIX V6.1 and higher