Files
pkgmgr/package-manager.spec

94 lines
3.0 KiB
RPMSpec
Raw Normal View History

Name: package-manager
2025-12-09 16:45:45 +01:00
Version: 0.7.5
Release: 1%{?dist}
Summary: Wrapper that runs Kevin's package-manager via Nix flake
License: MIT
URL: https://github.com/kevinveenbirkenbach/package-manager
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
# NOTE:
# Nix is a runtime requirement, but it is *not* declared here as a hard
# RPM dependency, because many distributions do not ship a "nix" RPM.
# Instead, Nix is installed and initialized by init-nix.sh, which is
# called in the %post scriptlet below.
%description
This package provides the `pkgmgr` command, which runs Kevin's package
Refactor pkgmgr installers, introduce capability-based execution, and replace manifest layer References: - Current ChatGPT conversation: https://chatgpt.com/share/6935d6d7-0ae4-800f-988a-44a50c17ba48 - Extended discussion: https://chatgpt.com/share/6935d734-fd84-800f-9755-290902b8cee8 Summary: This commit performs a major cleanup and modernization of the installation pipeline: 1. Introduced a new capability-detection subsystem: - Capabilities (python-runtime, make-install, nix-flake) are detected per installer/layer. - Installers run only when they add new capabilities. - Prevents duplicated work such as Python installers running when Nix already provides the runtime. 2. Removed deprecated pkgmgr.yml manifest installer: - Dependency resolution is now delegated entirely to real package managers (Nix, pip, make, distro build tools). - Simplifies layering and avoids unnecessary recursion. 3. Reworked OS-specific installers: - Arch PKGBUILD now uses 'makepkg --syncdeps --cleanbuild --install --noconfirm'. - Debian installer now builds proper .deb packages via dpkg-buildpackage + installs them. - RPM installer now builds packages using rpmbuild and installs them via rpm. 4. Switched from remote GitHub flakes to local-flake execution: - Wrapper now executes: nix run /usr/lib/package-manager#pkgmgr - Avoids lock-file write attempts and improves reliability in CI. 5. Added bash -i based integration test: - Correctly sources ~/.bashrc and evaluates alias + venv activation. - ‘pkgmgr --help’ is now printed for debugging without failing tests. 6. Updated unit tests across all installers: - Removed references to manifest installer. - Adjusted expectations for new behaviors (makepkg, dpkg-buildpackage, rpmbuild). - Added capability subsystem tests. 7. Improved flake.nix packaging logic: - The entire project source tree is copied into the runtime closure. - pkgmgr wrapper now executes runpy inside the packaged directory. Together, these changes create a predictable, layered, capability-driven installer pipeline with consistent behavior across Arch, Debian, RPM, Nix, and Python layers.
2025-12-07 20:36:39 +01:00
manager via a local Nix flake:
Refactor pkgmgr installers, introduce capability-based execution, and replace manifest layer References: - Current ChatGPT conversation: https://chatgpt.com/share/6935d6d7-0ae4-800f-988a-44a50c17ba48 - Extended discussion: https://chatgpt.com/share/6935d734-fd84-800f-9755-290902b8cee8 Summary: This commit performs a major cleanup and modernization of the installation pipeline: 1. Introduced a new capability-detection subsystem: - Capabilities (python-runtime, make-install, nix-flake) are detected per installer/layer. - Installers run only when they add new capabilities. - Prevents duplicated work such as Python installers running when Nix already provides the runtime. 2. Removed deprecated pkgmgr.yml manifest installer: - Dependency resolution is now delegated entirely to real package managers (Nix, pip, make, distro build tools). - Simplifies layering and avoids unnecessary recursion. 3. Reworked OS-specific installers: - Arch PKGBUILD now uses 'makepkg --syncdeps --cleanbuild --install --noconfirm'. - Debian installer now builds proper .deb packages via dpkg-buildpackage + installs them. - RPM installer now builds packages using rpmbuild and installs them via rpm. 4. Switched from remote GitHub flakes to local-flake execution: - Wrapper now executes: nix run /usr/lib/package-manager#pkgmgr - Avoids lock-file write attempts and improves reliability in CI. 5. Added bash -i based integration test: - Correctly sources ~/.bashrc and evaluates alias + venv activation. - ‘pkgmgr --help’ is now printed for debugging without failing tests. 6. Updated unit tests across all installers: - Removed references to manifest installer. - Adjusted expectations for new behaviors (makepkg, dpkg-buildpackage, rpmbuild). - Added capability subsystem tests. 7. Improved flake.nix packaging logic: - The entire project source tree is copied into the runtime closure. - pkgmgr wrapper now executes runpy inside the packaged directory. Together, these changes create a predictable, layered, capability-driven installer pipeline with consistent behavior across Arch, Debian, RPM, Nix, and Python layers.
2025-12-07 20:36:39 +01:00
nix run /usr/lib/package-manager#pkgmgr -- ...
Nix is a runtime requirement and is installed/initialized by the
init-nix.sh helper during package installation if it is not yet
available on the system.
%prep
%setup -q
%build
# No build step required; we ship the project tree as-is.
:
%install
rm -rf %{buildroot}
install -d %{buildroot}%{_bindir}
# Install project tree into a fixed, architecture-independent location.
install -d %{buildroot}/usr/lib/package-manager
Refactor pkgmgr installers, introduce capability-based execution, and replace manifest layer References: - Current ChatGPT conversation: https://chatgpt.com/share/6935d6d7-0ae4-800f-988a-44a50c17ba48 - Extended discussion: https://chatgpt.com/share/6935d734-fd84-800f-9755-290902b8cee8 Summary: This commit performs a major cleanup and modernization of the installation pipeline: 1. Introduced a new capability-detection subsystem: - Capabilities (python-runtime, make-install, nix-flake) are detected per installer/layer. - Installers run only when they add new capabilities. - Prevents duplicated work such as Python installers running when Nix already provides the runtime. 2. Removed deprecated pkgmgr.yml manifest installer: - Dependency resolution is now delegated entirely to real package managers (Nix, pip, make, distro build tools). - Simplifies layering and avoids unnecessary recursion. 3. Reworked OS-specific installers: - Arch PKGBUILD now uses 'makepkg --syncdeps --cleanbuild --install --noconfirm'. - Debian installer now builds proper .deb packages via dpkg-buildpackage + installs them. - RPM installer now builds packages using rpmbuild and installs them via rpm. 4. Switched from remote GitHub flakes to local-flake execution: - Wrapper now executes: nix run /usr/lib/package-manager#pkgmgr - Avoids lock-file write attempts and improves reliability in CI. 5. Added bash -i based integration test: - Correctly sources ~/.bashrc and evaluates alias + venv activation. - ‘pkgmgr --help’ is now printed for debugging without failing tests. 6. Updated unit tests across all installers: - Removed references to manifest installer. - Adjusted expectations for new behaviors (makepkg, dpkg-buildpackage, rpmbuild). - Added capability subsystem tests. 7. Improved flake.nix packaging logic: - The entire project source tree is copied into the runtime closure. - pkgmgr wrapper now executes runpy inside the packaged directory. Together, these changes create a predictable, layered, capability-driven installer pipeline with consistent behavior across Arch, Debian, RPM, Nix, and Python layers.
2025-12-07 20:36:39 +01:00
# Copy full project source into /usr/lib/package-manager
cp -a . %{buildroot}/usr/lib/package-manager/
Refactor pkgmgr installers, introduce capability-based execution, and replace manifest layer References: - Current ChatGPT conversation: https://chatgpt.com/share/6935d6d7-0ae4-800f-988a-44a50c17ba48 - Extended discussion: https://chatgpt.com/share/6935d734-fd84-800f-9755-290902b8cee8 Summary: This commit performs a major cleanup and modernization of the installation pipeline: 1. Introduced a new capability-detection subsystem: - Capabilities (python-runtime, make-install, nix-flake) are detected per installer/layer. - Installers run only when they add new capabilities. - Prevents duplicated work such as Python installers running when Nix already provides the runtime. 2. Removed deprecated pkgmgr.yml manifest installer: - Dependency resolution is now delegated entirely to real package managers (Nix, pip, make, distro build tools). - Simplifies layering and avoids unnecessary recursion. 3. Reworked OS-specific installers: - Arch PKGBUILD now uses 'makepkg --syncdeps --cleanbuild --install --noconfirm'. - Debian installer now builds proper .deb packages via dpkg-buildpackage + installs them. - RPM installer now builds packages using rpmbuild and installs them via rpm. 4. Switched from remote GitHub flakes to local-flake execution: - Wrapper now executes: nix run /usr/lib/package-manager#pkgmgr - Avoids lock-file write attempts and improves reliability in CI. 5. Added bash -i based integration test: - Correctly sources ~/.bashrc and evaluates alias + venv activation. - ‘pkgmgr --help’ is now printed for debugging without failing tests. 6. Updated unit tests across all installers: - Removed references to manifest installer. - Adjusted expectations for new behaviors (makepkg, dpkg-buildpackage, rpmbuild). - Added capability subsystem tests. 7. Improved flake.nix packaging logic: - The entire project source tree is copied into the runtime closure. - pkgmgr wrapper now executes runpy inside the packaged directory. Together, these changes create a predictable, layered, capability-driven installer pipeline with consistent behavior across Arch, Debian, RPM, Nix, and Python layers.
2025-12-07 20:36:39 +01:00
# Wrapper
install -m0755 scripts/pkgmgr-wrapper.sh %{buildroot}%{_bindir}/pkgmgr
Refactor pkgmgr installers, introduce capability-based execution, and replace manifest layer References: - Current ChatGPT conversation: https://chatgpt.com/share/6935d6d7-0ae4-800f-988a-44a50c17ba48 - Extended discussion: https://chatgpt.com/share/6935d734-fd84-800f-9755-290902b8cee8 Summary: This commit performs a major cleanup and modernization of the installation pipeline: 1. Introduced a new capability-detection subsystem: - Capabilities (python-runtime, make-install, nix-flake) are detected per installer/layer. - Installers run only when they add new capabilities. - Prevents duplicated work such as Python installers running when Nix already provides the runtime. 2. Removed deprecated pkgmgr.yml manifest installer: - Dependency resolution is now delegated entirely to real package managers (Nix, pip, make, distro build tools). - Simplifies layering and avoids unnecessary recursion. 3. Reworked OS-specific installers: - Arch PKGBUILD now uses 'makepkg --syncdeps --cleanbuild --install --noconfirm'. - Debian installer now builds proper .deb packages via dpkg-buildpackage + installs them. - RPM installer now builds packages using rpmbuild and installs them via rpm. 4. Switched from remote GitHub flakes to local-flake execution: - Wrapper now executes: nix run /usr/lib/package-manager#pkgmgr - Avoids lock-file write attempts and improves reliability in CI. 5. Added bash -i based integration test: - Correctly sources ~/.bashrc and evaluates alias + venv activation. - ‘pkgmgr --help’ is now printed for debugging without failing tests. 6. Updated unit tests across all installers: - Removed references to manifest installer. - Adjusted expectations for new behaviors (makepkg, dpkg-buildpackage, rpmbuild). - Added capability subsystem tests. 7. Improved flake.nix packaging logic: - The entire project source tree is copied into the runtime closure. - pkgmgr wrapper now executes runpy inside the packaged directory. Together, these changes create a predictable, layered, capability-driven installer pipeline with consistent behavior across Arch, Debian, RPM, Nix, and Python layers.
2025-12-07 20:36:39 +01:00
# Shared Nix init script (ensure it is executable in the installed tree)
install -m0755 scripts/init-nix.sh %{buildroot}/usr/lib/package-manager/init-nix.sh
Refactor pkgmgr installers, introduce capability-based execution, and replace manifest layer References: - Current ChatGPT conversation: https://chatgpt.com/share/6935d6d7-0ae4-800f-988a-44a50c17ba48 - Extended discussion: https://chatgpt.com/share/6935d734-fd84-800f-9755-290902b8cee8 Summary: This commit performs a major cleanup and modernization of the installation pipeline: 1. Introduced a new capability-detection subsystem: - Capabilities (python-runtime, make-install, nix-flake) are detected per installer/layer. - Installers run only when they add new capabilities. - Prevents duplicated work such as Python installers running when Nix already provides the runtime. 2. Removed deprecated pkgmgr.yml manifest installer: - Dependency resolution is now delegated entirely to real package managers (Nix, pip, make, distro build tools). - Simplifies layering and avoids unnecessary recursion. 3. Reworked OS-specific installers: - Arch PKGBUILD now uses 'makepkg --syncdeps --cleanbuild --install --noconfirm'. - Debian installer now builds proper .deb packages via dpkg-buildpackage + installs them. - RPM installer now builds packages using rpmbuild and installs them via rpm. 4. Switched from remote GitHub flakes to local-flake execution: - Wrapper now executes: nix run /usr/lib/package-manager#pkgmgr - Avoids lock-file write attempts and improves reliability in CI. 5. Added bash -i based integration test: - Correctly sources ~/.bashrc and evaluates alias + venv activation. - ‘pkgmgr --help’ is now printed for debugging without failing tests. 6. Updated unit tests across all installers: - Removed references to manifest installer. - Adjusted expectations for new behaviors (makepkg, dpkg-buildpackage, rpmbuild). - Added capability subsystem tests. 7. Improved flake.nix packaging logic: - The entire project source tree is copied into the runtime closure. - pkgmgr wrapper now executes runpy inside the packaged directory. Together, these changes create a predictable, layered, capability-driven installer pipeline with consistent behavior across Arch, Debian, RPM, Nix, and Python layers.
2025-12-07 20:36:39 +01:00
# Remove packaging-only and development artefacts from the installed tree
rm -rf \
%{buildroot}/usr/lib/package-manager/PKGBUILD \
%{buildroot}/usr/lib/package-manager/Dockerfile \
%{buildroot}/usr/lib/package-manager/debian \
%{buildroot}/usr/lib/package-manager/.git \
%{buildroot}/usr/lib/package-manager/.github \
%{buildroot}/usr/lib/package-manager/tests \
%{buildroot}/usr/lib/package-manager/.gitignore \
%{buildroot}/usr/lib/package-manager/__pycache__ \
%{buildroot}/usr/lib/package-manager/.gitkeep || true
Refactor pkgmgr installers, introduce capability-based execution, and replace manifest layer References: - Current ChatGPT conversation: https://chatgpt.com/share/6935d6d7-0ae4-800f-988a-44a50c17ba48 - Extended discussion: https://chatgpt.com/share/6935d734-fd84-800f-9755-290902b8cee8 Summary: This commit performs a major cleanup and modernization of the installation pipeline: 1. Introduced a new capability-detection subsystem: - Capabilities (python-runtime, make-install, nix-flake) are detected per installer/layer. - Installers run only when they add new capabilities. - Prevents duplicated work such as Python installers running when Nix already provides the runtime. 2. Removed deprecated pkgmgr.yml manifest installer: - Dependency resolution is now delegated entirely to real package managers (Nix, pip, make, distro build tools). - Simplifies layering and avoids unnecessary recursion. 3. Reworked OS-specific installers: - Arch PKGBUILD now uses 'makepkg --syncdeps --cleanbuild --install --noconfirm'. - Debian installer now builds proper .deb packages via dpkg-buildpackage + installs them. - RPM installer now builds packages using rpmbuild and installs them via rpm. 4. Switched from remote GitHub flakes to local-flake execution: - Wrapper now executes: nix run /usr/lib/package-manager#pkgmgr - Avoids lock-file write attempts and improves reliability in CI. 5. Added bash -i based integration test: - Correctly sources ~/.bashrc and evaluates alias + venv activation. - ‘pkgmgr --help’ is now printed for debugging without failing tests. 6. Updated unit tests across all installers: - Removed references to manifest installer. - Adjusted expectations for new behaviors (makepkg, dpkg-buildpackage, rpmbuild). - Added capability subsystem tests. 7. Improved flake.nix packaging logic: - The entire project source tree is copied into the runtime closure. - pkgmgr wrapper now executes runpy inside the packaged directory. Together, these changes create a predictable, layered, capability-driven installer pipeline with consistent behavior across Arch, Debian, RPM, Nix, and Python layers.
2025-12-07 20:36:39 +01:00
%post
# Initialize Nix (if needed) after installing the package-manager files.
if [ -x /usr/lib/package-manager/init-nix.sh ]; then
/usr/lib/package-manager/init-nix.sh || true
else
echo ">>> Warning: /usr/lib/package-manager/init-nix.sh not found or not executable."
fi
%postun
echo ">>> package-manager removed. Nix itself was not removed."
%files
%doc README.md
%license LICENSE
%{_bindir}/pkgmgr
/usr/lib/package-manager/
%changelog
2025-12-09 16:45:45 +01:00
* Tue Dec 09 2025 Kevin Veen-Birkenbach <kevin@veen.world> - 0.7.5-1
- Fixed wrong directory permissions for nix
2025-12-09 16:22:03 +01:00
* Tue Dec 09 2025 Kevin Veen-Birkenbach <kevin@veen.world> - 0.7.4-1
- Fixed missing build in test workflow -> Tests pass now
2025-12-09 16:08:34 +01:00
* Tue Dec 09 2025 Kevin Veen-Birkenbach <kevin@veen.world> - 0.7.3-1
- Fixed bug: Ignored packages are now ignored
2025-12-09 15:49:01 +01:00
* Tue Dec 09 2025 Kevin Veen-Birkenbach <kevin@veen.world> - 0.7.2-1
- Implemented Changelog Support for Fedora and Debian
* Sat Dec 06 2025 Kevin Veen-Birkenbach <info@veen.world> - 0.1.1-1
- Initial RPM packaging for package-manager