diff --git a/python-XStatic-jquery-ui.spec b/python-XStatic-jquery-ui.spec index 7d0089c..4a1d101 100644 --- a/python-XStatic-jquery-ui.spec +++ b/python-XStatic-jquery-ui.spec @@ -1,12 +1,12 @@ +%if 0%{?fedora} +%global with_python3 1 +%endif + %global pypi_name XStatic-jquery-ui -%{!?__python2:%global __python2 %{__python}} -%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}} -%{!?python2_sitearch: %global python2_sitearch %{python_sitearch}} -%{!?python2_version: %global python2_version %{python_version}} Name: python-%{pypi_name} Version: 1.10.4.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: jquery-ui (XStatic packaging standard) # According @@ -17,54 +17,132 @@ Summary: jquery-ui (XStatic packaging standard) # https://github.com/jquery/jqueryui.com/blob/master/LICENSE.txt License: CCO URL: http://jqueryui.com/ -Source0: https://pypi.python.org/packages/source/X/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/X/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch - + +%description +JavaScript library packaged for setuptools (easy_install) / pip. + +This package is intended to be used by any project that needs these files. + +It intentionally does not provide any extra code except some metadata +nor has any extra requirements. + +%package -n python2-%{pypi_name} +Summary: %{summary} + BuildRequires: python2-devel -BuildRequires: python-setuptools -BuildRequires: web-assets-devel +BuildRequires: python2-setuptools -Requires: python-XStatic -Requires: web-assets-filesystem +Requires: python2-XStatic +Requires: xstatic-jquery-ui-common +%{?python_provide:%python_provide python2-%{pypi_name}} -%description -jquery-ui javascript library packaged for -setuptools (easy_install) / pip. +Requires: python-XStatic-jQuery -%prep -%setup -q -n %{pypi_name}-%{version} -# Remove bundled egg-info -rm -rf %{pypi_name}.egg-info +%description -n python2-%{pypi_name} +JavaScript library packaged for setuptools (easy_install) / pip. -# patch to use webassets dir -sed -i "s|^BASE_DIR = .*|BASE_DIR = '%{_jsdir}/jquery_ui'|" xstatic/pkg/jquery_ui/__init__.py +This package is intended to be used by any project that needs these files. +It intentionally does not provide any extra code except some metadata +nor has any extra requirements. +This package provides Python 2 build of %{pypi_name}. +%if 0%{?with_python3} +%package -n python3-%{pypi_name} +Summary: %{summary} -%build -# due -# https://bitbucket.org/thomaswaldmann/xstatic/issue/2/ -# this package can not be built with python-XStatic installed. -%{__python2} setup.py build +BuildRequires: python3-devel +BuildRequires: python3-setuptools +Requires: python3-XStatic +Requires: xstatic-jquery-ui-common -%install -%{__python2} setup.py install --skip-build --root %{buildroot} -mkdir -p %{buildroot}/%{_jsdir}/jquery_ui -mv %{buildroot}/%{python2_sitelib}/xstatic/pkg/jquery_ui/data/* %{buildroot}/%{_jsdir}/jquery_ui +%{?python_provide:%python_provide python3-%{pypi_name}} + +Requires: python3-XStatic-jQuery + +%description -n python3-%{pypi_name} +JavaScript library packaged for setuptools (easy_install) / pip. + +This package is intended to be used by any project that needs these files. + +It intentionally does not provide any extra code except some metadata +nor has any extra requirements. +This package provides Python 3 build of %{pypi_name}. +%endif +%package -n xstatic-jquery-ui-common +Summary: %{summary} -%files +BuildRequires: web-assets-devel +Requires: web-assets-filesystem + +%description -n xstatic-jquery-ui-common +JavaScript library packaged for setuptools (easy_install) / pip. + +This package is intended to be used by any project that needs these files. + +It intentionally does not provide any extra code except some metadata +nor has any extra requirements. + +This package contains the javascript files. + +%prep +%autosetup -n %{pypi_name}-%{version} +# patch to use webassets dir +sed -i "s|^BASE_DIR = .*|BASE_DIR = '%{_jsdir}/jquery_ui'|" xstatic/pkg/jquery_ui/__init__.py + +%build +%py2_build +%if 0%{?with_python3} +%py3_build +%endif + +%install +%py2_install +mkdir -p %{buildroot}%{_jsdir}/jquery_ui +mv %{buildroot}%{python2_sitelib}/xstatic/pkg/jquery_ui/data/* %{buildroot}%{_jsdir}/jquery_ui +rmdir %{buildroot}%{python2_sitelib}/xstatic/pkg/jquery_ui/data/ +# fix execute flags for js +chmod 644 %{buildroot}%{_jsdir}/jquery_ui/external/*.js +chmod 644 %{buildroot}%{_jsdir}/jquery_ui/ui/*.js +chmod 644 %{buildroot}%{_jsdir}/jquery_ui/ui/i18n/*.js +chmod 644 %{buildroot}%{_jsdir}/jquery_ui/ui/minified/*.js +chmod 644 %{buildroot}%{_jsdir}/jquery_ui/ui/minified/i18n/*.js + +%if 0%{?with_python3} +%py3_install +# Remove static files, already created by the python2 subpkg +rm -rf %{buildroot}%{python3_sitelib}/xstatic/pkg/jquery_ui/data +%endif + +%files -n python2-%{pypi_name} %doc README.txt %{python2_sitelib}/xstatic/pkg/jquery_ui -%{python2_sitelib}/XStatic_jquery_ui-1.10.4.1-py%{python_version}.egg-info -%{python2_sitelib}/XStatic_jquery_ui-1.10.4.1-py%{python_version}-nspkg.pth +%{python2_sitelib}/XStatic_jquery_ui-%{version}-py%{python2_version}.egg-info +%{python2_sitelib}/XStatic_jquery_ui-%{version}-py%{python2_version}-nspkg.pth + +%if 0%{?with_python3} +%files -n python3-%{pypi_name} +%doc README.txt +%{python3_sitelib}/xstatic/pkg/jquery_ui +%{python3_sitelib}/XStatic_jquery_ui-%{version}-py%{python3_version}.egg-info +%{python3_sitelib}/XStatic_jquery_ui-%{version}-py%{python3_version}-nspkg.pth +%endif + +%files -n xstatic-jquery-ui-common +%doc README.txt %{_jsdir}/jquery_ui %changelog +* Wed Oct 12 2016 Jan Beran - 1.10.4.1-5 +- Provides a Python 3 subpackage + * Tue Jul 19 2016 Fedora Release Engineering - 1.10.4.1-4 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages