## START: Set by rpmautospec ## (rpmautospec version 0.8.4) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 4; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global debug_package %{nil} Name: romm Version: 5.1.0 Release: %autorelease Summary: A beautiful, powerful, self-hosted rom manager and player License: AGPL-3.0-only URL: https://github.com/rommapp/romm Source0: https://github.com/rommapp/romm/archive/refs/tags/%{version}.tar.gz Source1: %{name}.sysusers.conf Source2: %{name}.service Source3: %{name}.sysconfig BuildRequires: python3-devel BuildRequires: nodejs24-npm BuildRequires: git BuildRequires: libpq-devel BuildRequires: mariadb-connector-c-devel BuildRequires: gcc-c++ BuildRequires: systemd-rpm-macros Requires: python3 ExclusiveArch: x86_64 aarch64 %description RomM is a self-hosted ROM manager and player that lets you browse and manage your game ROM library with a beautiful, responsive interface. It supports multiple platforms, provides metadata fetching from various sources (IGDB, MobyGames, ScreenScraper, SteamGridDB, RetroAchievements), and can even stream games in-browser via EmulatorJS. %prep %autosetup -n romm-%{version} # Fix pyproject.toml to only include backend package (not docker/) sed -i '0r /dev/stdin' pyproject.toml << 'EOF' [tool.setuptools.packages.find] include = ["backend*"] EOF # Extract dependencies from pyproject.toml into a requirements file # Skip packages that should use system libraries (pyopenssl, cryptography) sed -n '/^dependencies = \[/,/^\]/p' pyproject.toml \ | grep '"' \ | sed 's/^[[:space:]]*"\(.*\)".*/\1/' \ | grep -iv '^\(pyopenssl\|cryptography\)' \ > requirements.txt # Add extras that aren't in pyproject.toml sed -i 's/fastapi-pagination\[sqlalchemy\] ~= 0.15/fastapi-pagination==0.14.3/' requirements.txt echo typing_extensions >> requirements.txt %build # Build frontend pushd frontend npm install --no-fund --no-audit export NODE_OPTIONS=--max-old-space-size=4096 npm run build popd # Build backend venv in build dir (not buildroot) VENV_DIR=%{_builddir}/%{name}-%{version}/.venv mkdir -p "$VENV_DIR" python3 -m venv "$VENV_DIR" . "$VENV_DIR/bin/activate" pip install --upgrade pip setuptools wheel pip install --target "$VENV_DIR/lib64/python3.14/site-packages" -r %{_builddir}/%{name}-%{version}/requirements.txt pip install --no-deps --no-build-isolation --target "$VENV_DIR/lib64/python3.14/site-packages" %{_builddir}/%{name}-%{version} %install # Install backend source mkdir -p %{buildroot}%{_datadir}/%{name}/backend cp -pr %{_builddir}/%{name}-%{version}/backend/* %{buildroot}%{_datadir}/%{name}/backend/ # Install venv (after backend source) mkdir -p %{buildroot}%{_datadir}/%{name}/backend/.venv cp -pr %{_builddir}/%{name}-%{version}/.venv/* %{buildroot}%{_datadir}/%{name}/backend/.venv/ # Install frontend mkdir -p %{buildroot}%{_datadir}/%{name}/frontend cp -pr frontend/dist/. %{buildroot}%{_datadir}/%{name}/frontend/ # Fix venv paths (was built with %{_builddir} paths) VENV_PATH=%{buildroot}%{_datadir}/%{name}/backend/.venv SED_EXPR="s|%{_builddir}/%{name}-%{version}/.venv|%{_datadir}/%{name}/backend/.venv|g" sed -i "${SED_EXPR}" \ ${VENV_PATH}/bin/activate \ ${VENV_PATH}/bin/activate.fish \ ${VENV_PATH}/bin/activate.csh \ ${VENV_PATH}/bin/pip* \ ${VENV_PATH}/bin/wheel \ ${VENV_PATH}/pyvenv.cfg find ${VENV_PATH}/lib64/python3.14/site-packages/bin -type f -exec sed -i "${SED_EXPR}" {} + 2>/dev/null || true # Fix ambiguous python shebangs find ${VENV_PATH} -name '*.py' -exec grep -l '^#!/usr/bin/env python$' {} \; -exec sed -i 's|^#!/usr/bin/env python$|#!/usr/bin/python3|' {} + 2>/dev/null || true # Fix venv symlinks if [ -L ${VENV_PATH}/bin/python3.14 ]; then rm -f ${VENV_PATH}/bin/python3.14 ln -s /usr/bin/python3 ${VENV_PATH}/bin/python3.14 fi rm -f ${VENV_PATH}/bin/python # Patch main.py to mount frontend static files at root cat >> %{buildroot}%{_datadir}/%{name}/backend/main.py << 'PATCH' # Serve frontend static files import os from starlette.staticfiles import StaticFiles _frontend_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "frontend") if os.path.isdir(_frontend_dir): app.mount("/", StaticFiles(directory=_frontend_dir, html=True), name="frontend") PATCH # Install systemd service mkdir -p %{buildroot}%{_unitdir} install -m 644 %{S:2} %{buildroot}%{_unitdir}/%{name}.service # Install sysusers config mkdir -p %{buildroot}%{_sysusersdir} install -m 644 %{S:1} %{buildroot}%{_sysusersdir}/%{name}.conf # Install sysconfig install -m 644 %{S:3} -D %{buildroot}%{_sysconfdir}/sysconfig/%{name} # Create shared state directory for romm mkdir -p -m 755 %{buildroot}%{_sharedstatedir}/%{name} %pre %sysusers_create_compat %{S:1} %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %license LICENSE %doc README.md CONTRIBUTING.md %attr(755, romm, romm) %{_sharedstatedir}/%{name}/ %config(noreplace,missingok) %{_sysconfdir}/sysconfig/%{name} %{_datadir}/%{name}/ %{_sysusersdir}/%{name}.conf %{_unitdir}/%{name}.service %changelog ## START: Generated by rpmautospec * Wed Aug 19 2026 Grillo del Mal - 5.1.0-4 - Fix deps and venv * Tue Aug 18 2026 Grillo del Mal - 5.1.0-3 - Extra cleanup * Tue Aug 18 2026 Grillo del Mal - 5.1.0-2 - Fix stuff * Tue Aug 18 2026 Grillo del Mal - 5.1.0-1 - Initial commit ## END: Generated by rpmautospec