# sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %global commit 31bcc48327c6e50908d1cdc208daf4cb0b799af3 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global checkout 20140726git%{shortcommit} Name: python-pywinrm Version: 0.0.2 Release: 2.%{checkout}%{?dist} Summary: Python library for Windows Remote Management License: MIT URL: http://github.com/diyan/pywinrm/ Source0: https://github.com/diyan/pywinrm/archive/%{commit}/pywinrm-%{commit}.tar.gz BuildArch: noarch BuildRequires: python-devel BuildRequires: python-setuptools Requires: python-isodate Requires: python-xmltodict Requires: pytest Requires: python-pytest-dov Requires: python-pytest-pep8 %description pywinrm is a Python client for Windows Remote Management (WinRM). This allows you to invoke commands on target Windows machines from any machine that can run Python. WinRM allows you to call native objects in Windows. This includes, running batch scripts or powershell scripts, fetching WMI variables, and more. %package -n python3-pywinrm Summary: Python3 library for Windows Remote Management BuildRequires: python3-devel BuildRequires: python3-setuptools Requires: python3-isodate Requires: python3-xmltodict Requires: python3-pytest Requires: python3-pytest-cov Requires: python3-pytest-pep8 %description -n python3-pywinrm pywinrm is a Python client for Windows Remote Management (WinRM). This allows you to invoke commands on target Windows machines from any machine that can run Python. WinRM allows you to call native objects in Windows. This includes, running batch scripts or powershell scripts, fetching WMI variables, and more. %prep %setup -qn pywinrm-%{commit} find . -empty -exec rm {} \; rm -rf %{py3dir} cp -a . %{py3dir} %build pushd %{py3dir} %{__python3} setup.py build popd %{__python2} setup.py build %install pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %{__python2} setup.py install -O1 --skip-build --root %{buildroot} %files %doc LICENSE README.md %{python2_sitelib}/winrm/* %{python2_sitelib}/pywinrm* %files -n python3-pywinrm %doc LICENSE README.md %{python3_sitelib}/winrm/* %{python3_sitelib}/pywinrm* %changelog * Sat Jul 26 2014 Pete Travis 0.0.2-2.20140726git31bcc48 - Add python3 subpackage - Use git snapshot instead of pypi shapshot; pypi did not have license or docs * Fri Jul 25 2014 Pete Travis 0.0.2-1.20140726git31bcc48 - Initial packaging