Name: neurofedora-desktop Version: 0.1 Release: 1%{?dist} Summary: Desktop integration for the NeuroFedora brain-imaging stack License: MIT URL: https://gitlab.com/morgan.hough/neurofedora Source0: neurofedora-desktop.py Source1: neurofedora-data.py Source2: 60-neurofedora.conf Source3: 61-neurofedora-fsl.conf Source4: 62-neurofedora-freesurfer.conf Source5: neurofedora-profile.sh Source6: neurofedora-mimeapps-defaults.list Source7: neurofedora-datasets.tsv Source8: neurofedora-desktop-defaults.service Source9: neurofedora.directory Source10: neurofedora.menu Source11: 50-neurofedora-app-folder Source12: neuro-mime-types.LICENSE BuildArch: noarch BuildRequires: python3 BuildRequires: libxml2 BuildRequires: systemd-rpm-macros Requires: python3 Requires: neuro-mime-types Requires: shared-mime-info Requires(post): dconf Requires(postun): dconf # The tools the shipped defaults name. Recommends rather than Requires: the # integration is still worth having with a subset installed, and # apply-defaults skips any entry whose application is absent rather than # writing a default that points at nothing. Recommends: mricrogl Recommends: sigviewer Recommends: connectome-workbench Recommends: mrtrix3 Recommends: datalad %description Desktop-side configuration for the brain-imaging stack in mhough/neurofedora: the part that no individual package can do for itself, because it is about how the applications relate to each other and to the desktop. * Default applications for brain-image types, merged into the user's own mimeapps.list without overwriting choices they have already made. * The environment a GRAPHICAL launch inherits. /etc/profile.d is read by login shells only, so an application started from the app grid has never seen FSLDIR or SUBJECTS_DIR. This ships the systemd environment.d half and a command that checks the two halves agree. * A Neuroimaging group in the application menu, for GNOME's app grid and for the XDG menu that KDE, Xfce and LXQt read. * neurofedora-data: the standard ~/neuro tree and a DataLad wrapper for fetching only the parts of a dataset you want. %package fsl Summary: FSL environment for graphical sessions Requires: %{name} = %{version}-%{release} Supplements: (%{name} and fsl) %description fsl Sets FSLDIR, FSLOUTPUTTYPE and FSLMULTIFILEQUIT for graphical sessions. Installed automatically when both neurofedora-desktop and fsl are present, so that nothing sets FSLDIR on a machine with no FSL, where it would only mislead every tool that probes it. %package freesurfer Summary: FreeSurfer environment for graphical sessions Requires: %{name} = %{version}-%{release} Supplements: (%{name} and freesurfer7) Supplements: (%{name} and freesurfer8) %description freesurfer Sets FREESURFER_HOME and FUNCTIONALS_DIR for graphical sessions, matching what freesurfer-common's /etc/profile.d hooks set for login shells. FreeSurfer itself is nonfree and ships from mhough/neurofedora-nonfree; this package only describes where it lives and is inert without it. %prep %autosetup -c -T cp -p %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} \ %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE11} \ %{SOURCE12} . %build # Nothing to compile. %install install -Dpm0755 neurofedora-desktop.py %{buildroot}%{_bindir}/neurofedora-desktop install -Dpm0755 neurofedora-data.py %{buildroot}%{_bindir}/neurofedora-data install -Dpm0644 60-neurofedora.conf %{buildroot}%{_prefix}/lib/environment.d/60-neurofedora.conf install -Dpm0644 61-neurofedora-fsl.conf %{buildroot}%{_prefix}/lib/environment.d/61-neurofedora-fsl.conf install -Dpm0644 62-neurofedora-freesurfer.conf %{buildroot}%{_prefix}/lib/environment.d/62-neurofedora-freesurfer.conf install -Dpm0644 neurofedora-profile.sh %{buildroot}%{_sysconfdir}/profile.d/neurofedora.sh install -Dpm0644 neurofedora-mimeapps-defaults.list %{buildroot}%{_datadir}/neurofedora/mimeapps-defaults.list install -Dpm0644 neurofedora-datasets.tsv %{buildroot}%{_datadir}/neurofedora/datasets.tsv install -Dpm0644 neurofedora-desktop-defaults.service \ %{buildroot}%{_userunitdir}/neurofedora-desktop-defaults.service install -Dpm0644 neurofedora.directory %{buildroot}%{_datadir}/desktop-directories/neurofedora.directory install -Dpm0644 neurofedora.menu %{buildroot}%{_sysconfdir}/xdg/menus/applications-merged/neurofedora.menu install -Dpm0644 50-neurofedora-app-folder %{buildroot}%{_sysconfdir}/dconf/db/local.d/50-neurofedora-app-folder %check python3 -m py_compile neurofedora-desktop.py neurofedora-data.py xmllint --noout neurofedora.menu # The two halves of the environment must agree. This is the defect the # package exists to prevent, so it is also the one thing %%check must refuse # to ship: a variable set for login shells and not for graphical sessions # produces a tool that works in a terminal and fails from the app grid, and # neither result reproduces where the other was seen. # Compare the BASE pair only: 61/62 belong to the fsl and freesurfer # subpackages and their shell halves ship with those tools, not with us. envd=$(grep -hE '^[A-Z_]+=' 60-neurofedora.conf | cut -d= -f1 | sort -u) prof=$(grep -oE 'export [A-Z_]+' neurofedora-profile.sh | awk '{print $2}' | sort -u) missing=$(comm -23 <(echo "$prof") <(echo "$envd")) if [ -n "$missing" ]; then echo "set for login shells but not for graphical sessions: $missing" >&2 exit 1 fi # Every application named as a default must also be in the app-grid folder, # or it is a default the user cannot find in their menu. for d in $(sed -n 's/^application[^=]*=//p' neurofedora-mimeapps-defaults.list | sort -u); do grep -q "'$d'" 50-neurofedora-app-folder \ || { echo "$d is a default but is not in the Neuroimaging app folder" >&2; exit 1; } done echo "check: $(echo "$envd" | wc -l) env vars, defaults and app folder agree" %post dconf update || : %postun dconf update || : %files %license neuro-mime-types.LICENSE %{_bindir}/neurofedora-desktop %{_bindir}/neurofedora-data %{_prefix}/lib/environment.d/60-neurofedora.conf %{_sysconfdir}/profile.d/neurofedora.sh %{_datadir}/neurofedora/mimeapps-defaults.list %{_datadir}/neurofedora/datasets.tsv %{_userunitdir}/neurofedora-desktop-defaults.service %{_datadir}/desktop-directories/neurofedora.directory %{_sysconfdir}/xdg/menus/applications-merged/neurofedora.menu %{_sysconfdir}/dconf/db/local.d/50-neurofedora-app-folder %files fsl %{_prefix}/lib/environment.d/61-neurofedora-fsl.conf %files freesurfer %{_prefix}/lib/environment.d/62-neurofedora-freesurfer.conf %changelog * Mon Sep 28 2026 Morgan Hough - 0.1-1 - Initial package. Desktop integration for the brain-imaging stack: default applications, the graphical-session environment, an application-menu group, and a DataLad data layout. - The environment.d half is the point. /etc/profile.d is read by login shells only, so FSLDIR and SUBJECTS_DIR have never been visible to an application launched from the GNOME app grid or by a file manager's "Open With" -- which is most of how a desktop user starts them. afni, fsl and freesurfer-common each ship profile.d hooks and none of them ships the graphical half. - FSLDIR and FREESURFER_HOME live in subpackages with Supplements, so they are set only on machines that actually have FSL or FreeSurfer. A variable pointing at an absent tree is worse than an unset one. - apply-defaults never overwrites a choice the user has already made, and skips any type whose application is not installed rather than writing a default that points at nothing. - MRIcroGL is the default for MRI volumes (.nii and .nii.gz), at Morgan's direction.