%{!?dotests: %define dotests 1} %define name python3-pyspnego %define srcname pyspnego %define version 0.3.1 %define release 1 %define is_python %(test -e /opt/freeware/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 /opt/freeware/bin/python3 && 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 Summary : Windows Negotiate Authentication Client and Server Name : %{name} Version : %{version} Release : %{release} Source0 : %{srcname}-%{version}.tar.gz Url : https://github.com/jborean93/pyspnego License : MIT Group : Development/Libraries BuildArch: noarch BuildRequires: python3 >= 3.7.11 BuildRequires: python3-devel >= 3.7.11 #for running testcases BuildRequires: python3-cryptography >= 3.2.1 Requires: python3 >= 3.7.11 Requires: python3-cryptography >= 3.2.1 %description Library to handle SPNEGO (Negotiate, NTLM, Kerberos) and CredSSP authentication. Also includes a packet parser that can be used to decode raw NTLM/SPNEGO/Kerberos tokens into a human readable format. %prep %setup -q -n %{srcname}-%{version} %build export OBJECT_MODE=64 python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %check if [ "%{dotests}" == 1 ];then #Some of the testcases fails as en_US.UTF-8 locale is not present in AIX 6.1 python3 -m venv --system-site-packages python_venv . ./python_venv/bin/activate pip3 install pytest-mock export CRYPTOGRAPHY_ALLOW_OPENSSL_102=1 PYTHONPATH=%{buildroot}/%{python_sitelib} py.test-3 tests/ || true deactivate fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %license LICENSE %doc README.md CHANGELOG.md %{python_sitelib}/* %{_bindir}/* %changelog * Thu Jan 27 2022 Reshma V Kumar - 0.3.1 - Initial port for AIX Toolbox