Blob Blame History Raw
%global pypi_name XStatic-D3

Name:           python-%{pypi_name}
Version:        3.1.6.2
Release:        2%{?dist}
Summary:        D3 (XStatic packaging standard)

License:        BSD
URL:            http://d3js.org/
Source0:        https://pypi.python.org/packages/source/X/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch
 
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  web-assets-devel

Requires: python-XStatic
Requires: web-assets-filesystem


%description
D3 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

%prep
%setup -q -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

# patch to use webassets dir
sed -i "s|^BASE_DIR = .*|BASE_DIR = '%{_jsdir}/d3'|" xstatic/pkg/d3/__init__.py


%build
# due 
# https://bitbucket.org/thomaswaldmann/xstatic/issue/2/
# this package can not be built with python-XStatic installed.
%{__python2} setup.py build



%install
%{__python2} setup.py install --skip-build --root %{buildroot}
mkdir -p %{buildroot}/%{_jsdir}/d3
mv %{buildroot}/%{python2_sitelib}/xstatic/pkg/d3/data/d3.js %{buildroot}/%{_jsdir}/d3




%files
%doc README.txt
%{python2_sitelib}/xstatic/pkg/d3
%{python2_sitelib}/XStatic_D3-%{version}-py%{python_version}.egg-info
%{python2_sitelib}/XStatic_D3-%{version}-py%{python_version}-nspkg.pth
%{_jsdir}/d3

%changelog
* Thu Sep 04 2014 Matthias Runge <mrunge@redhat.com> - 3.1.6.2-2
- change BR to python2-devel

* Wed Aug 27 2014 Matthias Runge <mrunge@redhat.com> - 3.1.6.2-1
- Initial package.