%global pypi_name immich_ml Name: immich-machine-learning Version: 2.1.0 Release: 1%{?dist} Summary: Self-hosted photo and video management solution # One file is Apache 2.0 licensed: # - immich_ml/sessions/rknn/rknnpool.py License: AGPL-3.0 and Apache-2.0 URL: https://immich.app/ # Generated by running ./generate_tarball.sh %%{version} Source0: v%{version}.tar.xz # Service files Source1: sysusers Source2: systemd.service Source3: environment BuildArch: noarch BuildRequires: systemd-rpm-macros %global _description %{expand: Easily back up, organize, and manage your photos on your own server. Immich helps you browse, search and organize your photos and videos with ease, without sacrificing your privacy. Machine learning component.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} Provides: %{name} = %{version}-%{release} %description -n python3-%{pypi_name} %_description %pyproject_extras_subpkg -n python3-%{pypi_name} cpu %prep %autosetup -p1 -n %{pypi_name}-%{version} # Fix dep on opencv sed -i -e 's/opencv-python-headless/opencv/' pyproject.toml # Fix dep on pillow sed -i -e '/pillow/s/11/12/' pyproject.toml # Fix dep on numpy sed -i -e '/numpy/s/<2//' pyproject.toml # Call python3 explicitly sed -i -e 's/"python"/"python3"/' immich_ml/__main__.py %generate_buildrequires %pyproject_buildrequires -g test -x cpu %build %pyproject_wheel %install # User/Group configuration install -Dpm 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.conf # Systemd unit configuration install -Dpm 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service install -Dpm 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name} # Cache directory where models are downloaded install -dm 0750 %{buildroot}%{_localstatedir}/cache/%{name} # Service working directory install -dm 0750 %{buildroot}%{_localstatedir}/lib/%{name} %pyproject_install %pyproject_save_files %{pypi_name} %check %pyproject_check_import %pytest %post -n python3-%{pypi_name} %systemd_post %{name}.service %preun -n python3-%{pypi_name} %systemd_preun %{name}.service %postun -n python3-%{pypi_name} %systemd_postun_with_restart %{name}.service %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %{_sysusersdir}/%{name}.conf %{_unitdir}/%{name}.service %{_sysconfdir}/sysconfig/%{name} %dir %attr(750,immich_ml,immich_ml) %{_localstatedir}/cache/%{name} %dir %attr(750,immich_ml,immich_ml) %{_localstatedir}/lib/%{name} %changelog * Tue Nov 11 2025 Mat Booth - 2.1.0-1 - Split machine learning into discrete package - Update to 2.1.0 release