# Created by pyp2rpm-1.1.2 %if 0%{?fedora} %global with_python3 1 %else %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif %global pypi_name XStatic-bootswatch Name: python-%{pypi_name} Version: 3.3.5.3 Release: 2%{?dist} Summary: bootswatch (XStatic packaging standard) License: MIT URL: http://bootswatch.com Source0: https://pypi.python.org/packages/source/X/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %description Bootswatch javascript library packaged for setuptools (easy_install) / pip. Free themes for Bootstrap %package -n python2-%{pypi_name} Summary: bootswatch (XStatic packaging standard) %{?python_provide:%python_provide python2-%{pypi_name}} # python_provide does not exist in CentOS7 buildroot Provides: python-%{pypi_name} = %{version}-%{release} BuildRequires: python2-devel BuildRequires: python-setuptools Requires: python-XStatic Requires: bootswatch-common = %{version}-%{release} Requires: bootswatch-fonts = %{version}-%{release} %description -n python2-%{pypi_name} bootswatch javascript library packaged for setuptools (easy_install) / pip. Free themes for Bootstrap %package -n bootswatch-common Summary: bootswatch (XStatic packaging standard) common files BuildRequires: web-assets-devel Requires: web-assets-filesystem %description -n bootswatch-common Common bootswatch static content (CSS and SCSS) %package -n bootswatch-fonts Summary: bootswatch (XStatic packaging standard) fonts BuildRequires: fontpackages-filesystem Requires: fontpackages-filesystem %description -n bootswatch-fonts Bootswatch fonts %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: bootswatch (XStatic packaging standard) %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-setuptools Requires: python3-XStatic Requires: bootswatch-common = %{version}-%{release} Requires: bootswatch-fonts = %{version}-%{release} %description -n python3-%{pypi_name} bootswatch javascript library packaged for setuptools (easy_install) / pip. Free themes for Bootstrap %endif %prep %setup -q -n %{pypi_name}-%{version} # patch to use webassets dir sed -i "s|^BASE_DIR = .*|BASE_DIR = '%{_jsdir}/bootswatch'|" xstatic/pkg/bootswatch/__init__.py %build %{__python2} setup.py build %if 0%{?with_python3} %{__python3} setup.py build %endif %install %{__python2} setup.py install --skip-build --root %{buildroot} # Move fonts to the right directory mkdir -p %{buildroot}/%{_datadir}/fonts/bootswatch mv %{buildroot}/%{python2_sitelib}/xstatic/pkg/bootswatch/data/fonts/* %{buildroot}/%{_datadir}/fonts/bootswatch rmdir %{buildroot}/%{python2_sitelib}/xstatic/pkg/bootswatch/data/fonts # Move static files mkdir -p %{buildroot}/%{_jsdir}/bootswatch for theme in cerulean cosmo cyborg darkly flatly journal lumen paper readable sandstone simplex slate spacelab superhero united yeti do mv %{buildroot}/%{python2_sitelib}/xstatic/pkg/bootswatch/data/${theme} %{buildroot}/%{_jsdir}/bootswatch done %if 0%{?with_python3} %{__python3} setup.py install --skip-build --root %{buildroot} # Remove static files, already created by the python2 subpkg rm -rf %{buildroot}/%{python3_sitelib}/xstatic/pkg/bootswatch/data/fonts for theme in cerulean cosmo cyborg darkly flatly journal lumen paper readable sandstone simplex slate spacelab superhero united yeti do rm -rf %{buildroot}/%{python3_sitelib}/xstatic/pkg/bootswatch/data/${theme} done %endif %files -n python2-%{pypi_name} %doc README.txt %license xstatic/pkg/bootswatch/data/LICENSE %{python2_sitelib}/xstatic/pkg/bootswatch %{python2_sitelib}/XStatic_bootswatch-%{version}-py?.?.egg-info %{python2_sitelib}/XStatic_bootswatch-%{version}-py?.?-nspkg.pth %files -n bootswatch-common %doc README.txt %license xstatic/pkg/bootswatch/data/LICENSE %{_jsdir}/bootswatch %files -n bootswatch-fonts %doc README.txt %license xstatic/pkg/bootswatch/data/LICENSE %{_datadir}/fonts/bootswatch %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.txt %license xstatic/pkg/bootswatch/data/LICENSE %{python3_sitelib}/xstatic/pkg/bootswatch %{python3_sitelib}/XStatic_bootswatch-%{version}-py?.?.egg-info %{python3_sitelib}/XStatic_bootswatch-%{version}-py?.?-nspkg.pth %endif %changelog * Mon Sep 07 2015 jpena - 3.3.5.3-2 - Added bootswatch-fonts subpackage. - Shortened description. * Fri Sep 04 2015 jpena - 3.3.5.3-1 - Initial package.