Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%global with_python2 0

%global pypi_name django-tinymce

Name:               python-%{pypi_name}
Version:            2.4.0
Release:            5%{?dist}
Summary:            Django widget to render a form field as a TinyMCE editor

License:            MIT
URL:                http://pypi.python.org/pypi/django-tinymce
Source0:            https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz

#
# remove moxieplayer from js files
#
Patch0:             python-django-tinymce-2.4.0-no-moxieplayer.patch

BuildArch:          noarch

%description
django-tinymce is a Django application that contains a widget to render
a form field as a TinyMCE editor.

%if 0%{?with_python2}
%package -n python2-%{pypi_name}
Summary:            Django widget to render a form field as a TinyMCE editor - Python 2 version

BuildRequires:      python2-devel
BuildRequires:      python2-setuptools
BuildRequires:      python2-django
BuildRequires:      python2-mock
Requires:           tinymce

%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
django-tinymce is a Django application that contains a widget to render
a form field as a TinyMCE editor.
This package provides Python 2 build of %{pypi_name}.
%endif

%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary:            Django widget to render a form field as a TinyMCE editor - Python 3 version

BuildRequires:      python3-devel
BuildRequires:      python3-setuptools
BuildRequires:      python3-django
BuildRequires:      python3-mock
Requires:           tinymce

%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
django-tinymce is a Django application that contains a widget to render
a form field as a TinyMCE editor.
This package provides Python 3 build of %{pypi_name}.

%endif

%prep
%autosetup -n %{pypi_name}-%{version} -p1

# Drop flashplayer
rm -f tinymce/static/tiny_mce/plugins/media/moxieplayer.swf
rm -f tinymce/media/tiny_mce/plugins/media/moxieplayer.swf

%build
%if 0%{?with_python2}
%py2_build
%endif
%if 0%{?with_python3}
%py3_build
%endif

%install
%if 0%{?with_python2}
%py2_install
%endif
%if 0%{?with_python3}
%py3_install
%endif

%check
%if 0%{?with_python2}
%{__python2} setup.py test
%endif
%if 0%{?with_python3}
#%{__python3} setup.py test
%endif

# Remove tests once done with them
%if 0%{?with_python2}
rm -rf %{buildroot}%{python2_sitelib}/testtinymce/
%endif
%if 0%{?with_python3}
rm -rf %{buildroot}%{python3_sitelib}/testtinymce/
%endif

%if 0%{?with_python2}
%files  -n python2-%{pypi_name}
%license LICENSE.txt
%doc docs/
%{python2_sitelib}/tinymce/
%{python2_sitelib}/django_tinymce-%{version}*
%endif

%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%license LICENSE.txt
%doc docs/
%{python3_sitelib}/tinymce/
%{python3_sitelib}/django_tinymce-%{version}*
%endif

%changelog
* Mon Mar 05 2018 Ralph Bean <rbean@redhat.com> - 2.4.0-5
- Disable python2 for https://fedoraproject.org/wiki/Changes/Django20

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Dec 27 2016 Kevin Fenzi <kevin@scrye.com> - 2.4.0-1
- Update to 2.4.0.
- Clean flash player and flash files out. Fixes bug #

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 2.3.0-2
- Rebuild for Python 3.6

* Wed Aug 17 2016 Jan Beran <jberan@redhat.com> - 2.3.0-1
- update to version 2.3.0
- source update
- modernized specfile with Python 3 packaging

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.3-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Jan 14 2014 Adam Williamson <awilliam@redhat.com> - 1.5.2-1
- new upstream release 1.5.2
- drop (one) bundled tinymce, use system copy instead

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1b4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Feb 04 2013 Ralph Bean <rbean@redhat.com> - 1.5.1b4-1
- Initial packaging for Fedora