Blame python-notebook.spec

066a4d0
# Unset -s on python shebang - ensure that extensions installed with pip
066a4d0
# to user locations are seen and properly loaded
066a4d0
%global py3_shebang_flags %nil
066a4d0
9e2c5e6
Name:           python-notebook
db5e28b
%global _docdir_fmt %{name}
db5e28b
9949d56
# Updating this package? Update the list of bundled things bellow
f95f9e2
Version:        6.4.7
db5e28b
ee7b19d
# a tag like rc1, set to %%{nil} if stable
8598565
%global tag %{nil}
ee7b19d
ee7b19d
# upstream version, like 1.2.3rc1
ee7b19d
%global uversion %{version}%{tag}
db5e28b
f95f9e2
Release:        1%{tag}%{?dist}
ee7b19d
Summary:        A web-based notebook environment for interactive computing
db5e28b
License:        BSD
6f8c843
URL:            https://jupyter.org
9e2c5e6
Source0:        %pypi_source notebook %{uversion}
f9fba47
e5982eb
# Patch to use the TeX fonts from the MathJax package rather than STIXWeb
e5982eb
# See BZ: 1581899, 1580129
e5982eb
Patch0:         0001-Use-MathJax-TeX-fonts-rather-than-STIXWeb.patch
e5982eb
db5e28b
BuildArch:      noarch
db5e28b
db5e28b
BuildRequires:  python3-devel
db5e28b
5d4782b
BuildRequires:  git-core
f9fba47
ee7b19d
# rebuilding js and css
ee7b19d
BuildRequires:  /usr/bin/node
ee7b19d
e167a28
# for tests
e167a28
BuildRequires:  pandoc
8598565
4004e0e
# for validating desktop entry
4004e0e
BuildRequires: desktop-file-utils
4004e0e
db5e28b
%global _description \
db5e28b
The Jupyter Notebook is a web application that allows you to create and \
db5e28b
share documents that contain live code, equations, visualizations, and \
db5e28b
explanatory text. The Notebook has support for multiple programming \
db5e28b
languages, sharing, and interactive widgets.
db5e28b
db5e28b
%description %_description
db5e28b
9e2c5e6
%package -n     python3-notebook
86c398d
Summary:        %{summary}
ef92928
%py_provides    python3-jupyter-notebook
ef92928
%py_provides    python3-ipython-notebook
ef92928
%py_provides    notebook
ef92928
%py_provides    jupyter-notebook
db5e28b
db5e28b
Requires:       fontawesome-fonts
db5e28b
Requires:       fontawesome-fonts-web
7733f87
Requires:       mathjax >= 2.6
db5e28b
Requires:       js-backbone >= 1.2
d02428e
Requires:       js-marked >= 0.7
ee7b19d
Requires:       js-underscore >= 1.8.3
4004e0e
Requires:       hicolor-icon-theme
db5e28b
db5e28b
# Versions from bower.json
9949d56
Provides:       bundled(bootstrap) = 3.4
db5e28b
Provides:       bundled(bootstrap-tour) = 0.9.0
d02428e
Provides:       bundled(codemirror) = 5.56.0
d101ac6
Provides:       bundled(create-react-class) = 15.6.3
db5e28b
Provides:       bundled(es6-promise) = 1.0
ee7b19d
Provides:       bundled(jed) = 1.1.1
d02428e
Provides:       bundled(jquery) = 3.5.0
2c32606
Provides:       bundled(jquery-typeahead) = 2.10.6
9b6b337
Provides:       bundled(jquery-ui) = 1.12
88d75c6
Provides:       bundled(moment) = 2.19.3
d101ac6
Provides:       bundled(react) = 16.0.0
9b6b337
Provides:       bundled(requirejs) = 2.2
ee7b19d
Provides:       bundled(requirejs-text) = 2.0.15
ee7b19d
Provides:       bundled(requirejs-plugins) = 1.0.3
db5e28b
Provides:       bundled(text-encoding) = 0.1
d02428e
Provides:       bundled(xterm.js) = 3.1.0
f95f9e2
Provides:       bundled(xterm.js-css) = 3.1.0
f95f9e2
Provides:       bundled(xterm.js-fit) = 3.1.0
d69cb34
# See https://bugzilla.redhat.com/show_bug.cgi?id=1580129
5b4ad04
#Provides:       bundled(mathjax) = 2.7.4
db5e28b
9e2c5e6
%description -n python3-notebook %_description
db5e28b
db5e28b
db5e28b
%prep
9e2c5e6
%autosetup -n notebook-%{uversion} -S git
db5e28b
e167a28
# The nbval package is used for validation of notebooks.
e167a28
# It's sedded out because it isn't yet packaged in Fedora.
e167a28
#
e167a28
# Selenium tests are skipped.
e167a28
# We don't test coverage.
7722c40
for pkg in nbval selenium coverage pytest-cov; do
e167a28
  sed -Ei "s/'$pkg',? ?//" setup.py
