79 lines
3.0 KiB
RPMSpec
79 lines
3.0 KiB
RPMSpec
%global ocf_provider_dir /usr/lib/ocf/resource.d/loxthelion
|
|
# Preserve the proven entrypoint byte-for-byte, including its /bin/bash shebang.
|
|
%global __brp_mangle_shebangs %{nil}
|
|
%{!?package_version:%global package_version 0.1.0}
|
|
%{!?package_release:%global package_release 0.dev}
|
|
|
|
Name: ocf-managed-container
|
|
Version: %{package_version}
|
|
Release: %{package_release}%{?dist}
|
|
Summary: PostgreSQL HA agent for a persistent rootless container
|
|
# Development status only; see PROVENANCE.md. No release publishing yet.
|
|
License: LicenseRef-Provenance-Pending
|
|
URL: https://gitea.loxthelion.com/david/ocf-managed-container
|
|
Source0: %{name}-%{version}.tar.gz
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: bash
|
|
BuildRequires: python3
|
|
BuildRequires: resource-agents
|
|
BuildRequires: hostname
|
|
BuildRequires: diffutils
|
|
BuildRequires: coreutils
|
|
BuildRequires: pacemaker-cli >= 2.1.0
|
|
Requires: python3
|
|
Requires: bash
|
|
Requires: /usr/lib/ocf/lib/heartbeat/ocf-shellfuncs
|
|
Requires: podman
|
|
Requires: systemd
|
|
Requires: /usr/sbin/runuser
|
|
Requires: /usr/bin/getent
|
|
Requires: corosync
|
|
Requires: coreutils
|
|
Requires: gawk
|
|
Requires: sed
|
|
Requires: hostname
|
|
Requires: pacemaker-cli >= 2.1.0
|
|
|
|
%description
|
|
OCF agent managing PostgreSQL through a persistent rootless systemd/Quadlet
|
|
container, with role-aware monitoring, promotion, demotion and rejoin.
|
|
This development package has unresolved license provenance. It does not
|
|
configure the cluster or container and does not start or stop services.
|
|
|
|
%prep
|
|
%autosetup
|
|
cp packaging/README.md RPM-BUILD.md
|
|
|
|
%build
|
|
# Shell modules require no compilation.
|
|
|
|
%install
|
|
install -d %{buildroot}%{ocf_provider_dir}/managed-container.d
|
|
install -m 0755 refactored/managed-container %{buildroot}%{ocf_provider_dir}/managed-container
|
|
install -m 0644 refactored/managed-container.d/*.sh refactored/managed-container.d/*.py %{buildroot}%{ocf_provider_dir}/managed-container.d/
|
|
|
|
%check
|
|
python3 tests/verify_refactor.py
|
|
python3 tests/test_promotion_scores.py
|
|
python3 tests/test_promotion_scheduler.py
|
|
python3 tests/test_promotion_cleanup.py
|
|
python3 tests/test_disconnected_state.py
|
|
# Check the actual staged layout, including resolution from an unrelated cwd.
|
|
agent="%{buildroot}%{ocf_provider_dir}/managed-container"
|
|
"$agent" meta-data > staged-metadata.xml
|
|
refactored/managed-container meta-data > reference-metadata.xml
|
|
cmp reference-metadata.xml staged-metadata.xml
|
|
(cd /tmp && "$agent" meta-data) > other-cwd-metadata.xml
|
|
cmp reference-metadata.xml other-cwd-metadata.xml
|
|
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%doc README.md packaging/PROVENANCE.md RPM-BUILD.md notes/PROMOTION-SCORING.md notes/DISCONNECTED-STANDBY.md
|
|
%doc docs/operations.md docs/testing.md docs/review.md
|
|
%dir %{ocf_provider_dir}
|
|
%attr(0755,root,root) %{ocf_provider_dir}/managed-container
|
|
%dir %{ocf_provider_dir}/managed-container.d
|
|
%attr(0644,root,root) %{ocf_provider_dir}/managed-container.d/*.sh
|
|
%attr(0644,root,root) %{ocf_provider_dir}/managed-container.d/*.py
|