LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File python-robotframework.spec of Package python-robotframework (Project home:thomas-schraitle)

#
# spec file for package python-robotframework
#
# Copyright (c) 2014 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/

%define module robotframework

Name:           python-robotframework
Version:        2.8.6b1
Release:        0
License:        Apache-2.0
Summary:        A generic test automation framework
Url:            http://robotframework.org
Group:          Development/Languages/Python
Source:         https://pypi.python.org/packages/source/r/robotframework/robotframework-%{version}.tar.gz
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:  python-nose
Requires(post): update-alternatives
Requires(postun): update-alternatives
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
Robot Framework is a generic test automation framework for acceptance testing 
and acceptance test-driven development (ATDD).

It has easy-to-use tabular test data syntax and it utilizes the keyword-driven
testing approach. Its testing capabilities can be extended by test libraries
implemented either with Python or Java, and users can create new higher-level
keywords from existing ones using the same syntax that is used for creating
test cases.

Robot Framework is operating system and application independent. The core
framework is implemented using `Python <http://python.org>`__ and runs also on
`Jython <http://jython.org>`__ (JVM) and `IronPython <http://ironpython.net>`__
(.NET). The framework has a rich ecosystem around it consisting of various
generic test libraries and tools that are developed as separate projects.
For more information about Robot Framework and the ecosystem, see
http://robotframework.org.


%prep
%setup -q -n %{module}-%{version}
# Prepare correct script name:
mv src/bin/pybot src/bin/pybot-%{py_ver}
mv src/bin/rebot src/bin/rebot-%{py_ver}

# Add py_ver suffix to binary:
sed -i -r "s/(pybot|rebot)/\1-%{py_ver}/" setup.py

# Remove shebang line:
x=$(find src/robot/ -type f -name \*.py | xargs grep "^#\!/" | cut -d: -f1 | tr "\n" " " )
sed -i "1d" $x

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

# Create links
ln -s %{_bindir}/pybot-%{py_ver} %{buildroot}%{_bindir}/pybot
ln -s %{_bindir}/rebot-%{py_ver} %{buildroot}%{_bindir}/rebot

%pre
# Since /usr/bin/*bot became ghosted to be used with update-alternatives, we have to get rid
# of the old binary resulting from the non-update-alternativies-ified package:
[[ ! -L %{_bindir}/pybot ]] && rm -f %{_bindir}/pybot
[[ ! -L %{_bindir}/rebot ]] && rm -f %{_bindir}/rebot
exit 0

%post
update-alternatives --install %{_bindir}/pybot pybot %{_bindir}/pybot-%{py_ver} 20
update-alternatives --install %{_bindir}/rebot rebot %{_bindir}/rebot-%{py_ver} 20

%preun
if [ $1 -eq 0 ] ; then
    update-alternatives --remove pybot %{_bindir}/pybot-%{py_ver}
    update-alternatives --remove pybot %{_bindir}/rebot-%{py_ver}
fi


%check
# nosetests
exit 0


%files
%defattr(-,root,root,-)
%doc README.rst AUTHORS.txt LICENSE.txt
%{python_sitelib}/*
%if 0%{?suse_version} >= 1230
%ghost %{_bindir}/pybot
%ghost %{_bindir}/rebot
%endif
%{_bindir}/pybot-%{py_ver}
%{_bindir}/rebot-%{py_ver}


%changelog