%define debug_package %{nil} %global commit_date 20250101 %global git_commit master Name: mricron Version: 1.2.%{commit_date} Release: 6%{?dist} Summary: Medical image visualization and analysis (Lazarus/Qt5) License: BSD-2-Clause URL: https://github.com/neurolabusc/MRIcron Source0: https://github.com/neurolabusc/MRIcron/archive/%{git_commit}/%{name}-%{version}.tar.gz Source1: mricron.metainfo.xml BuildRequires: lazarus >= 2.0 BuildRequires: fpc BuildRequires: fpc-src BuildRequires: qt5pas-devel BuildRequires: qt5-qtbase-devel BuildRequires: lazarus-lcl-qt5 BuildRequires: dos2unix BuildRequires: /usr/bin/appstream-util # desktop-file-install is called in %install; -5 failed on f44-x86_64 with # "desktop-file-install: command not found" because nothing pulled it in. BuildRequires: desktop-file-utils Requires: qt5pas Requires: dcm2niix Requires: hicolor-icon-theme %description MRIcron is a cross-platform NIfTI format image viewer. It allows viewing multiple layers of images, generating volume renderings, and drawing volumes of interest (VOI). This is the native compiled version built with Lazarus and Qt5. %prep %autosetup -n MRIcron-%{git_commit} # 1. Fix Line Endings (CRLF -> LF) find . -type f \( -name "*.ini" -o -name "*.lut" -o -name "*.txt" -o -name "*.md" \) -exec dos2unix {} \; # 2. Fix Permissions (remove executable bit from non-binaries) find . -type f -exec chmod 644 {} \; %build # Re-enable execute on the project file so lazbuild can read it chmod 644 mricron.lpi lazbuild -B --ws=qt5 mricron.lpi %install rm -rf %{buildroot} # 1. Prepare directories mkdir -p %{buildroot}%{_libexecdir}/%{name} mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_datadir}/applications mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps # 2. Install Binary install -m 755 MRIcron %{buildroot}%{_libexecdir}/%{name}/%{name} # 3. Install Resources cp -r render %{buildroot}%{_libexecdir}/%{name}/ cp -r Resources/templates %{buildroot}%{_libexecdir}/%{name}/ cp -r Resources/lut %{buildroot}%{_libexecdir}/%{name}/ cp *.txt %{buildroot}%{_libexecdir}/%{name}/ # 4. Create Wrapper Script cat > %{buildroot}%{_bindir}/%{name} < is a literal placeholder. Version is the desktop-entry # SPEC version, so it is 1.0 and needs no substitution. # * Categories contains QT5, which is not a registered value (Qt is), and # names four main categories. # * Comment=Edit Exec and Icon paths for your system is an instruction to # packagers sitting in the field a file manager shows to the USER. # * no MimeType, which makes any default-application setting inert. desktop-file-install --dir=%{buildroot}%{_datadir}/applications \ --set-key=Version --set-value=1.0 \ --set-key=Comment --set-value="View and edit MRI, CT and PET images" \ --set-key=Categories --set-value="Science;MedicalSoftware;" \ --set-key=Keywords --set-value="MRI;NIfTI;DICOM;brain;neuroimaging;lesion;" \ --set-key=MimeType --set-value="application/x-nifti;application/dicom;" \ Debian/%{name}.desktop # 7. Install Icon install -m 644 mricron.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png # AppStream metadata. A .desktop file makes an application launchable; a # metainfo file makes it DISCOVERABLE -- GNOME Software and KDE Discover list # only applications that ship one. Validation runs here rather than in # %check so a malformed file fails the build instead of shipping and being # silently ignored, which is how Ankur Sinha does it in Fedora's # python-fsleyes. install -Dpm 0644 %{SOURCE1} %{buildroot}%{_metainfodir}/mricron.metainfo.xml appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/mricron.metainfo.xml %files %license license.txt %doc README.md %{_bindir}/%{name} %{_libexecdir}/%{name}/ %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/128x128/apps/%{name}.png %{_metainfodir}/mricron.metainfo.xml %changelog * Sun Oct 04 2026 Morgan Hough - 1.2.20250101-6 - BuildRequires: desktop-file-utils. -5 installs upstream's desktop entry with desktop-file-install and failed on fedora-44-x86_64 (build 11064829) with "desktop-file-install: command not found" -- mricron was the only one of the five desktop/AppStream packages that did not declare it. The other chroots still serve -4, so this is the first -5 that can reach them. * Fri Oct 02 2026 Morgan Hough - 1.2.20250101-5 - Install upstream's own desktop entry (Debian/mricron.desktop) instead of the one this spec wrote by hand. Upstream's has GenericName and German and Russian translations. - It does not validate as shipped: Version= is a literal placeholder and QT5 is not a registered category, so desktop-file-validate exits 1 and desktop-file-install would refuse it. Fixed here with --set-key, and reported upstream. Also replaces Comment=Edit Exec and Icon paths for your system, which is a note to packagers occupying the description a file manager shows the user. - Adds Keywords and MimeType, without which a default application for NIfTI is silently ignored by the desktop. * Tue Sep 29 2026 Morgan Hough - 1.2.20250101-4 - Ship AppStream metadata (mricron.metainfo.xml). A desktop entry makes an application launchable; a metainfo file makes it DISCOVERABLE, because GNOME Software and KDE Discover list only applications that ship one. Twenty of the twenty-six applications in this repo had a desktop entry and no metainfo, so they were invisible in the software centre even once installed. Validated at build time with appstream-util validate-relax --nonet, in %install rather than %check, so a malformed file fails the build. - Added Requires: hicolor-icon-theme, which the icons need. * Tue Sep 29 2026 Morgan Hough - 1.2.20250101-3 - Exec takes %%F so the entry can open the file it is given, and MimeType is declared for NIfTI and DICOM; without the declaration any default pointing here is silently ignored by the desktop. - Deliberately NOT claiming *.hdr/*.img for Analyze: f3d owns *.hdr as Radiance HDR and *.img collides with raw disk images. * Sun Jan 04 2026 Morgan Hough - 1.2.20250101-2 - Fix permissions on templates and LUTs - Fix line endings (dos2unix) for docs and config files - Use relative symlink for dcm2niix to satisfy rpmlint * Sun Jan 04 2026 Morgan Hough - 1.2.20250101-1 - Initial RPM release built with Lazarus and Qt5