%define debug_package %{nil} %global commit_date 20250101 %global git_commit master Name: mricron Version: 1.2.%{commit_date} Release: 4%{?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 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} < %{buildroot}%{_datadir}/applications/%{name}.desktop < - 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