# # spec file for package python-fabric # # 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 %{!?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)")} %define mod_name fabric Name: python-%{mod_name} Version: 1.0.1 Release: 0 Url: http://fabfile.org Summary: Fabric is a simple, Pythonic tool for remote execution and deployment License: GPL Group: Development/Languages/Python Source: Fabric-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-devel BuildRequires: python-setuptools Requires: python-paramiko >= 1.7.6 Requires: python-setuptools %if 0%{?suse_version} %py_requires %if 0%{?suse_version} > 1110 BuildArch: noarch %endif %endif %description Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. It provides a basic suite of operations for executing local or remote shell commands (normally or via ``sudo``) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution. Typical use involves creating a Python module containing one or more functions, then executing them via the ``fab`` command-line tool. Below is a small but complete "fabfile" containing a single task:: from fabric.api import run def host_type(): run('uname -s') Once a task is defined, it may be run on one or more servers, like so:: $ fab -H localhost,linuxbox host_type [localhost] run: uname -s [localhost] out: Darwin [linuxbox] run: uname -s [linuxbox] out: Linux Done. Disconnecting from localhost... done. Disconnecting from linuxbox... done. In addition to use via the ``fab`` tool, Fabric's components may be imported into other Python code, providing a Pythonic interface to the SSH protocol suite at a higher level than that provided by e.g. Paramiko (which Fabric itself leverages.) %prep %setup -q -n Fabric-%{version} %build export CFLAGS="%{optflags}" python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) # You may have to add additional files here (documentation and binaries mostly) %{_bindir}/fab %python_sitelib/%{mod_name}* %python_sitelib/*.egg-info %doc README %changelog