Blame SPECS/python-XStatic-Angular-Gettext.spec

eba471
%if 0%{?fedora}|| 0%{?rhel} > 7
eba471
%global with_python3 1
eba471
%global with_python2 0
eba471
%endif
eba471
eba471
%global pypi_name XStatic-Angular-Gettext
eba471
eba471
Name:           python-%{pypi_name}
eba471
Version:        2.3.8.0
eba471
Release:        1%{?dist}
eba471
Summary:        Angular-Gettext (XStatic packaging standard)
eba471
eba471
License:        MIT
eba471
URL:            https://angular-gettext.rocketeer.be/
eba471
Source0:        https://files.pythonhosted.org/packages/source/X/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
eba471
BuildArch:      noarch
eba471
eba471
%description
eba471
JavaScript library packaged for setuptools (easy_install) / pip.
eba471
eba471
This package is intended to be used by any project that needs these files.
eba471
eba471
It intentionally does not provide any extra code except some metadata
eba471
nor has any extra requirements.
eba471
eba471
%if 0%{?with_python2}
eba471
%package -n python2-%{pypi_name}
eba471
Summary:        %{summary}
eba471
eba471
BuildRequires:  python2-devel
eba471
BuildRequires:  python2-setuptools
eba471
eba471
Requires:       python2-XStatic
eba471
Requires:       xstatic-angular-gettext-common
eba471
eba471
%{?python_provide:%python_provide python2-%{pypi_name}}
eba471
eba471
%description -n python2-%{pypi_name}
eba471
JavaScript library packaged for setuptools (easy_install) / pip.
eba471
eba471
This package is intended to be used by any project that needs these files.
eba471
eba471
It intentionally does not provide any extra code except some metadata
eba471
nor has any extra requirements.
eba471
eba471
This package provides Python 2 build of %{pypi_name}.
eba471
%endif
eba471
eba471
%if 0%{?with_python3}
eba471
%package -n python3-%{pypi_name}
eba471
Summary:        %{summary}
eba471
eba471
BuildRequires:  python3-devel
eba471
BuildRequires:  python3-setuptools
eba471
eba471
Requires:       python3-XStatic
eba471
Requires:       xstatic-angular-gettext-common
eba471
eba471
%{?python_provide:%python_provide python3-%{pypi_name}}
eba471
eba471
%description -n python3-%{pypi_name}
eba471
JavaScript library packaged for setuptools (easy_install) / pip.
eba471
eba471
This package is intended to be used by any project that needs these files.
eba471
eba471
It intentionally does not provide any extra code except some metadata
eba471
nor has any extra requirements.
eba471
eba471
This package provides Python 3 build of %{pypi_name}.
eba471
%endif
eba471
eba471
%package -n xstatic-angular-gettext-common
eba471
Summary:        %{summary}
eba471
eba471
BuildRequires:  web-assets-devel
eba471
Requires:       web-assets-filesystem
eba471
eba471
%description -n xstatic-angular-gettext-common
eba471
JavaScript library packaged for setuptools (easy_install) / pip.
eba471
eba471
This package is intended to be used by any project that needs these files.
eba471
eba471
It intentionally does not provide any extra code except some metadata
eba471
nor has any extra requirements.
eba471
eba471
This package contains the javascript files.
eba471
eba471
%prep
eba471
%autosetup -n %{pypi_name}-%{version}
eba471
# patch to use webassets dir
eba471
sed -i "s|^BASE_DIR = .*|BASE_DIR = '%{_jsdir}/angular_gettext'|" xstatic/pkg/angular_gettext/__init__.py
eba471
eba471
%build
eba471
%if 0%{?with_python2}
eba471
%py2_build
eba471
%endif
eba471
%if 0%{?with_python3}
eba471
%py3_build
eba471
%endif
eba471
eba471
%install
eba471
%if 0%{?with_python2}
eba471
%py2_install
eba471
mkdir -p %{buildroot}%{_jsdir}/angular_gettext
eba471
mv %{buildroot}%{python2_sitelib}/xstatic/pkg/angular_gettext/data/angular-gettext.js %{buildroot}%{_jsdir}/angular_gettext
eba471
rmdir %{buildroot}%{python2_sitelib}/xstatic/pkg/angular_gettext/data/
eba471
# fix execute flags for js
eba471
chmod 644 %{buildroot}%{_jsdir}/angular_gettext/angular-gettext.js
eba471
%endif
eba471
eba471
%if 0%{?with_python3}
eba471
%py3_install
eba471
mkdir -p %{buildroot}%{_jsdir}/angular_gettext
eba471
mv %{buildroot}%{python3_sitelib}/xstatic/pkg/angular_gettext/data/angular-gettext.js %{buildroot}%{_jsdir}/angular_gettext
eba471
rmdir %{buildroot}%{python3_sitelib}/xstatic/pkg/angular_gettext/data/
eba471
# fix execute flags for js
eba471
chmod 644 %{buildroot}%{_jsdir}/angular_gettext/angular-gettext.js
eba471
%endif
eba471
eba471
%if 0%{?with_python2}
eba471
%files -n python2-%{pypi_name}
eba471
%doc README.txt
eba471
%{python2_sitelib}/xstatic/pkg/angular_gettext
eba471
%{python2_sitelib}/XStatic_Angular_Gettext-%{version}-py%{python2_version}.egg-info
eba471
%{python2_sitelib}/XStatic_Angular_Gettext-%{version}-py%{python2_version}-nspkg.pth
eba471
%endif
eba471
eba471
%if 0%{?with_python3}
eba471
%files -n python3-%{pypi_name}
eba471
%doc README.txt
eba471
%{python3_sitelib}/xstatic/pkg/angular_gettext
eba471
%{python3_sitelib}/XStatic_Angular_Gettext-%{version}-py%{python3_version}.egg-info
eba471
%{python3_sitelib}/XStatic_Angular_Gettext-%{version}-py%{python3_version}-nspkg.pth
eba471
%endif
eba471
eba471
%files -n xstatic-angular-gettext-common
eba471
%doc README.txt
eba471
%{_jsdir}/angular_gettext
eba471
eba471
%changelog
eba471
* Mon Feb  6 2017 Haïkel Guémar <hguemar@fedoraproject.org> - 2.3.8.0-1
eba471
- Upstream 2.3.8.0
eba471
eba471
* Mon Dec 19 2016 Miro HronÄok <mhroncok@redhat.com> - 2.1.0.2-5
eba471
- Rebuild for Python 3.6
eba471
eba471
* Fri Oct 07 2016 Jan Beran <jberan@redhat.com> - 2.1.0.2-4
eba471
- Provides a Python 3 subpackage
eba471
eba471
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0.2-3
eba471
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
eba471
eba471
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0.2-2
eba471
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
eba471
eba471
* Thu Aug 06 2015 Matthias Runge <mrunge@redhat.com> - 2.1.0.2-1
eba471
- Initial package (rhbz#1250929)
eba471