e167a28
done
e167a28
e167a28
e167a28
%generate_buildrequires
3d7e153
%pyproject_buildrequires -x test
e167a28
e167a28
db5e28b
%build
e167a28
%pyproject_wheel
db5e28b
db5e28b
db5e28b
%install
e167a28
%pyproject_install
db5e28b
666b2ca
# Don't use %%pyproject_save_files, because we'll change a lot
f9fba47
db5e28b
# unbundle stuff
9e2c5e6
pushd %{buildroot}%{python3_sitelib}/notebook/static/components
db5e28b
db5e28b
  rm -r font-awesome/fonts
db5e28b
  ln -vfs %{_datadir}/fonts/fontawesome font-awesome/fonts
db5e28b
d69cb34
  #temporarily kept bundled to workaround #1580129
e5982eb
  rm -r MathJax
e5982eb
  ln -vfs %{_datadir}/javascript/mathjax MathJax
db5e28b
db5e28b
  rm -r backbone
db5e28b
  ln -vfs %{_datadir}/javascript/backbone backbone
db5e28b
db5e28b
  rm -r marked/lib
db5e28b
  ln -vfs %{_datadir}/javascript/marked marked/lib
db5e28b
db5e28b
  rm -r underscore
db5e28b
  ln -vfs %{_datadir}/javascript/underscore underscore
db5e28b
7112eb6
popd
db5e28b
0f7a1c0
# Remove packaged tests
9e2c5e6
rm -rv $(find %{buildroot}%{python3_sitelib}/notebook -type d -name tests)
0f7a1c0
666b2ca
# Remove .po files
9e2c5e6
rm -v $(find %{buildroot}%{python3_sitelib}/notebook/i18n -type f -name '*.po')
666b2ca
db5e28b
db5e28b
%check
6127bc0
# Workaround: OSError: [Errno 18] Invalid cross-device link: b'/tmp/...' -> b'/builddir/.local/share/Trash/files/...'
6127bc0
mkdir .tmp
6127bc0
export TMPDIR=$(pwd)/.tmp
6127bc0
d02428e
%pytest --ignore notebook/tests/selenium
db5e28b
4004e0e
desktop-file-validate %{buildroot}%{_datadir}/applications/jupyter-notebook.desktop
db5e28b
89be135
# This was previously unbundled, but no more
89be135
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/
9e2c5e6
%pretrans -n python3-notebook -p <lua>
9e2c5e6
path = "%{python3_sitelib}/notebook/static/components/moment"
89be135
st = posix.stat(path)
89be135
if st and st.type == "link" then
89be135
  os.remove(path)
