diff --git a/.fmf/version b/.fmf/version deleted file mode 100644 index d00491f..0000000 --- a/.fmf/version +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/.gitignore b/.gitignore index ec4bfb1..ccc9e53 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,3 @@ /corosync-qdevice-3.0.1.tar.gz /corosync-qdevice-3.0.2.tar.gz /corosync-qdevice-3.0.3.tar.gz -/corosync-qdevice-3.0.4.tar.gz diff --git a/corosync-qdevice.spec b/corosync-qdevice.spec index 21f7ae7..e572a57 100644 --- a/corosync-qdevice.spec +++ b/corosync-qdevice.spec @@ -3,23 +3,32 @@ # to disable or enable specific features %bcond_without userflags %bcond_with runautogen +%bcond_without systemd + +%global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}} +%global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}} Name: corosync-qdevice Summary: The Corosync Cluster Engine Qdevice -Version: 3.0.4 -Release: 1%{?dist} -License: BSD-3-Clause +Version: 3.0.3 +Release: 1%{?gitver}%{?dist} +License: BSD URL: https://github.com/corosync/corosync-qdevice -Source0: https://github.com/corosync/corosync-qdevice/releases/download/v%{version}/%{name}-%{version}.tar.gz +Source0: https://github.com/corosync/corosync-qdevice/releases/download/v%{version}%{?gittarver}/%{name}-%{version}%{?gittarver}.tar.gz # Runtime bits Requires: corosync >= 2.4.0 Requires: corosynclib >= 2.4.0 Requires: nss-tools +%if %{with systemd} %{?systemd_requires} BuildRequires: systemd BuildRequires: systemd-devel +%else +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/chkconfig +%endif # Build bits BuildRequires: gcc @@ -33,10 +42,9 @@ BuildRequires: nss-devel BuildRequires: autoconf automake libtool %endif BuildRequires: make -BuildRequires: git %prep -%autosetup -S git_am +%setup -q -n %{name}-%{version}%{?gittarver} %build %if %{with runautogen} @@ -47,7 +55,9 @@ BuildRequires: git %if %{with userflags} --enable-user-flags \ %endif +%if %{with systemd} --enable-systemd \ +%endif --enable-qdevices \ --enable-qnetd \ --with-initddir=%{_initrddir} \ @@ -70,23 +80,41 @@ install -p -m 644 init/corosync-qdevice.sysconfig.example \ install -p -m 644 init/corosync-qnetd.sysconfig.example \ %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd +%if %{with systemd} sed -i -e 's/^#User=/User=/' \ %{buildroot}%{_unitdir}/corosync-qnetd.service - -install -m0644 -D init/corosync-qnetd.sysusers.conf.example %{buildroot}%{_sysusersdir}/corosync-qnetd.conf +%else +sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \ + %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd +%endif %description This package contains the Corosync Cluster Engine Qdevice, script for creating NSS certificates and an init script. %post +%if %{with systemd} && 0%{?systemd_post:1} %systemd_post corosync-qdevice.service +%else +if [ $1 -eq 1 ]; then + /sbin/chkconfig --add corosync-qdevice || : +fi +%endif %preun +%if %{with systemd} && 0%{?systemd_preun:1} %systemd_preun corosync-qdevice.service +%else +if [ $1 -eq 0 ]; then + /sbin/service corosync-qdevice stop &>/dev/null || : + /sbin/chkconfig --del corosync-qdevice || : +fi +%endif %postun +%if %{with systemd} && 0%{?systemd_postun:1} %systemd_postun corosync-qdevice.service +%endif %files %license LICENSE @@ -97,7 +125,11 @@ NSS certificates and an init script. %{_sbindir}/corosync-qdevice-net-certutil %{_sbindir}/corosync-qdevice-tool %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice +%if %{with systemd} %{_unitdir}/corosync-qdevice.service +%else +%{_initrddir}/corosync-qdevice +%endif %{_mandir}/man8/corosync-qdevice-tool.8* %{_mandir}/man8/corosync-qdevice-net-certutil.8* %{_mandir}/man8/corosync-qdevice.8* @@ -117,22 +149,45 @@ The Corosync Cluster Engine Qdevice %package -n corosync-qnetd Summary: The Corosync Cluster Engine Qdevice Network Daemon Requires: nss-tools +Requires(pre): shadow-utils +%if %{with systemd} %{?systemd_requires} +%endif %description -n corosync-qnetd This package contains the Corosync Cluster Engine Qdevice Network Daemon, script for creating NSS certificates and an init script. +%pre -n corosync-qnetd +getent group coroqnetd >/dev/null || groupadd -r coroqnetd +getent passwd coroqnetd >/dev/null || \ + useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd +exit 0 %post -n corosync-qnetd +%if %{with systemd} && 0%{?systemd_post:1} %systemd_post corosync-qnetd.service +%else +if [ $1 -eq 1 ]; then + /sbin/chkconfig --add corosync-qnetd || : +fi +%endif %preun -n corosync-qnetd +%if %{with systemd} && 0%{?systemd_preun:1} %systemd_preun corosync-qnetd.service +%else +if [ $1 -eq 0 ]; then + /sbin/service corosync-qnetd stop &>/dev/null || : + /sbin/chkconfig --del corosync-qnetd || : +fi +%endif %postun -n corosync-qnetd +%if %{with systemd} && 0%{?systemd_postun:1} %systemd_postun corosync-qnetd.service +%endif %files -n corosync-qnetd %license LICENSE @@ -142,50 +197,19 @@ script for creating NSS certificates and an init script. %{_bindir}/corosync-qnetd-certutil %{_bindir}/corosync-qnetd-tool %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd +%if %{with systemd} %{_unitdir}/corosync-qnetd.service +%else +%{_initrddir}/corosync-qnetd +%endif %{_mandir}/man8/corosync-qnetd-tool.8* %{_mandir}/man8/corosync-qnetd-certutil.8* %{_mandir}/man8/corosync-qnetd.8* -%{_sysusersdir}/corosync-qnetd.conf %changelog -* Tue Nov 25 2025 Jan Friesse - 3.0.4-1 -- New upstream release - -* Wed Jul 23 2025 Fedora Release Engineering - 3.0.3-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Tue Feb 11 2025 Jan Friesse - 3.0.3-9 -- Change sysusers.d config file name to corosync-qnetd.conf -- Remove support for non-systemd builds - -* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek - 3.0.3-8 -- Add sysusers.d config file to allow rpm to create users/groups automatically - -* Thu Jan 16 2025 Fedora Release Engineering - 3.0.3-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Wed Jul 17 2024 Fedora Release Engineering - 3.0.3-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Wed Jan 24 2024 Fedora Release Engineering - 3.0.3-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jan 19 2024 Fedora Release Engineering - 3.0.3-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Wed Jul 19 2023 Fedora Release Engineering - 3.0.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Tue Jun 06 2023 Jan Friesse - 3.0.3-2 -- migrated to SPDX license - * Wed Mar 22 2023 Jan Friesse - 3.0.3-1 - New upstream release -* Thu Jan 19 2023 Fedora Release Engineering - 3.0.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - * Thu Nov 03 2022 Jan Friesse - 3.0.2-1 - New upstream release diff --git a/sources b/sources index 2dd25f0..1da74cd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (corosync-qdevice-3.0.4.tar.gz) = a7e2e1fcab699c6deb0ae01725df6a1d3870c0f874b7dff96f657ac3e0d9fadb682ae145d6a9d29c592ca8f34ad12b8523c6adf9b14b0a01e59d998d8cb8c25f +SHA512 (corosync-qdevice-3.0.3.tar.gz) = f9b63f249199679397d52550540b96d15ea11a417c0b8bfb8c62059bd802c2b6857c4f61e9e3c344c1a6d354e33bb051d32787dead8ceb6fb89062b123761160 diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..e6c79fd --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,3 @@ +# Ignore tests runs/artefacts. +artifacts/** +**/*.retry diff --git a/tests/plan.fmf b/tests/plan.fmf deleted file mode 100644 index 146fa12..0000000 --- a/tests/plan.fmf +++ /dev/null @@ -1,11 +0,0 @@ -summary: Run all smoke tests -discover: - how: fmf -execute: - how: tmt -prepare: - how: install - package: - - iproute - - corosync-qdevice - - corosync-qnetd diff --git a/tests/smoke/main.fmf b/tests/smoke/main.fmf deleted file mode 100644 index c431594..0000000 --- a/tests/smoke/main.fmf +++ /dev/null @@ -1,2 +0,0 @@ -summary: Basic smoke test -test: ./runtest.sh diff --git a/tests/smoke/runtest.sh b/tests/smoke/runtest.sh old mode 100755 new mode 100644 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..9239dcf --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,11 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + tests: + - smoke + required_packages: + - iproute + - corosync-qdevice + - corosync-qnetd