From 391fe6e560b370574ec907e3694045ba4c86fe03 Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Sep 19 2018 10:18:11 +0000 Subject: Namespace the dirs in the data packages --- diff --git a/0001-matplotlibrc-path-search-fix.patch b/0001-matplotlibrc-path-search-fix.patch index ba5a68c..7c85c5d 100644 --- a/0001-matplotlibrc-path-search-fix.patch +++ b/0001-matplotlibrc-path-search-fix.patch @@ -17,7 +17,7 @@ index c5accc3c3..bc38f316c 100644 _file = _decode_filesystem_path(__file__) path = os.sep.join([os.path.dirname(_file), 'mpl-data']) -+ path = '/usr/share/matplotlib/mpl-data' ++ path = '/usr/share/python2-matplotlib/mpl-data' if os.path.isdir(path): return path @@ -32,7 +32,7 @@ index c5accc3c3..bc38f316c 100644 - - Lastly, it looks in `$MATPLOTLIBDATA/matplotlibrc` for a - system-defined copy. -+ - Lastly, it looks in `/etc/matplotlibrc` for a system-defined copy. ++ - Lastly, it looks in `/etc/python2-matplotlibrc` for a system-defined copy. """ def gen_candidates(): @@ -41,7 +41,7 @@ index c5accc3c3..bc38f316c 100644 yield os.path.join(matplotlibrc, 'matplotlibrc') yield os.path.join(_get_configdir(), 'matplotlibrc') - yield os.path.join(get_data_path(), 'matplotlibrc') -+ yield '/etc/matplotlibrc' ++ yield '/etc/python2-matplotlibrc' for fname in gen_candidates(): if os.path.exists(fname): @@ -60,10 +60,10 @@ index c0378e1bf..7f14bcc46 100644 + if 'MATPLOTLIBDATA' in os.environ: + # ... in buildroot. + return os.path.join(os.environ['MATPLOTLIBDATA'], -+ '../../../../etc/matplotlibrc') ++ '../../../../etc/python2-matplotlibrc') + else: + # ... on installed systems. -+ return '/etc/matplotlibrc' ++ return '/etc/python2-matplotlibrc' + + +def test_if_rctemplate_is_up_to_date(mplrc): diff --git a/python2-matplotlib.spec b/python2-matplotlib.spec index 3666417..32c28de 100644 --- a/python2-matplotlib.spec +++ b/python2-matplotlib.spec @@ -58,7 +58,7 @@ Patch0001: 0001-Force-using-system-qhull.patch # https://github.com/QuLogic/matplotlib/tree/fedora-patches-non-x86 # Updated test images for new FreeType. Source1000: https://github.com/QuLogic/mpl-images/archive/v%{version}-with-freetype-%{ftver}/matplotlib-%{version}-with-freetype-%{ftver}.tar.gz -# Search in /etc/matplotlibrc: +# Search in /etc/python2-matplotlibrc: Patch1001: 0001-matplotlibrc-path-search-fix.patch # Image tolerances for anything but x86_64: Patch1002: 0002-Increase-tolerances-for-non-x86_64-arches.patch @@ -315,13 +315,13 @@ MPLCONFIGDIR=$PWD \ MATPLOTLIBDATA=$PWD/lib/matplotlib/mpl-data/ \ %{__python2} setup.py install -O1 --skip-build --root=%{buildroot} chmod +x %{buildroot}%{python2_sitearch}/matplotlib/dates.py -mkdir -p %{buildroot}%{_sysconfdir} %{buildroot}%{_datadir}/matplotlib +mkdir -p %{buildroot}%{_sysconfdir} %{buildroot}%{_datadir}/python2-matplotlib mv %{buildroot}%{python2_sitearch}/matplotlib/mpl-data/matplotlibrc \ - %{buildroot}%{_sysconfdir} + %{buildroot}%{_sysconfdir}/python2-matplotlibrc mv %{buildroot}%{python2_sitearch}/matplotlib/mpl-data \ - %{buildroot}%{_datadir}/matplotlib + %{buildroot}%{_datadir}/python2-matplotlib %if !%{with_bundled_fonts} -rm -rf %{buildroot}%{_datadir}/matplotlib/mpl-data/fonts +rm -rf %{buildroot}%{_datadir}/python2-matplotlib/mpl-data/fonts %endif %if %{run_tests} @@ -341,7 +341,7 @@ echo "backend : %{backend}" > matplotlibrc # * test_invisible_Line_rendering: Checks for "slowness" that often fails on a # heavily-loaded builder. MPLCONFIGDIR=$PWD \ -MATPLOTLIBDATA=%{buildroot}%{_datadir}/matplotlib/mpl-data \ +MATPLOTLIBDATA=%{buildroot}%{_datadir}/python2-matplotlib/mpl-data \ PYTHONPATH=%{buildroot}%{python2_sitearch} \ PYTHONDONTWRITEBYTECODE=1 \ xvfb-run -a -s "-screen 0 640x480x24" \ @@ -351,7 +351,7 @@ PYTHONDONTWRITEBYTECODE=1 \ # We run these separately because they have issues when run in parallel. MPLCONFIGDIR=$PWD \ -MATPLOTLIBDATA=%{buildroot}%{_datadir}/matplotlib/mpl-data \ +MATPLOTLIBDATA=%{buildroot}%{_datadir}/python2-matplotlib/mpl-data \ PYTHONPATH=%{buildroot}%{python2_sitearch} \ PYTHONDONTWRITEBYTECODE=1 \ xvfb-run -a -s "-screen 0 640x480x24" \ @@ -360,15 +360,15 @@ PYTHONDONTWRITEBYTECODE=1 \ %endif # run_tests %files -n python2-matplotlib-data -%{_sysconfdir}/matplotlibrc -%{_datadir}/matplotlib/mpl-data/ +%{_sysconfdir}/python2-matplotlibrc +%{_datadir}/python2-matplotlib/mpl-data/ %if %{with_bundled_fonts} -%exclude %{_datadir}/matplotlib/mpl-data/fonts/ +%exclude %{_datadir}/python2-matplotlib/mpl-data/fonts/ %endif %if %{with_bundled_fonts} %files -n python2-matplotlib-data-fonts -%{_datadir}/matplotlib/mpl-data/fonts/ +%{_datadir}/python2-matplotlib/mpl-data/fonts/ %endif %files -n python2-matplotlib