89be135
end
89be135
89be135
9e2c5e6
%files -n python3-notebook
db5e28b
%doc README.md
d101ac6
%license LICENSE
f9fba47
%{_bindir}/jupyter-bundlerextension
db5e28b
%{_bindir}/jupyter-nbextension
db5e28b
%{_bindir}/jupyter-serverextension
db5e28b
%{_bindir}/jupyter-notebook
666b2ca
%{python3_sitelib}/notebook-%{version}.dist-info/
666b2ca
666b2ca
# Exclude i18n:
666b2ca
%dir %{python3_sitelib}/notebook/
666b2ca
%{python3_sitelib}/notebook/[_a-hj-z]*
666b2ca
666b2ca
# Language files (could be scripted, but is short)
666b2ca
%dir %{python3_sitelib}/notebook/i18n/
666b2ca
%{python3_sitelib}/notebook/i18n/*.py
666b2ca
%{python3_sitelib}/notebook/i18n/__pycache__/
666b2ca
%lang(fr) %{python3_sitelib}/notebook/i18n/fr_FR/
666b2ca
%lang(ja) %{python3_sitelib}/notebook/i18n/ja_JP/
666b2ca
%lang(nl) %{python3_sitelib}/notebook/i18n/nl/
666b2ca
%lang(ru) %{python3_sitelib}/notebook/i18n/ru_RU/
666b2ca
%lang(zh) %{python3_sitelib}/notebook/i18n/zh_CN/
666b2ca
4004e0e
# Desktop integration
4004e0e
%{_datadir}/applications/jupyter-notebook.desktop
4004e0e
%{_datadir}/icons/hicolor/scalable/apps/notebook.svg
4004e0e
db5e28b
db5e28b
%changelog
f95f9e2
* Tue Jan 25 2022 Miro Hrončok <mhroncok@redhat.com> - 6.4.7-1
f95f9e2
- Update to 6.4.7
f95f9e2
- Fixes: rhbz#2039905
f95f9e2
160463d
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 6.4.6-3
160463d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
160463d
066a4d0
* Mon Nov 29 2021 Karolina Surma <ksurma@redhat.com> - 6.4.6-2
066a4d0
- Remove -s from Python shebang in `jupyter-*` executables
066a4d0
  to let Jupyter see pip installed extensions
066a4d0
495083b
* Wed Nov 24 2021 Karolina Surma <ksurma@redhat.com> - 6.4.6-1
495083b
- Update to 6.4.6
495083b
Resolves: rhbz#2023994
495083b
166b2c0
* Tue Oct 26 2021 Lumír Balhar <lbalhar@redhat.com> - 6.4.5-1
166b2c0
- Update to 6.4.5
166b2c0
Resolves: rhbz#2004590
166b2c0
29d0a88
* Wed Aug 11 2021 Tomas Hrnciar <thrnciar@redhat.com> - 6.4.3-1
29d0a88
- Update to 6.4.3
29d0a88
- Fixes: rhbz#1990615
29d0a88
- Fixes: rhbz#1992573
29d0a88
b66feca
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.4.0-3
b66feca
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
b66feca
3285c1f
* Thu Jun 24 2021 Lumír Balhar <lbalhar@redhat.com> - 6.4.0-1
3285c1f
- Update to 6.4.0
3285c1f
Resolves: rhbz#1956754
3285c1f
dc26763
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 6.3.0-2
dc26763
- Rebuilt for Python 3.10
dc26763
4004e0e
* Tue Mar 23 2021 Karolina Surma <ksurma@redhat.com> - 6.3.0-1
4004e0e
- Update to 6.3.0
4004e0e
Resolves: rhbz#1941573
4004e0e
- Add desktop entry
4004e0e
Resolves: rhbz#1275800
4004e0e
- Remove documentation subpackage
4004e0e
51f1b38
* Thu Feb 18 2021 Lumír Balhar <lbalhar@redhat.com> - 6.2.0-1
51f1b38
- Update to 6.2.0
51f1b38
Resolves: rhbz#1915896
51f1b38
d4cab3c
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.6-2
d4cab3c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
d4cab3c
7722c40
* Thu Jan 07 2021 Miro Hrončok <mhroncok@redhat.com> - 6.1.6-1
7722c40
- Update to 6.1.6
7722c40
- Fixes: rhbz#1895357
7722c40
d02428e
* Thu Sep 10 2020 Tomas Hrnciar <thrnciar@redhat.com> - 6.1.4-1
d02428e
- Update to 6.1.4
d02428e
- fixes rhbz#1844874
d02428e
8bf24ab
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.3-8
8bf24ab
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
8bf24ab
0f7a1c0
* Thu Jun 11 2020 Miro Hrončok <mhroncok@redhat.com> - 6.0.3-7
0f7a1c0
- Remove packaged tests
0f7a1c0
04c7998
* Mon May 25 2020 Miro Hrončok <mhroncok@redhat.com> - 6.0.3-6
04c7998
- Rebuilt for Python 3.9
04c7998
2c32606
* Sat Apr 18 2020 Miro Hrončok <mhroncok@redhat.com> - 6.0.3-5
2c32606
- Update to 6.0.3 (#1793671)
2c32606
89be135
* Thu Mar 12 2020 Miro Hrončok <mhroncok@redhat.com> - 6.0.2-4
89be135
- Workaround RPM problems when replacing a directory with a symbolic link (#1787079)
89be135
2287f1e
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.2-3
2287f1e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2287f1e
88d75c6
* Thu Dec 26 2019 Miro Hrončok <mhroncok@redhat.com> - 6.0.2-2
88d75c6
- Use bundled JavaScript moment, the Fedora one was retired
88d75c6
d101ac6
* Tue Nov 12 2019 Miro Hrončok <mhroncok@redhat.com> - 6.0.2-1
d101ac6
- Update to 6.0.2 (#1724407)
d101ac6
19797ae
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 5.7.8-4
19797ae
- Rebuilt for Python 3.8.0rc1 (#1748018)
19797ae
8d02208
* Sun Aug 18 2019 Miro Hrončok <mhroncok@redhat.com> - 5.7.8-3
8d02208
- Rebuilt for Python 3.8
8d02208
8005092
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.7.8-2
8005092
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
8005092
3e52c5a
* Mon Apr 01 2019 Miro Hrončok <mhroncok@redhat.com> - 5.7.8-1
3e52c5a
- Update to 5.7.8, refix CVE-2019-10255
3e52c5a
9949d56
* Sun Mar 31 2019 Miro Hrončok <mhroncok@redhat.com> - 5.7.7-1
9949d56
- Update to 5.7.7, fix CVE-2019-9644 and CVE-2019-10255
9949d56
dd30bf7
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.7.2-2
dd30bf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
dd30bf7
9b6b337
* Wed Nov 21 2018 Miro Hrončok <mhroncok@redhat.com> - 5.7.2-1
9b6b337
- Update to 5.7.2, fix CVE-2018-19351, CVE-2018-19352 (#1651976)
9b6b337
7112eb6
* Wed Nov 07 2018 Miro Hrončok <mhroncok@redhat.com> - 5.6.0-3
7112eb6
- Drop the python2 leaf subpackage again (#1647377)
7112eb6
7733f87
* Mon Aug 13 2018 Miro Hrončok <mhroncok@redhat.com> - 5.6.0-2
7733f87
- Require mathjax from python3-notebook (#1615192)
7733f87
5b4ad04
* Mon Jul 23 2018 Miro Hrončok <mhroncok@redhat.com> - 5.6.0-1
5b4ad04
- Update to 5.6.0 (#1601163)
5b4ad04
0d0d82e
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.0-7
0d0d82e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0d0d82e
17165c2
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 5.5.0-6
17165c2
- Rebuilt for Python 3.7
17165c2
340d0a1
* Tue Jun 05 2018 Miro Hrončok <mhroncok@redhat.com> - 5.5.0-5
340d0a1
- Reintroduce the python2 subpackage for sagemath
340d0a1
047c66c
* Sun May 27 2018 Miro Hrončok <mhroncok@redhat.com> - 5.5.0-4
bf12bbe
- Drop the python2 leaf subpackage
bf12bbe
e5982eb
* Sat May 26 2018 Jonathan Underwood <jonathan.underwood@gmail.com> - 5.5.0-3
e5982eb
- Unbundle mathjax once more
e5982eb
- Add patch to use the MathJax TeX fonts rather than the STIXWeb ones BZ: 1581899, 1580129
e5982eb
f5a8f4a
* Wed May 23 2018 Miro Hrončok <mhroncok@redhat.com> - 5.5.0-2
f5a8f4a
- BR ipykernel >= 4.8 (#1581723)
d69cb34
- Temporarily keep bundled mathjax (#1580129)
f5a8f4a
9d29234
* Fri May 11 2018 Miro Hrončok <mhroncok@redhat.com> - 5.5.0-1
9d29234
- Update to 5.5.0 (#1557990)
9d29234
- Disable selenium tests and rm them from python2 sitelib
9d29234
1c2210a
* Wed Mar 21 2018 Miro Hrončok <mhroncok@redhat.com> - 5.4.0-2
1c2210a
- Security fix for CVE-2018-8768 (#1558783)
1c2210a
973abb1
* Wed Feb 21 2018 Miro Hrončok <mhroncok@redhat.com> - 5.4.0-1
973abb1
- Update to 5.4.0 (#1535263)
973abb1
1521683
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.0-2
1521683
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1521683
8598565
* Fri Jan 19 2018 Miro Hrončok <mhroncok@redhat.com> - 5.3.0-1
8598565
- Update to 5.3.0
8598565
- Enable automatic dependency generator, drop manual Python requires
8598565
5d4782b
* Tue Jan 09 2018 Miro Hrončok <mhroncok@redhat.com> - 5.3.0-0.1.rc1
5d4782b
- Update to new 5.3.0rc1 version (#1532430)
5d4782b
- Only BR git-core instead of full git, it is sufficient
5d4782b
- Be more explciit about (Build)Required versions
5d4782b
- Require send2trash, dateutil
5d4782b
f7de79c
* Thu Nov 23 2017 Miro Hrončok <mhroncok@redhat.com> - 5.2.1-1
f7de79c
- Update to new 5.2.1 version (#1504386)
f7de79c
a4bc621
* Fri Sep 15 2017 Miro Hrončok <mhroncok@redhat.com> - 5.1.0-1
a4bc621
- Update to new 5.1.0 final version (#1491890)
a4bc621
00e5246
* Tue Sep 12 2017 Miro Hrončok <mhroncok@redhat.com> - 5.1.0-0.2.rc3
00e5246
- Update to new 5.1.0rc3 version (#1490880)
00e5246
- Remove 2 merged patches
00e5246
ee7b19d
* Wed Aug 23 2017 Miro Hrončok <mhroncok@redhat.com> - 5.1.0-0.1.rc2
ee7b19d
- Update to new 5.1.0rc2 version (#1482722)
ee7b19d
- Use node to compile JS and CSS
ee7b19d
b6640e0
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.0-2
b6640e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
b6640e0
f9fba47
* Tue Apr 04 2017 Miro Hrončok <mhroncok@redhat.com> - 5.0.0-1
f9fba47
- Update to new 5.0.0 version (#1438917)
f9fba47
- Use autosetup with git
ca63d9b
- Add the license file to the doc subpackage
f9fba47
8b5844d
* Fri Mar 17 2017 Miro Hrončok <mhroncok@redhat.com> - 4.4.1-3
8b5844d
- Recommend terminado
8b5844d
db5e28b
* Tue Feb 21 2017 Miro Hrončok <mhroncok@redhat.com> - 4.4.1-2
db5e28b
- Make sure the Python 3 executables are really Python 3
db5e28b
- Build the docs
db5e28b
- Run the tests
db5e28b
- Use python2- where possible
db5e28b
- Unbundle some things, declare the rest
db5e28b
- Use the %%_description macro consistently
db5e28b
- Provide pythonX-jupyter-notebook
db5e28b
- Provide/Obsolete pythonX-ipython-notebook
db5e28b
db5e28b
* Thu Feb 09 2017 Thomas Spura <tomspur@fedoraproject.org> - 4.4.1-1
db5e28b
- rename to python-notebook
db5e28b
- only ship python3 executables
db5e28b
- update to 4.4.1
db5e28b
db5e28b
* Mon Apr 18 2016 Thomas Spura <tomspur@fedoraproject.org> - 4.2.0-1
db5e28b
- Initial package.