Name: mx-rpm Version: 2.3.3 Release: 1%{?dist} Summary: Discover, fetch sources for, build, and publish RPM spec files with mock # Personal/local tool; MIT is just a permissive default -- change freely. License: MIT URL: https://github.com/lacamar/mx-rpm Source0: %{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # For %%check's test suite: mx_rpm.specfile imports the `rpm` bindings # directly (real spec parsing, not regexes) and mx_rpm.copr_upload imports # `copr` lazily inside functions -- neither comes from PyPI, so # %%pyproject_buildrequires (which only covers pyproject.toml's own # [project.dependencies]) can't pull them in. Mirrors the Requires below, # same reasoning as photo-spool.spec's BuildRequires block: %%check runs in # this build chroot, which only gets BuildRequires installed, not Requires. BuildRequires: python3-rpm BuildRequires: python3-copr BuildRequires: python3-pytest BuildRequires: git-core Requires: python3-rpm Requires: python3-copr Requires: rpm-build Requires: rpmdevtools Requires: mock Requires: git Requires: curl Recommends: libnotify %description Discovers RPM .spec files (by path, bare stem, or directory), downloads their Source/Patch URLs itself (via the system `rpm` Python bindings + `curl`, replacing a `spectool` copy whose URL downloading had broken), builds them with `mock` (SRPM-only or full binary, optionally N packages in parallel), and on success optionally git-commits the spec and/or uploads the built SRPM to a COPR project via the `copr` v3 API (with duplicate-NVR detection, replacing an HTML-scrape of the COPR web UI). Sends desktop notifications on build success/failure. `--update`/`-U` folds in what used to be a separate `autobuild` script: check a spec's upstream repo for a newer git tag or commit, bump the spec (`%%global tag`/`%%global commit`/`Version` plus a `%%changelog` entry), and build it -- through the same build pipeline as a normal build, so it transparently honors every other flag (`-P`, `-S`, `--copr`, etc.) instead of a separate hardcoded invocation. Ships bash completion and a small `autobuild` compatibility wrapper (`mx-rpm --update "$@"`, preserving the old script's `COPR` env-var fallback) for anything still calling the old command name directly. %prep %autosetup -n %{name}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files mx_rpm # Absolute paths, not relative ones: %%pyproject_save_files (just above) # leaves the shell's cwd somewhere other than the extracted source tree # (confirmed live -- a relative `install -Dm644 completions/mx-rpm.bash` # here fails with "No such file or directory"), so anchor explicitly # instead of relying on cwd. install -Dm644 %{_builddir}/%{name}-%{version}/completions/mx-rpm.bash \ %{buildroot}%{_datadir}/bash-completion/completions/%{name} # See ~/.local/bin/autobuild's own history: this is a thin, personal # compatibility shim for a name this machine already used for the same # functionality before it was folded into `mx-rpm --update`. A generic # `autobuild` binary in %%{_bindir} is a plausible name collision for # anyone consuming this spec outside this machine's own COPR -- rename or # drop this file+install line if that matters for your use case. install -Dm755 %{_builddir}/%{name}-%{version}/autobuild-wrapper.sh \ %{buildroot}%{_bindir}/autobuild %check %pytest %files -f %{pyproject_files} # %%pyproject_save_files mx_rpm captures the installed package/dist-info # tree but not the console_scripts entry-point binary itself (confirmed # live: omitting this line fails the build with "Installed (but # unpackaged) file(s) found: /usr/bin/mx-rpm"). %{_bindir}/mx-rpm %{_bindir}/autobuild %{_datadir}/bash-completion/completions/%{name} %doc README.md %changelog * Tue Oct 13 2026 Lachlan Marie - 2.3.3-1 - Fix -P dropping default addrepos - Ctrl-C stops mock under pty - COPR failure fails the run - Re-upload after failed COPR build - Restore spec on update crash - Complete -i/--install * Fri Oct 09 2026 Lachlan Marie - 2.3.2-1 - Bare --copr name uses COPR_OWNER - check-patches names the failing patch * Fri Oct 09 2026 Lachlan Marie - 2.3.1-1 - Fix notification action buttons - Open files with gio, drop xdg-utils * Fri Oct 02 2026 Lachlan Marie - 2.3.0-1 - Drop requests, download via curl - Use copr.v3 wait() for --copr-wait - Remove dead code and dry-run paths * Fri Oct 02 2026 Lachlan Marie - 2.2.0-2 - BuildRequire git-core for tests * Fri Oct 02 2026 Lachlan Marie - 2.2.0-1 - Check patches apply before --update builds - Add --check-patches * Sun Aug 30 2026 Lachlan Marie - 2.1.0-2 - A plain (non -P) build that hits mock's "Build root is locked" error now retries once with an isolated buildroot (--uniqueext), so two separate mx-rpm invocations targeting the same chroot actually build concurrently instead of one just failing. - New --copr-upload-only flag resubmits the most recently built SRPM to --copr PROJECT without rebuilding. - Fixed a latent bug where rpm's process-global macro table leaked a %%global set while parsing one spec into the next spec parsed in the same process, corrupting its Source0/URL macro expansion. - --update can now rewrite an opt-in %%global tag_ref line alongside the numeric-normalized %%global tag. - --install now falls back to `dnf reinstall` when the freshly built RPM's NVRA is unchanged from what's already installed - `dnf install` was silently no-op'ing in that case and leaving the old bits in place (confirmed live: installing this exact package after code changes but no Release bump didn't actually update /usr/bin/mx-rpm, and separately left two same-NVRA builds with different content sitting in the lacamar/ arm64-misc COPR repo at once). * Tue Aug 18 2026 Lachlan Marie - 2.1.0-1 - Handle concurrent builds against the same mock chroot: -P N now gives each concurrently-building package its own isolated buildroot (mock --uniqueext), confirmed live with a real -P 2 build (two packages building at once, each in its own bootstrap dir). Separately, if two builds do collide on the exact same chroot+package, mock's own "Build root is locked" failure is now caught and turned into a distinct "chroot busy, not a build failure" skip (with its own desktop notification and summary bucket) instead of a raw error. Also fixes a latent bug found while testing this: a local (no-URL-scheme) Source that's actually missing was silently reported as fetched-OK instead of failing mx-rpm's own pre-flight check. - Fixed this spec's own %%install: %%pyproject_save_files leaves the shell cwd somewhere other than the extracted source tree, so the bash- completion/autobuild-wrapper install lines needed absolute paths; and %%pyproject_save_files doesn't capture the console_scripts binary itself, so %%{_bindir}/mx-rpm needed to be listed in %%files explicitly. Both found via a real mock build, not rpmspec -P/rpmlint. * Tue Aug 18 2026 Lachlan Marie - 2.0.0-1 - Initial packaging of the Python reimplementation (see CLAUDE.md for the full rationale): own source downloader replacing a broken spectool copy, COPR uploads via the copr.v3 API instead of copr-cli + HTML-scrape dedup, PTY output passthrough via the stdlib pty module instead of `script`, and autobuild's upstream tag/commit-check-and-build folded in as --update.