## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec %global desc \ FSLeyes, the FSL image viewer # PyPi tar does not include tests # Upstream says the tests, since they use xvfb etc., may not always pass on all # platforms. %bcond_with xvfb_tests %global forgeurl https://github.com/pauldmccarthy/fsleyes Name: python-fsleyes Version: 1.3.3 Release: %autorelease Summary: FSLeyes, the FSL image viewer %global tag %{version} %forgemeta License: ASL 2.0 URL: %forgeurl Source0: %forgesource BuildArch: noarch %description %{desc} %package -n python3-fsleyes Summary: %{summary} BuildRequires: python3-devel BuildRequires: /usr/bin/desktop-file-install BuildRequires: /usr/bin/appstream-util Requires: hicolor-icon-theme # from requirements-dev.txt %if %{with xvfb_tests} BuildRequires: graphviz BuildRequires: %{py3_dist mock} BuildRequires: %{py3_dist pytest} BuildRequires: %{py3_dist pytest-cov} BuildRequires: %{py3_dist wxpython} BuildRequires: freeglut-devel BuildRequires: xorg-x11-server-Xvfb BuildRequires: python3-matplotlib-wx %endif Requires: dcm2niix Requires: python3-matplotlib-wx Provides: fsleyes = %{version}-%{release} %description -n python3-fsleyes %{desc} %package doc Summary: %{summary} %description doc This package contains documentation for %{name}. %prep %forgesetup # remove jinja version fix # https://github.com/pauldmccarthy/fsleyes/issues/82 sed -i 's/jinja2.*/jinja2/' requirements.txt # extras: not yet packaged in Fedora sed -i '/file-tree/ d' requirements-extra.txt # Add extra requirements for autogenerator cat requirements-extra.txt >> requirements.txt cat requirements-notebook.txt >> requirements.txt # Remove unnecessary upper limit on Pillow: # https://github.com/pauldmccarthy/fsleyes/issues/7 # sed -i 's/\(Pillow>=3.2.0\),.*/\1/' requirements.txt # remove unneeded shebangs find . -name "*py" -exec sed -i '/#!\/usr\/bin\/env python/ d' '{}' \; %generate_buildrequires %pyproject_buildrequires -r requirements.txt requirements-dev.txt %build %pyproject_wheel # Build documentation %{python3} setup.py userdoc %{python3} setup.py apidoc # Remove build artefacts pushd userdoc rm -frv html/.buildinfo rm -frv html/.doctrees mv html userdoc_html popd pushd apidoc rm -frv html/.buildinfo rm -frv html/.doctrees mv html apidoc_html popd %install %pyproject_install %pyproject_save_files fsleyes # remove docs installed in the python bits rm -rfv %{buildroot}/%{python3_sitelib}/fsleyes/userdoc # install desktop file in correct location desktop-file-install --dir=%{buildroot}%{_datadir}/applications fsleyes/assets/linux/uk.ac.ox.fmrib.FSLeyes.desktop rm -f %{python3_sitelib}/fsleyes/assets/linux/uk.ac.ox.fmrib.FSLeyes.desktop # install appdata file install -p -m 0644 -D -t %{buildroot}%{_metainfodir} fsleyes/assets/linux/uk.ac.ox.fmrib.FSLeyes.appdata.xml appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*FSLeyes*xml rm -f %{python3_sitelib}/fsleyes/assets/linux/uk.ac.ox.fmrib.FSLeyes.appdata.xml # install icons to the right place pushd fsleyes/assets/icons/app_icon/fsleyes.iconset/ for size in 16 32 128 256 512 do install -p -m 0755 -D -T "icon_${size}x${size}.png" %{buildroot}%{_datadir}/icons/hicolor/"${size}x${size}"/apps/fsleyes.png done # do these manually install -p -m 0755 -D -T icon_32x32@2x.png %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/fsleyes.png install -p -m 0755 -D -T icon_512x512@2x.png %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/fsleyes.png popd # 48x58 is in a different place than the others install -p -m 0755 -D -t %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/ fsleyes/assets/linux/hicolor/48x48/apps/fsleyes.png %check export MPLBACKEND=wxagg %if %{with xvfb_tests} # https://github.com/pauldmccarthy/fsleyes/blob/master/.ci/test_template.sh export FSLEYES_TEST_GL=2.1 xvfb-run -s "-screen 0 640x480x24" pytest-%{python3_version} sleep 10 # test overlay types for GL14 as well export FSLEYES_TEST_GL=1.4 xvfb-run -s "-screen 0 640x480x24" pytest-%{python3_version} %endif %files -n python3-fsleyes -f %{pyproject_files} %doc README.rst %{_bindir}/fsleyes %{_bindir}/render %{_bindir}/fsleyes_unfiltered %{_metainfodir}/uk.ac.ox.fmrib.FSLeyes.appdata.xml %{_datadir}/icons/hicolor/*/apps/fsleyes.png %{_datadir}/applications/uk.ac.ox.fmrib.FSLeyes.desktop %files doc %license LICENSE COPYRIGHT %doc userdoc/userdoc_html apidoc/apidoc_html %changelog * Mon Jan 24 2022 Ankur Sinha (Ankur Sinha Gmail) 1.3.3-3 - feat: install icons and appdata file * Fri Jan 21 2022 Fedora Release Engineering 1.3.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Sun Jan 16 2022 Ankur Sinha (Ankur Sinha Gmail) 1.3.3-1 - feat: update to latest patch release * Mon Aug 09 2021 Ankur Sinha - 1.1.0-2 - Drop extra deps not yet in Fedora - fix Jinja2 version fix * Sat Aug 07 2021 Ankur Sinha - 1.1.0-1 - Update to latest release * Fri Jul 23 2021 Fedora Release Engineering - 0.34.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint - 0.34.2-3 - Rebuilt for Python 3.10 * Wed Jan 27 2021 Fedora Release Engineering - 0.34.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Fri Sep 04 2020 Ankur Sinha - 0.34.2-1 - Update to latest release * Wed Jul 29 2020 Fedora Release Engineering - 0.32.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Thu Jun 25 2020 Ankur Sinha - 0.32.3-3 - Explicitly BR setuptools * Tue May 26 2020 Miro Hrončok - 0.32.3-2 - Rebuilt for Python 3.9 * Fri May 01 2020 Ankur Sinha - 0.32.3-1 - Update to 0.32.3 * Fri Feb 21 2020 Ankur Sinha - 0.32.2-1 - Update to latest release * Sun Feb 16 2020 Ankur Sinha - 0.32.0-3 - Fix requirements to remove * since autogenerator doesnt like it * Thu Jan 30 2020 Fedora Release Engineering - 0.32.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Thu Nov 14 2019 Aniket Pradhan - 0.32.0-1 - Update to 0.32.0 * Mon Oct 28 2019 Ankur Sinha - 0.31.2-1 - Update to 0.31.2 * Mon Sep 23 2019 Aniket Pradhan - 0.31.0-1 - Update to 0.31.0 * Sat Aug 31 2019 Ankur Sinha - 0.30.1-1 - Update to 0.30.1 * Thu Aug 29 2019 Scott Talbert - 0.30.0-5 - Remove sed patches for sip and revert to wx.siplib (#1739469) * Mon Aug 19 2019 Miro Hrončok - 0.30.0-4 - Rebuilt for Python 3.8 * Fri Jul 26 2019 Fedora Release Engineering - 0.30.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Wed Jul 10 2019 Ankur Sinha - 0.30.0-2 - Add new bin file * Fri Jul 5 2019 Luis M. Segundo - 0.30.0-1 - Update to to 0.30.0 * Mon May 27 2019 Ankur Sinha - 0.29.0-1 - Update to 0.29.0 * Thu Apr 18 2019 Ankur Sinha - 0.28.3-1 - Update to latest release - Rely on automatic generator (enable for F<30) * Wed Apr 10 2019 Ankur Sinha - 0.28.1-1 - Update to 0.28.1 * Sat Feb 16 2019 Ankur Sinha - 0.27.3-1 - Update to latest upstream release * Sat Feb 02 2019 Fedora Release Engineering - 0.26.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Tue Nov 27 2018 Ankur Sinha - 0.26.4-3 - Remove unnecessary pillow version limit - Use wxpython4 and sip correctly from system * Mon Nov 26 2018 Ankur Sinha - 0.26.4-2 - Fix requires - Enable available requires * Fri Nov 09 2018 Ankur Sinha - 0.26.4-1 - Initial build