f83f55f
%if 0%{?rhel} && 0%{?rhel} < 8
Igor Gnatenko 3c77662
%bcond_with python3
47cfe9a
%else
2260bbd
%bcond_without python3
2260bbd
%endif
2260bbd
47cfe9a
%global modname behave
47cfe9a
Igor Gnatenko 3c77662
Name:           python-%{modname}
Igor Gnatenko 3c77662
Version:        1.2.5
5dc44d7
Release:        21%{?dist}
Igor Gnatenko 3c77662
Summary:        Tools for the behavior-driven development, Python style
47cfe9a
Igor Gnatenko 3c77662
License:        BSD
Igor Gnatenko 3c77662
URL:            http://pypi.python.org/pypi/%{modname}
Igor Gnatenko 3c77662
Source0:        https://github.com/behave/behave/archive/v%{version}/%{modname}-%{version}.tar.gz
a277166
Patch0:         HTML-Formatter.patch
a277166
Patch1:         html_formatter_no_set_codecs.patch
6d6d7ac
Patch2:         0003-unicode_fixes.patch
6d6d7ac
6d6d7ac
# Cherry-picked patches
6d6d7ac
Patch1001:      0001-support-ref-link-for-each-step.patch
6d6d7ac
Patch1002:      0002-Add-step-label-to-be-used-in-step-refs-like.patch
6d6d7ac
Patch1003:      0003-PREPARE-for-Python-3.6-re.LOCALE-was-removed.patch
a277166
Igor Gnatenko 3c77662
BuildArch:      noarch
Igor Gnatenko 3c77662
Igor Gnatenko 3c77662
%global _description \
Igor Gnatenko 3c77662
Behavior-driven development (or BDD) is an agile software development\
Igor Gnatenko 3c77662
technique that encourages collaboration between developers, QA and non-\
Igor Gnatenko 3c77662
technical or business participants in a software project.\
Igor Gnatenko 3c77662
\
Igor Gnatenko 3c77662
%{modname} uses tests written in a natural language style, backed up\
Igor Gnatenko 3c77662
by Python code.
41ba823
Igor Gnatenko 3c77662
%description %{_description}
47cfe9a
Igor Gnatenko 3c77662
%package -n python2-%{modname}
Igor Gnatenko 3c77662
Summary:        %{summary}
Igor Gnatenko 3c77662
%{?python_provide:%python_provide python2-%{modname}}
4df2cd5
BuildRequires:  python2-devel
f83f55f
%if 0%{?rhel} && 0%{?rhel} <= 7
4df2cd5
BuildRequires:  python-setuptools
4df2cd5
BuildRequires:  python-parse
4df2cd5
BuildRequires:  python-parse_type
4df2cd5
BuildRequires:  python-six
4df2cd5
BuildRequires:  python-nose
4df2cd5
Requires:       python-setuptools
4df2cd5
Requires:       python-parse
4df2cd5
Requires:       python-parse_type
4df2cd5
Requires:       python-six
f83f55f
%else
4df2cd5
BuildRequires:  python2-setuptools
4df2cd5
BuildRequires:  python2-parse
4df2cd5
BuildRequires:  python2-parse_type
4df2cd5
BuildRequires:  python2-six
4df2cd5
BuildRequires:  python2-nose
4df2cd5
Requires:       python2-setuptools
4df2cd5
Requires:       python2-parse
4df2cd5
Requires:       python2-parse_type
4df2cd5
Requires:       python2-six
4df2cd5
%endif
4df2cd5
BuildRequires:  python2-mock
47cfe9a
Igor Gnatenko 3c77662
%description -n python2-%{modname} %{_description}
47cfe9a
Igor Gnatenko 3c77662
Python 2 version.
47cfe9a
2260bbd
%if %{with python3}
46c7606
%package -n python3-%{modname}
Igor Gnatenko 3c77662
Summary:        %{summary}
46c7606
%{?python_provide:%python_provide python3-%{modname}}
46c7606
BuildRequires:  python3-devel
46c7606
BuildRequires:  python3-setuptools
46c7606
BuildRequires:  python3-parse
46c7606
BuildRequires:  python3-parse_type
46c7606
BuildRequires:  python3-six
46c7606
BuildRequires:  python3-mock
46c7606
BuildRequires:  python3-nose
46c7606
Requires:       python3-setuptools
46c7606
Requires:       python3-parse
46c7606
Requires:       python3-parse_type
46c7606
Requires:       python3-six
46c7606
46c7606
%description -n python3-%{modname} %{_description}
2260bbd
Igor Gnatenko 3c77662
Python 3 version.
2260bbd
%endif
47cfe9a
47cfe9a
%package doc
Igor Gnatenko 3c77662
Summary:        Documentation for %{name}
Igor Gnatenko 3c77662
BuildRequires:  help2man
Igor Gnatenko 3c77662
BuildRequires:  python-sphinxcontrib-cheeseshop
4df2cd5
BuildRequires:  python-sphinx
47cfe9a
Igor Gnatenko 3c77662
%description doc %{_description}
47cfe9a
47cfe9a
This package contains documentation in reST and HTML formats and some
47cfe9a
brief feature-examples.
47cfe9a
47cfe9a
%prep
Igor Gnatenko 3c77662
%autosetup -n %{modname}-%{version} -p1
47cfe9a
# Copy reST-files into a seperate dir
47cfe9a
mkdir -p reST
47cfe9a
cp -a docs/*.rst reST
47cfe9a
47cfe9a
%build
Igor Gnatenko 3c77662
%py2_build
f83f55f
%if %{with python3}
Igor Gnatenko 3c77662
%py3_build
f83f55f
%endif
47cfe9a
47cfe9a
# Build the autodocs
47cfe9a
make html -C docs
47cfe9a
rm -rf build/docs/html/.buildinfo
47cfe9a
47cfe9a
%install
Igor Gnatenko 3c77662
mkdir -p %{buildroot}%{_mandir}/man1
Igor Gnatenko 3c77662
Igor Gnatenko 3c77662
%py2_install
Igor Gnatenko 3c77662
mv %{buildroot}%{_bindir}/%{modname}{,-%{python2_version}}
Igor Gnatenko 3c77662
ln -s %{modname}-%{python2_version} %{buildroot}%{_bindir}/%{modname}-2
Igor Gnatenko 3c77662
PYTHONPATH=%{buildroot}%{python2_sitelib} help2man \
Igor Gnatenko 3c77662
  --no-info \
Igor Gnatenko 3c77662
  --name="Run a number of feature tests with behave." \
Igor Gnatenko 3c77662
  --output=%{modname}-%{python2_version}.1 \
Igor Gnatenko 3c77662
  %{buildroot}%{_bindir}/%{modname}-%{python2_version}
Igor Gnatenko 3c77662
install -Dpm0644 %{modname}-%{python2_version}.1 %{buildroot}%{_mandir}/man1/
f83f55f
ln -s %{modname}-%{python2_version}.1 %{buildroot}%{_mandir}/man1/%{modname}.1
f6e63e1
2126557
%if %{with python3}
Igor Gnatenko 3c77662
%py3_install
Igor Gnatenko 3c77662
mv %{buildroot}%{_bindir}/%{modname}{,-%{python3_version}}
f6e63e1
ln -s %{modname}-%{python3_version} %{buildroot}%{_bindir}/%{modname}-3
Igor Gnatenko 3c77662
PYTHONPATH=%{buildroot}%{python3_sitelib} help2man \
Igor Gnatenko 3c77662
  --no-info \
Igor Gnatenko 3c77662
  --name="Run a number of feature tests with behave." \
Igor Gnatenko 3c77662
  --output=%{modname}-%{python3_version}.1 \
Igor Gnatenko 3c77662
  %{buildroot}%{_bindir}/%{modname}-%{python3_version}
Igor Gnatenko 3c77662
install -Dpm0644 %{modname}-%{python3_version}.1 %{buildroot}%{_mandir}/man1/
47cfe9a
%endif
47cfe9a
f83f55f
ln -sf %{modname}-2 %{buildroot}%{_bindir}/%{modname}
47cfe9a
47cfe9a
%check
Igor Gnatenko 3c77662
nosetests-%{python2_version} -v
2126557
%if %{with python3}
Igor Gnatenko 3c77662
nosetests-%{python3_version} -v
47cfe9a
%endif
47cfe9a
Igor Gnatenko 3c77662
%files -n python2-%{modname}
Igor Gnatenko 3c77662
%license LICENSE
Igor Gnatenko 3c77662
%doc README.rst
Igor Gnatenko 3c77662
%{_bindir}/%{modname}-2
Igor Gnatenko 3c77662
%{_bindir}/%{modname}-%{python2_version}
Igor Gnatenko 3c77662
%{python2_sitelib}/%{modname}-*.egg-info/
Igor Gnatenko 3c77662
%{python2_sitelib}/%{modname}/
Igor Gnatenko 3c77662
%{python2_sitelib}/setuptools_%{modname}.py*
f83f55f
%doc %{_mandir}/man1/%{modname}-%{python2_version}.1*
f83f55f
%doc %{_mandir}/man1/%{modname}.1*
47cfe9a
94f8516
%{_bindir}/%{modname}
94f8516
2126557
%if %{with python3}
46c7606
%files -n python3-%{modname}
Igor Gnatenko 3c77662
%license LICENSE
Igor Gnatenko 3c77662
%doc README.rst
Igor Gnatenko 3c77662
%doc %{_mandir}/man1/%{modname}-%{python3_version}.1*
Igor Gnatenko 3c77662
%{_bindir}/%{modname}-3
Igor Gnatenko 3c77662
%{_bindir}/%{modname}-%{python3_version}
Igor Gnatenko 3c77662
%{python3_sitelib}/%{modname}-*.egg-info/
Igor Gnatenko 3c77662
%{python3_sitelib}/%{modname}/
Igor Gnatenko 3c77662
%{python3_sitelib}/setuptools_%{modname}.py
Igor Gnatenko 3c77662
%{python3_sitelib}/__pycache__/setuptools_%{modname}.*
f6e63e1
%endif
Igor Gnatenko 3c77662
47cfe9a
%files doc
Igor Gnatenko 3c77662
%license LICENSE
Igor Gnatenko 3c77662
%doc README.rst build/docs/html reST
47cfe9a
47cfe9a
%changelog
5dc44d7
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-21
5dc44d7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5dc44d7
04ae8f1
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-20
04ae8f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
04ae8f1
09a8b4e
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.2.5-19
09a8b4e
- Rebuild for Python 3.6
09a8b4e
c9932df
* Tue Sep 20 2016 Matěj Cepl <mcepl@redhat.com> - 1.2.5-18
c9932df
- Add patch 0003-unicode_fixes.patch
c9932df
4df2cd5
* Fri Aug 12 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.2.5-17
4df2cd5
- Modernize spec
8840277
- Backport patch to put label into sphinx before step
4df2cd5
b61a692
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.5-16
b61a692
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
b61a692
f83f55f
* Tue Jul 12 2016 Matěj Cepl <mcepl@redhat.com> - 1.2.5-15
f83f55f
- Recover the build on RHEL-7 again.
f83f55f
94f8516
* Wed Jun 22 2016 Matěj Cepl <mcepl@redhat.com> - 1.2.5-14
94f8516
- Add a symlink /usr/bin/behave unconditionally (fix #1348872)
94f8516
Igor Gnatenko 3c77662
* Fri Jun 03 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.2.5-13
Igor Gnatenko 3c77662
- Update packaging to be compliant with new guidelines
Igor Gnatenko 3c77662
- Fix building manpage
Igor Gnatenko 3c77662
- Really run tests for python3
Igor Gnatenko 3c77662
- Proper handling for binaries
Igor Gnatenko 3c77662
24ca352
* Wed Mar 23 2016 Matěj Cepl <mcepl@redhat.com> - 1.2.5-12
24ca352
- it works a way better when the symlink actually points to somewhere.
24ca352
3cde8f5
* Wed Mar 23 2016 Matěj Cepl <mcepl@redhat.com> - 1.2.5-11
3cde8f5
- /usr/bin/behave belongs to python2 package still (#1319632)
3cde8f5
62cbac3
* Fri Mar 04 2016 Miro Hrončok <mhroncok@redhat.com> - 1.2.5-10
62cbac3
- Move python3 requires to python3 subpackage (#1314741)
62cbac3
26f4b3b
* Mon Feb 29 2016 Matěj Cepl <mcepl@redhat.com> - 1.2.5-9
26f4b3b
- RHEL-7 doesn't have py3k toolchain.
26f4b3b
2126557
* Mon Feb 29 2016 Matěj Cepl <mcepl@redhat.com> - 1.2.5-8
2126557
- Fix wrong %%if conditions.
2126557
f6e63e1
* Thu Feb 25 2016 Miro Hrončok <mhroncok@redhat.com> - 1.2.5-7
f6e63e1
- Make Python 3 the default version for the binary and provide a binary for 2 as well
f6e63e1
e646367
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-6
e646367
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e646367
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