diff --git a/mkdocs.spec b/mkdocs.spec index 7875a7e..fcf4287 100644 --- a/mkdocs.spec +++ b/mkdocs.spec @@ -8,11 +8,17 @@ URL: http://www.mkdocs.org/ Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz #https://github.com/mkdocs/mkdocs/pull/687 Source1: mkdocs.1 +Patch0: python37.patch BuildArch: noarch BuildRequires: python3-setuptools BuildRequires: python3-devel + +# When python3 is updated to 3.N+1, we need to bootstrap mkdocs, because it BRs self +%bcond_without bootstrap + +%if %{without bootstrap} BuildRequires: python3-tornado BuildRequires: python3-PyYAML BuildRequires: python3-markdown @@ -22,12 +28,14 @@ BuildRequires: livereload BuildRequires: fontawesome-fonts BuildRequires: fontawesome-fonts-web BuildRequires: js-highlight +BuildRequires: mkdocs BuildRequires: mkdocs-bootstrap BuildRequires: mkdocs-bootswatch BuildRequires: mkdocs-cinder BuildRequires: mkdocs-material BuildRequires: js-jquery BuildRequires: js-jquery1 +%endif # Force file requeriments to avoid broken sym links. BuildRequires: /usr/share/fonts/fontawesome/FontAwesome.otf @@ -76,7 +84,7 @@ GitHub Pages. Documentation for %{name}. %prep -%setup -q -n %{name}-%{version} +%autosetup -p1 -n %{name}-%{version} rm -rf %{name}.egg.info @@ -121,6 +129,7 @@ ln -sf %{_datadir}/javascript/jquery/latest/jquery.min.js \ ln -sf %{_datadir}/javascript/jquery/1/jquery.min.js \ %{buildroot}/%{python3_sitelib}/%{name}/themes/mkdocs/js/jquery-1.10.2.min.js +%if %{without bootstrap} # Build docs with self and verify all works fine. PATH=%{buildroot}%{_bindir}:$PATH which mkdocs @@ -145,6 +154,7 @@ do mkdocs build --theme $theme done popd +%endif # without bootstrap %files %doc README.md @@ -156,11 +166,14 @@ popd %files docs %license LICENSE +%if %{without bootstrap} %doc site/* +%endif %changelog -* Tue Jun 19 2018 Miro Hrončok - 0.16.3-6 -- Rebuilt for Python 3.7 +* Mon Jul 09 2018 Miro Hrončok - 0.16.3-6 +- Bootstrap for Python 3.7 +- Add patch for Python 3.7 compatibility * Thu Feb 08 2018 Fedora Release Engineering - 0.16.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/python37.patch b/python37.patch new file mode 100644 index 0000000..c48f1c0 --- /dev/null +++ b/python37.patch @@ -0,0 +1,44 @@ +diff --git a/mkdocs/config/config_options.py b/mkdocs/config/config_options.py +index d5e656f..4e011e7 100644 +--- a/mkdocs/config/config_options.py ++++ b/mkdocs/config/config_options.py +@@ -363,7 +363,7 @@ class Extras(OptionallyRequired): + def walk_docs_dir(self, docs_dir): + + if self.file_match is None: +- raise StopIteration ++ return + + for (dirpath, dirs, filenames) in os.walk(docs_dir): + dirs.sort() +diff --git a/mkdocs/nav.py b/mkdocs/nav.py +index fb092e6..383780e 100644 +--- a/mkdocs/nav.py ++++ b/mkdocs/nav.py +@@ -262,7 +262,7 @@ def _follow(config_line, url_context, use_dir_urls, header=None, title=None): + header.children.append(page) + + yield page +- raise StopIteration ++ return + + elif not isinstance(config_line, dict): + msg = ("Line in 'page' config is of type {0}, dict or string " +@@ -275,7 +275,7 @@ def _follow(config_line, url_context, use_dir_urls, header=None, title=None): + "config contains an invalid entry: {0}".format(config_line)) + elif len(config_line) == 0: + log.warning("Ignoring empty line in the pages config.") +- raise StopIteration ++ return + + next_cat_or_title, subpages_or_path = next(iter(config_line.items())) + +@@ -283,7 +283,7 @@ def _follow(config_line, url_context, use_dir_urls, header=None, title=None): + path = subpages_or_path + for sub in _follow(path, url_context, use_dir_urls, header=header, title=next_cat_or_title): + yield sub +- raise StopIteration ++ return + + elif not isinstance(subpages_or_path, list): + msg = ("Line in 'page' config is of type {0}, list or string "