Blame SPECS/python-XStatic-mdi.spec

642e33
%if 0%{?fedora} || 0%{?rhel} > 7
642e33
%bcond_with    python2
642e33
%bcond_without python3
642e33
%else
642e33
%bcond_without python2
642e33
%bcond_with    python3
642e33
%endif
642e33
642e33
%global pypi_name XStatic-mdi
642e33
642e33
Name:           python-%{pypi_name}
642e33
Version:        1.6.50.2
642e33
Release:        4%{?dist}
642e33
Summary:        mdi (XStatic packaging standard)
642e33
642e33
# mdi is licensed under SIL 1.1.
642e33
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses_4
642e33
# short name: OFL
642e33
642e33
License:        OFL
642e33
URL:            http://materialdesignicons.com
642e33
Source0:        https://pypi.io/packages/source/X/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
642e33
Source1:        https://raw.githubusercontent.com/openstack/xstatic-mdi/master/LICENSE
642e33
BuildArch:      noarch
642e33
 
642e33
%description
642e33
mdi javascript library packaged for setuptools
642e33
(easy_install) / pip.
642e33
642e33
%if %{with python2}
642e33
%package -n python2-%{pypi_name}
642e33
Summary:        mdi (XStatic packaging standard)
642e33
%{?python_provide:%python_provide python2-%{pypi_name}}
642e33
# python_provide does not exist in CentOS7 buildroot
642e33
Provides:       python-%{pypi_name} = %{version}-%{release}
642e33
642e33
BuildRequires:  python2-devel
642e33
BuildRequires:  python2-setuptools
642e33
642e33
Requires: python2-XStatic  
642e33
Requires: mdi-common = %{version}-%{release}
642e33
Requires: mdi-fonts  = %{version}-%{release}
642e33
642e33
%description -n python2-%{pypi_name}
642e33
mdi javascript library packaged for setuptools
642e33
(easy_install) / pip.
642e33
%endif
642e33
642e33
%package -n mdi-common
642e33
Summary:        mdi (XStatic packaging standard) common files
642e33
BuildRequires:  web-assets-devel
642e33
642e33
Requires: web-assets-filesystem
642e33
642e33
%description -n mdi-common
642e33
Common mdi static content (CSS and SCSS)
642e33
642e33
%package -n mdi-fonts
642e33
Summary:        mdi (XStatic packaging standard) fonts
642e33
BuildRequires:  fontpackages-filesystem
642e33
642e33
Requires: fontpackages-filesystem
642e33
642e33
%description -n mdi-fonts
642e33
mdi fonts
642e33
642e33
%if %{with python3}
642e33
%package -n python3-%{pypi_name}
642e33
Summary:        mdi (XStatic packaging standard)
642e33
%{?python_provide:%python_provide python3-%{pypi_name}}
642e33
642e33
BuildRequires:  python3-devel
642e33
BuildRequires:  python3-setuptools
642e33
642e33
Requires: python3-XStatic
642e33
Requires: mdi-common = %{version}-%{release}
642e33
Requires: mdi-fonts  = %{version}-%{release}
642e33
642e33
%description -n python3-%{pypi_name}
642e33
mdi javascript library packaged for setuptools
642e33
(easy_install) / pip.
642e33
642e33
%endif
642e33
642e33
%prep
642e33
%setup -q -n %{pypi_name}-%{version}
642e33
642e33
# patch to use webassets dir
642e33
sed -i "s|^BASE_DIR = .*|BASE_DIR = '%{_jsdir}/mdi'|" xstatic/pkg/mdi/__init__.py
642e33
# License file is present in GitHub repo, but not in PyPi file
642e33
cp %{SOURCE1} .
642e33
642e33
%build
642e33
%if %{with python2}
642e33
%{__python2} setup.py build
642e33
%endif
642e33
642e33
%if %{with python3}
642e33
%{__python3} setup.py build
642e33
%endif
642e33
642e33
%install
642e33
%if %{with python2}
642e33
%{__python2} setup.py install --skip-build --root %{buildroot}
642e33
# Move fonts to the right directory
642e33
mkdir -p %{buildroot}/%{_datadir}/fonts/mdi
642e33
mv %{buildroot}/%{python2_sitelib}/xstatic/pkg/mdi/data/fonts/* %{buildroot}/%{_datadir}/fonts/mdi
642e33
rmdir %{buildroot}/%{python2_sitelib}/xstatic/pkg/mdi/data/fonts
642e33
# Move static files
642e33
mkdir -p %{buildroot}/%{_jsdir}/mdi
642e33
mv %{buildroot}/%{python2_sitelib}/xstatic/pkg/mdi/data/css %{buildroot}/%{_jsdir}/mdi
642e33
mv %{buildroot}/%{python2_sitelib}/xstatic/pkg/mdi/data/scss %{buildroot}/%{_jsdir}/mdi
642e33
# link fonts
642e33
mkdir %{buildroot}/%{_jsdir}/mdi/fonts
642e33
pushd %{buildroot}/%{_jsdir}/mdi/fonts
642e33
ln -s ../../../fonts/mdi/materialdesignicons-* .
642e33
popd
642e33
%endif
642e33
642e33
%if %{with python3}
642e33
%{__python3} setup.py install --skip-build --root %{buildroot}
642e33
# Move fonts to the right directory
642e33
mkdir -p %{buildroot}/%{_datadir}/fonts/mdi
642e33
mv %{buildroot}/%{python3_sitelib}/xstatic/pkg/mdi/data/fonts/* %{buildroot}/%{_datadir}/fonts/mdi
642e33
rmdir %{buildroot}/%{python3_sitelib}/xstatic/pkg/mdi/data/fonts
642e33
# Move static files
642e33
mkdir -p %{buildroot}/%{_jsdir}/mdi
642e33
mv %{buildroot}/%{python3_sitelib}/xstatic/pkg/mdi/data/css %{buildroot}/%{_jsdir}/mdi
642e33
mv %{buildroot}/%{python3_sitelib}/xstatic/pkg/mdi/data/scss %{buildroot}/%{_jsdir}/mdi
642e33
# link fonts
642e33
mkdir %{buildroot}/%{_jsdir}/mdi/fonts
642e33
pushd %{buildroot}/%{_jsdir}/mdi/fonts
642e33
ln -s ../../../fonts/mdi/materialdesignicons-* .
642e33
popd
642e33
642e33
%endif
642e33
642e33
%if %{with python2}
642e33
%files -n python2-%{pypi_name}
642e33
%doc README.txt 
642e33
%license LICENSE
642e33
%{python2_sitelib}/xstatic/pkg/mdi
642e33
%{python2_sitelib}/XStatic_mdi-%{version}-py?.?.egg-info
642e33
%{python2_sitelib}/XStatic_mdi-%{version}-py?.?-nspkg.pth
642e33
%endif
642e33
642e33
%files -n mdi-common
642e33
%license LICENSE
642e33
%{_jsdir}/mdi
642e33
642e33
%files -n mdi-fonts
642e33
%license LICENSE
642e33
%{_datadir}/fonts/mdi
642e33
642e33
%if %{with python3}
642e33
%files -n python3-%{pypi_name}
642e33
%doc README.txt 
642e33
%license LICENSE
642e33
%{python3_sitelib}/xstatic/pkg/mdi
642e33
%{python3_sitelib}/XStatic_mdi-%{version}-py%{python3_version}.egg-info
642e33
%{python3_sitelib}/XStatic_mdi-%{version}-py%{python3_version}-nspkg.pth
642e33
%endif
642e33
642e33
%changelog
642e33
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.50.2-4
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
642e33
642e33
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.50.2-3
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
642e33
642e33
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.6.50.2-2
642e33
- Rebuilt for Python 3.9
642e33
642e33
* Thu Mar 26 2020 Radomir Dopieralski <rdopiera@redhat.com> - 1.6.50.2-1
642e33
- Update to 1.6.50.2
642e33
642e33
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.57.0-14
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
642e33
642e33
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.4.57.0-13
642e33
- Rebuilt for Python 3.8.0rc1 (#1748018)
642e33
642e33
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.4.57.0-12
642e33
- Rebuilt for Python 3.8
642e33
642e33
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.57.0-11
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
642e33
642e33
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.57.0-10
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
642e33
642e33
* Thu Sep 13 2018 Javier Peña <jpena@redhat.com> - 1.4.57.0-9
642e33
- Removed Python 2 package from Fedora 30+ (bz#1627370)
642e33
642e33
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.57.0-8
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
642e33
642e33
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.4.57.0-7
642e33
- Rebuilt for Python 3.7
642e33
642e33
* Fri Feb 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.4.57.0-6
642e33
- Update Python 2 dependency declarations to new packaging standards
642e33
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
642e33
642e33
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.57.0-5
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
642e33
642e33
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.57.0-4
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
642e33
642e33
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.57.0-3
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
642e33
642e33
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.4.57.0-2
642e33
- Rebuild for Python 3.6
642e33
642e33
* Fri Aug 19 2016 Javier Peña <jpena@redhat.com> - 1.4.57.0-1
642e33
- Updated to upstream version 1.4.57.0
642e33
- Updated source URL
642e33
- License file is no longer included in source
642e33
642e33
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.70.1-6
642e33
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
642e33
642e33
* Thu May 12 2016 Matthias Runge <mrunge@redhat.com> - 1.1.70.1-5
642e33
- also link fonts (rhbz#1333600)
642e33
642e33
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.70.1-4
642e33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
642e33
642e33
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.70.1-3
642e33
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
642e33
642e33
* Fri Sep 04 2015 jpena <jpena@redhat.com> - 1.1.70.1-2
642e33
- Created fonts subpackage.
642e33
* Fri Sep 04 2015 jpena <jpena@redhat.com> - 1.1.70.1-1
642e33
- Initial package.