8ffd695
%if 0%{?rhel} >= 6 || 0%{?fedora} >= 18
47cfe9a
%bcond_without documentation
47cfe9a
%bcond_without testsuite
47cfe9a
%else
47cfe9a
%bcond_with documentation
47cfe9a
%bcond_with testsuite
47cfe9a
%endif
47cfe9a
2260bbd
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 18
2260bbd
%bcond_without python3
2260bbd
%else
2260bbd
%bcond_with python3
2260bbd
%endif
2260bbd
47cfe9a
%{?!__python2:%global __python2 %{__python}}
47cfe9a
%{?!python2_sitelib:%global python2_sitelib %{python_sitelib}}
47cfe9a
%global modname behave
47cfe9a
47cfe9a
Name:               python-%{modname}
6b2c4c1
Version:            1.2.5
Björn Esser c026277
Release:            5%{?dist}
47cfe9a
Summary:            Tools for the behavior-driven development, Python style
47cfe9a
47cfe9a
License:            BSD
47cfe9a
URL:                http://pypi.python.org/pypi/%{modname}
47cfe9a
Source0:            http://pypi.python.org/packages/source/b/%{modname}/%{modname}-%{version}.tar.gz
eec11f8
# Pending pull request in the upstream repository
eec11f8
# https://github.com/behave/behave/pull/86
43f5c7e
Patch0: HTML-Formatter.patch
354bf71
Patch1: html_formatter_no_set_codecs.patch
47cfe9a
BuildArch:          noarch
47cfe9a
d4b0c67
Requires:           python-setuptools
41ba823
BuildRequires:      python-parse
41ba823
BuildRequires:      python-setuptools
41ba823
BuildRequires:      python2-devel
74473fa
BuildRequires:      python-parse, python-parse_type
80285e6
Requires:           python-parse, python-parse_type
41ba823
2260bbd
%if %{with python3}
2260bbd
Requires:           python3-setuptools
2260bbd
BuildRequires:      python3-parse
2260bbd
BuildRequires:      python3-setuptools
2260bbd
BuildRequires:      python3-devel
2260bbd
BuildRequires:      python3-parse, python3-parse_type
2260bbd
Requires:           python3-parse, python3-parse_type
2260bbd
%endif
2260bbd
47cfe9a
%if %{with testsuite}
47cfe9a
BuildRequires:      python-mock
47cfe9a
BuildRequires:      python-nose
2260bbd
%if %{with python3}
2260bbd
BuildRequires:      python3-mock
2260bbd
BuildRequires:      python3-nose
2260bbd
%endif
47cfe9a
%endif
41ba823
47cfe9a
%{?el6:BuildRequires:      python-ordereddict}
41ba823
%{?el6:Requires:    python-ordereddict}
47cfe9a
%{?el6:BuildRequires:      python-argparse}
47cfe9a
%{?el6:Requires:    python-argparse}
41ba823
%{?el6:BuildRequires:    python-importlib}
41ba823
%{?el6:Requires:    python-importlib}
47cfe9a
47cfe9a
47cfe9a
%description
47cfe9a
Behavior-driven development (or BDD) is an agile software development
47cfe9a
technique that encourages collaboration between developers, QA and non-
47cfe9a
technical or business participants in a software project.
47cfe9a
47cfe9a
*%{modname}* uses tests written in a natural language style, backed up by
47cfe9a
Python code.
47cfe9a
2260bbd
%if %{with python3}
2260bbd
%package -n python3-behave
2260bbd
Summary:        Easily build and distribute Python 3 packages
2260bbd
Group:          Applications/System
2260bbd
2260bbd
%description -n python3-behave
2260bbd
Behavior-driven development (or BDD) is an agile software development
2260bbd
technique that encourages collaboration between developers, QA and non-
2260bbd
technical or business participants in a software project.
2260bbd
2260bbd
*%{modname}* uses tests written in a natural language style, backed up
2260bbd
by Python code.
2260bbd
%endif
47cfe9a
47cfe9a
%if %{with documentation}
47cfe9a
%package doc
47cfe9a
Summary:            Documentation for %{name}
47cfe9a
47cfe9a
%{?!el6:BuildRequires:      python-sphinx}
47cfe9a
%{?el6:BuildRequires:      python-sphinx10}
47cfe9a
BuildRequires:      help2man
47cfe9a
BuildRequires:      python-sphinxcontrib-cheeseshop
47cfe9a
47cfe9a
%description doc
47cfe9a
Behavior-driven development (or BDD) is an agile software development
47cfe9a
technique that encourages collaboration between developers, QA and non-
47cfe9a
technical or business participants in a software project.
47cfe9a
47cfe9a
*%{modname}* uses tests written in a natural language style, backed up by
47cfe9a
Python code.
47cfe9a
47cfe9a
This package contains documentation in reST and HTML formats and some
47cfe9a
brief feature-examples.
47cfe9a
%endif
47cfe9a
47cfe9a
47cfe9a
%prep
47cfe9a
%setup -q -n %{modname}-%{version}
eec11f8
%patch0 -p1 -b .HTMLformatter
354bf71
%patch1 -p1 -b .html_no_codecs
47cfe9a
47cfe9a
# Remove bundled egg-info in case it exists
47cfe9a
rm -rf %{modname}*.egg-info
47cfe9a
47cfe9a
%if %{with documentation}
47cfe9a
# Copy reST-files into a seperate dir
47cfe9a
mkdir -p reST
47cfe9a
cp -a docs/*.rst reST
47cfe9a
47cfe9a
# Fix setting for python-sphinx10 on el6
47cfe9a
%{?el6:sed -i -e 's!sphinx-build!sphinx-1.0-build!g' docs/Makefile}
47cfe9a
%endif
47cfe9a
2260bbd
%if 0%{?with_python3}
2260bbd
mkdir -p %{py3dir}
2260bbd
cp -r . %{py3dir}
2260bbd
%endif # with_python3
47cfe9a
47cfe9a
%build
47cfe9a
%{__python2} setup.py build
47cfe9a
47cfe9a
%if %{with documentation}
47cfe9a
# Build the autodocs
47cfe9a
make html -C docs
47cfe9a
47cfe9a
rm -rf build/docs/html/.buildinfo
47cfe9a
mv build/docs/html .
47cfe9a
%endif
47cfe9a
2260bbd
%if 0%{?with_python3}
2260bbd
pushd %{py3dir}
2260bbd
%{__python3} setup.py build
2260bbd
popd
2260bbd
%endif # with_python3
47cfe9a
47cfe9a
%install
2260bbd
# Must do the python3 install first because the scripts in /usr/bin are
2260bbd
# overwritten with every setup.py install (and we want the python2 version
2260bbd
# to be the default for now).
2260bbd
%if 0%{?with_python3}
2260bbd
pushd %{py3dir}
2260bbd
%{__python3} setup.py install --skip-build --root %{buildroot}
2260bbd
2260bbd
#rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
2260bbd
#
2260bbd
#find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
2260bbd
#chmod +x %{buildroot}%{python3_sitelib}/setuptools/command/easy_install.py
2260bbd
popd
2260bbd
%endif # with_python3
2260bbd
47cfe9a
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
47cfe9a
47cfe9a
47cfe9a
%if %{with documentation}
47cfe9a
# Generate a manpage. Doesn't work on el6.
47cfe9a
PYTHONPATH=%{buildroot}%{python2_sitelib}/%{modname}*.egg-info \
47cfe9a
%{?!el6:help2man --no-info --name="Run a number of feature tests with behave." \
47cfe9a
    --output=%{modname}.1 --no-discard-stderr \
47cfe9a
    %{buildroot}%{_bindir}/%{modname}}
47cfe9a
47cfe9a
# Install the manpage.
47cfe9a
%{?!el6:install -d %{buildroot}%{_mandir}/man1}
47cfe9a
%{?!el6:install -p -m 0644 %{modname}.1 %{buildroot}%{_mandir}/man1/}
47cfe9a
%endif
47cfe9a
47cfe9a
47cfe9a
%check
47cfe9a
%if %{with testsuite}
2260bbd
%if 0%{?with_python3}
2260bbd
pushd %{py3dir}
2260bbd
nosetests -v
2260bbd
popd
2260bbd
%endif # with_python3
47cfe9a
nosetests -v
47cfe9a
%endif
47cfe9a
47cfe9a
47cfe9a
%files
47cfe9a
%doc README.rst LICENSE
47cfe9a
%{_bindir}/%{modname}
47cfe9a
%if %{with documentation}
47cfe9a
%{?!el6:%{_mandir}/man1/%{modname}.*}
47cfe9a
%endif
47cfe9a
%{python2_sitelib}/*
47cfe9a
47cfe9a
%if %{with documentation}
47cfe9a
%files doc
47cfe9a
%doc README.rst LICENSE html reST
47cfe9a
%endif
47cfe9a
2260bbd
%if 0%{?with_python3}
2260bbd
%files -n python3-behave
2260bbd
%doc README.rst LICENSE
2260bbd
%{python3_sitelib}/*
Björn Esser c026277
#{_bindir}/easy_install-3.*
2260bbd
%endif # with_python3
2260bbd
47cfe9a
47cfe9a
%changelog
Björn Esser c026277
* Sun Nov 15 2015 Björn Esser <besser82@fedoraproject.org> - 1.2.5-5
Björn Esser c026277
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
Björn Esser c026277
2260bbd
* Tue Nov 03 2015 Matěj Cepl <mcepl@redhat.com> - 1.2.5-3
2260bbd
- Build also python3 packages (fix #1276923).
2260bbd
e203179
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.5-3
e203179
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e203179
354bf71
* Thu May 21 2015 Matej Cepl <mcepl@redhat.com> - 1.2.5-2
354bf71
- Add a patch for embeding video in HTML formatted report
354bf71
fac49e8
* Wed Apr 29 2015 Matej Cepl <mcepl@redhat.com> - 1.2.5-1
fac49e8
- Upgrade to the latest release (fix #1214767)
fac49e8
5c43853
* Fri Sep 12 2014 Matěj Cepl <mcepl@redhat.com> - 1.2.4-4
92eb485
- Add another patch to fix an Unicode error (thanks for vbenes for
92eb485
  fixing my earlier proposal).
92eb485
8ffd695
* Thu Jul 17 2014 Matěj Cepl <mcepl@redhat.com> - 1.2.4-2
8ffd695
- Build documentation even on EPEL-7.
8ffd695
87540f9
* Thu Jun 19 2014 Matěj Cepl <mcepl@redhat.com> - 1.2.4-1
87540f9
- New upstream release
87540f9
fe198d5
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-14
fe198d5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
fe198d5
41ba823
* Fri May 09 2014 Matěj Cepl <mcepl@redhat.com> - 1.2.3-13
41ba823
- Remove bundled compatibility libraries and add Requires
41ba823
  (fix #1096220).
41ba823
d4b0c67
* Mon Apr 07 2014 Matěj Cepl <mcepl@redhat.com> - 1.2.3-12
d4b0c67
- Add python-setuptools dependency (fix #1084996)
d4b0c67
7debe22
* Wed Mar 19 2014 Matěj Cepl <mcepl@redhat.com> - 1.2.3-11
7debe22
- Another fix for RHBZ# 1067388 by Vadim Rutkovsky
7debe22
54c18ef
* Wed Mar 12 2014 Matěj Cepl <mcepl@redhat.com> - 1.2.3-10
54c18ef
- Fix Patch 1
54c18ef
43f5c7e
* Wed Mar 12 2014 Matěj Cepl <mcepl@redhat.com> - 1.2.3-9
43f5c7e
- Add two patches provided by Vadim Rutkovsky (fix #1058371 and
43f5c7e
  #1067388)
43f5c7e
eec11f8
* Tue Oct 29 2013 Matěj Cepl <mcepl@redhat.com> - 1.2.3-8
eec11f8
- Add Vadim Rutkovsky’s HTML Formatter patch (fix #1024023)
eec11f8
47cfe9a
* Wed Oct 23 2013 Matěj Cepl <mcepl@redhat.com> - 1.2.3-7
47cfe9a
- Make generating of docs conditional again.
47cfe9a
47cfe9a
* Wed Oct 23 2013 Björn Esser <bjoern.esser@gmail.com> - 1.2.3-6
47cfe9a
- fixed all remaining issues as mentioned in rhbz# 987622 c# 16
47cfe9a
- added needed conditionals for building on el6.
47cfe9a
47cfe9a
* Tue Oct 22 2013 Matěj Cepl <mcepl@redhat.com> - 1.2.3-5
47cfe9a
- Generate sphinx documentation
47cfe9a
47cfe9a
* Tue Oct 22 2013 Matěj Cepl <mcepl@redhat.com> - 1.2.3-4
47cfe9a
- Fix spelling to en_US (apparently reviewer doesn't understand proper
47cfe9a
  English ;))
47cfe9a
- Add specific python2 marcros
47cfe9a
- Fix files in _bindir to refer to python2 explicitly.
47cfe9a
- Run testsuite
47cfe9a
47cfe9a
* Mon Oct 21 2013 Matěj Cepl <mcepl@redhat.com> - 1.2.3-3
47cfe9a
- Update generation of manpage from --help output.
47cfe9a
47cfe9a
* Sun Jul 28 2013 Matěj Cepl <mcepl@redhat.com> - 1.2.3-2
47cfe9a
- Fix changelog
47cfe9a
- Give up on Python3 module ATM
47cfe9a
  (https://bugzilla.redhat.com/show_bug.cgi?id=987622#c2 and
47cfe9a
  https://github.com/behave/behave/issues/119)
47cfe9a
- noarch package doesn't need CFLAGS set
47cfe9a
47cfe9a
* Tue Jul 23 2013 Matěj Cepl <mcepl@redhat.com> - 1.2.3-1
47cfe9a
- initial package for Fedora