Blame SPECS/python-XStatic-bootswatch.spec

18595c
%if 0%{?fedora} || 0%{?rhel} > 7
18595c
%bcond_with    python2
18595c
%bcond_without python3
18595c
%else
18595c
%bcond_without python2
18595c
%bcond_with    python3
18595c
%endif
18595c
18595c
%global pypi_name XStatic-bootswatch
18595c
18595c
Name:           python-%{pypi_name}
18595c
Version:        3.3.7.0
18595c
Release:        15%{?dist}
18595c
Summary:        bootswatch (XStatic packaging standard)
18595c
18595c
License:        MIT
18595c
URL:            http://bootswatch.com
18595c
Source0:        https://pypi.io/packages/source/X/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
18595c
Source1:        https://raw.githubusercontent.com/openstack/xstatic-bootswatch/master/LICENSE
18595c
BuildArch:      noarch
18595c
18595c
%description
18595c
Bootswatch javascript library packaged
18595c
for setuptools (easy_install) / pip.
18595c
18595c
Free themes for Bootstrap
18595c
18595c
%if %{with python2}
18595c
%package -n python2-%{pypi_name}
18595c
Summary:        bootswatch (XStatic packaging standard)
18595c
%{?python_provide:%python_provide python2-%{pypi_name}}
18595c
# python_provide does not exist in CentOS7 buildroot
18595c
Provides:       python-%{pypi_name} = %{version}-%{release}
18595c
18595c
BuildRequires:  python2-devel
18595c
BuildRequires:  python2-setuptools
18595c
18595c
Requires:       python2-XStatic
18595c
Requires:       bootswatch-common = %{version}-%{release}
18595c
Requires:       bootswatch-fonts  = %{version}-%{release}
18595c
18595c
%description -n python2-%{pypi_name}
18595c
bootswatch javascript library packaged
18595c
for setuptools (easy_install) / pip.
18595c
18595c
Free themes for Bootstrap
18595c
%endif
18595c
18595c
%package -n bootswatch-common
18595c
Summary:    bootswatch (XStatic packaging standard) common files
18595c
BuildRequires:  web-assets-devel
18595c
18595c
Requires:       web-assets-filesystem
18595c
18595c
%description -n bootswatch-common
18595c
Common bootswatch static content (CSS and SCSS)
18595c
18595c
%package -n bootswatch-fonts
18595c
Summary:    bootswatch (XStatic packaging standard) fonts
18595c
BuildRequires:  fontpackages-filesystem
18595c
18595c
Requires:       fontpackages-filesystem
18595c
18595c
%description -n bootswatch-fonts
18595c
Bootswatch fonts
18595c
18595c
%if %{with python3}
18595c
%package -n python3-%{pypi_name}
18595c
Summary:        bootswatch (XStatic packaging standard)
18595c
%{?python_provide:%python_provide python3-%{pypi_name}}
18595c
18595c
BuildRequires:  python3-devel
18595c
BuildRequires:  python3-setuptools
18595c
18595c
Requires:       python3-XStatic
18595c
Requires:       bootswatch-common = %{version}-%{release}
18595c
Requires:       bootswatch-fonts  = %{version}-%{release}
18595c
18595c
%description -n python3-%{pypi_name}
18595c
bootswatch javascript library packaged
18595c
for setuptools (easy_install) / pip.
18595c
18595c
Free themes for Bootstrap
18595c
%endif
18595c
18595c
18595c
%prep
18595c
%setup -q -n %{pypi_name}-%{version}
18595c
18595c
# patch to use webassets dir
18595c
sed -i "s|^BASE_DIR = .*|BASE_DIR = '%{_jsdir}/bootswatch'|" xstatic/pkg/bootswatch/__init__.py
18595c
# License file is present in GitHub repo, but not in PyPi file
18595c
cp %{SOURCE1} .
18595c
18595c
18595c
%build
18595c
%if %{with python2}
18595c
%{__python2} setup.py build
18595c
%endif
18595c
18595c
%if %{with python3}
18595c
%{__python3} setup.py build
18595c
%endif
18595c
18595c
%install
18595c
%if %{with python2}
18595c
%{__python2} setup.py install --skip-build --root %{buildroot}
18595c
# Move fonts to the right directory
18595c
mkdir -p %{buildroot}/%{_datadir}/fonts/bootswatch
18595c
mv %{buildroot}/%{python2_sitelib}/xstatic/pkg/bootswatch/data/fonts/* %{buildroot}/%{_datadir}/fonts/bootswatch
18595c
rmdir %{buildroot}/%{python2_sitelib}/xstatic/pkg/bootswatch/data/fonts
18595c
18595c
# Move static files
18595c
mkdir -p %{buildroot}/%{_jsdir}/bootswatch
18595c
for theme in cerulean cosmo cyborg darkly flatly journal lumen paper readable sandstone simplex slate spacelab superhero united yeti
18595c
do
18595c
 mv %{buildroot}/%{python2_sitelib}/xstatic/pkg/bootswatch/data/${theme} %{buildroot}/%{_jsdir}/bootswatch
18595c
done
18595c
%endif
18595c
18595c
18595c
%if %{with python3}
18595c
%{__python3} setup.py install --skip-build --root %{buildroot}
18595c
# Move fonts to the right directory
18595c
mkdir -p %{buildroot}/%{_datadir}/fonts/bootswatch
18595c
mv %{buildroot}/%{python3_sitelib}/xstatic/pkg/bootswatch/data/fonts/* %{buildroot}/%{_datadir}/fonts/bootswatch
18595c
rmdir %{buildroot}/%{python3_sitelib}/xstatic/pkg/bootswatch/data/fonts
18595c
18595c
# Move static files
18595c
mkdir -p %{buildroot}/%{_jsdir}/bootswatch
18595c
for theme in cerulean cosmo cyborg darkly flatly journal lumen paper readable sandstone simplex slate spacelab superhero united yeti
18595c
do
18595c
 mv %{buildroot}/%{python3_sitelib}/xstatic/pkg/bootswatch/data/${theme} %{buildroot}/%{_jsdir}/bootswatch
18595c
done
18595c
%endif
18595c
18595c
%if %{with python2}
18595c
%files -n python2-%{pypi_name}
18595c
%doc README.txt
18595c
%license LICENSE
18595c
%{python2_sitelib}/xstatic/pkg/bootswatch
18595c
%{python2_sitelib}/XStatic_bootswatch-%{version}-py?.?.egg-info
18595c
%{python2_sitelib}/XStatic_bootswatch-%{version}-py?.?-nspkg.pth
18595c
%endif
18595c
18595c
%files -n bootswatch-common
18595c
%doc README.txt
18595c
%license LICENSE
18595c
%{_jsdir}/bootswatch
18595c
18595c
%files -n bootswatch-fonts
18595c
%doc README.txt
18595c
%license LICENSE
18595c
%{_datadir}/fonts/bootswatch
18595c
18595c
%if %{with python3}
18595c
%files -n python3-%{pypi_name}
18595c
%doc README.txt
18595c
%license LICENSE
18595c
%{python3_sitelib}/xstatic/pkg/bootswatch
18595c
%{python3_sitelib}/XStatic_bootswatch-%{version}-py%{python3_version}.egg-info
18595c
%{python3_sitelib}/XStatic_bootswatch-%{version}-py%{python3_version}-nspkg.pth
18595c
%endif
18595c
18595c
%changelog
18595c
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.7.0-15
18595c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
18595c
18595c
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.7.0-14
18595c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
18595c
18595c
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.3.7.0-13
18595c
- Rebuilt for Python 3.9
18595c
18595c
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.7.0-12
18595c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
18595c
18595c
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.3.7.0-11
18595c
- Rebuilt for Python 3.8.0rc1 (#1748018)
18595c
18595c
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 3.3.7.0-10
18595c
- Rebuilt for Python 3.8
18595c
18595c
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.7.0-9
18595c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
18595c
18595c
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.7.0-8
18595c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
18595c
18595c
* Mon Sep 17 2018 Javier Peña <jpena@redhat.com> - 3.3.7.0-7
18595c
- Removed Python 2 package from Fedora 30+ (bz#1629755)
18595c
18595c
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.7.0-6
18595c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
18595c
18595c
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.3.7.0-5
18595c
- Rebuilt for Python 3.7
18595c
18595c
* Fri Feb 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 3.3.7.0-4
18595c
- Update Python 2 dependency declarations to new packaging standards
18595c
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
18595c
18595c
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.7.0-3
18595c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
18595c
18595c
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.7.0-2
18595c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
18595c
18595c
* Mon Feb  6 2017 Haïkel Guémar <hguemar@fedoraproject.org> - 3.3.7.0-1
18595c
- Upstream 3.3.7.0
18595c
18595c
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 3.3.6.0-2
18595c
- Rebuild for Python 3.6
18595c
18595c
* Fri Aug 19 2016 jpena <jpena@redhat.com> - 3.3.6.0-1
18595c
- Updated to upstream version 3.3.6.0
18595c
- Added external license file, it is no longer bundled in source
18595c
- Fixed source URL
18595c
18595c
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.5.3-5
18595c
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
18595c
18595c
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.5.3-4
18595c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
18595c
18595c
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.5.3-3
18595c
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
18595c
18595c
* Mon Sep 07 2015 jpena <jpena@redhat.com> - 3.3.5.3-2
18595c
- Added bootswatch-fonts subpackage.
18595c
- Shortened description.
18595c
* Fri Sep 04 2015 jpena <jpena@redhat.com> - 3.3.5.3-1
18595c
- Initial package.