diff --git a/resource-agents.spec b/resource-agents.spec new file mode 100644 index 0000000000000000000000000000000000000000..6d9ab03e54a00bc44c2fd0aae634c8a189ac0514 --- /dev/null +++ b/resource-agents.spec @@ -0,0 +1,229 @@ +%define anolis_release 1 + +# determine the ras-set to process based on configure invokation +%bcond_with rgmanager +%bcond_without linuxha + +Name: resource-agents +Summary: Open Source HA Reusable Cluster Resource Scripts +Version: 4.12.0 +Release: %{anolis_release}%{?dist} +License: GPLv2+ and LGPLv2+ +URL: https://github.com/ClusterLabs/resource-agents +Source0: https://github.com/ClusterLabs/resource-agents/archive/refs/tags/v%{version}.tar.gz +Obsoletes: heartbeat-resources <= %{version} +Provides: heartbeat-resources = %{version} + +# Build dependencies +BuildRequires: make +BuildRequires: automake autoconf pkgconfig gcc +BuildRequires: perl +BuildRequires: libxslt glib2-devel +BuildRequires: systemd +BuildRequires: which +BuildRequires: python3-devel + +%ifarch x86_64 +BuildRequires: python3-pyroute2 +%endif + +BuildRequires: docbook-style-xsl docbook-dtds +BuildRequires: libnet-devel + +## Runtime deps +# system tools shared by several agents +Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk +Requires: /bin/ps /usr/bin/pkill /usr/bin/hostname /usr/bin/netstat +Requires: /bin/mount +Requires: /usr/sbin/fuser + +# Filesystem / fs.sh / netfs.sh +Requires: /sbin/fsck +Requires: /usr/sbin/fsck.ext2 /usr/sbin/fsck.ext3 /usr/sbin/fsck.ext4 +Requires: /usr/sbin/fsck.xfs +Requires: /sbin/mount.nfs /sbin/mount.nfs4 +Recommends: /usr/sbin/mount.cifs + +# IPaddr2 +Requires: /sbin/ip + +# LVM / lvm.sh +Requires: /usr/sbin/lvm + +# nfsserver / netfs.sh +Requires: /sbin/rpc.statd +Requires: /usr/sbin/rpc.nfsd /usr/sbin/rpc.mountd + +# rgmanager +%if %{with rgmanager} +# ip.sh +Requires: /usr/sbin/ethtool +Requires: /sbin/rdisc /usr/sbin/arping /bin/ping /bin/ping6 + +# nfsexport.sh +Requires: /sbin/findfs +Requires: /sbin/quotaon /sbin/quotacheck +%endif + +%description +A set of scripts to interface with several services to operate in a +High Availability environment for both Pacemaker and rgmanager +service managers. + +%if %{with linuxha} +%package -n ldirectord +License: GPLv2+ +Summary: A Monitoring Daemon for Maintaining High Availability Resources +Obsoletes: heartbeat-ldirectord <= %{version} +Provides: heartbeat-ldirectord = %{version} +BuildRequires: perl-podlators +Requires: perl(Net::SSLeay) perl-libwww-perl perl-MailTools +Requires: ipvsadm logrotate +Requires: perl-Net-IMAP-Simple-SSL perl-IO-Socket-INET6 +BuildRequires: systemd +%{?systemd_requires} + +%description -n ldirectord +The Linux Director Daemon (ldirectord) was written by Jacob Rief. + + +ldirectord is a stand alone daemon for monitoring the services on real +servers. Currently, HTTP, HTTPS, and FTP services are supported. +ldirectord is simple to install and works with Pacemaker +(http://clusterlabs.org/). + +See 'ldirectord -h' and linux-ha/doc/ldirectord for more information. +%endif + +%prep +%autosetup -p1 + +%build +if [ ! -f configure ]; then + ./autogen.sh +fi + +CFLAGS="$(echo '%{optflags}')" +%global conf_opt_fatal "--enable-fatal-warnings=no" + +%if %{with rgmanager} +%global rasset rgmanager +%endif +%if %{with linuxha} +%global rasset linux-ha +%endif +%if %{with rgmanager} && %{with linuxha} +%global rasset all +%endif + +export CFLAGS + +%configure \ + PYTHON="%{__python3}" \ + %{conf_opt_fatal} \ + SYSTEMD_UNIT_DIR=%{_unitdir} \ + SYSTEMD_TMPFILES_DIR=%{_tmpfilesdir} \ + --with-rsctmpdir=/run/resource-agents \ + --with-pkg-name=%{name} \ + --with-ras-set=%{rasset} + +%make_build + +%install +%make_install + +## tree fixup +# remove docs (there is only one and they should come from doc sections in files) +rm -rf %{buildroot}/usr/share/doc/resource-agents + +%files +%license COPYING COPYING.GPLv3 COPYING.LGPL +%doc ChangeLog AUTHORS +%if %{with linuxha} +%doc heartbeat/README.galera +%doc doc/README.webapps +%doc %{_datadir}/%{name}/ra-api-1.dtd +%doc %{_datadir}/%{name}/metadata.rng +%endif + +%if %{with rgmanager} +%{_datadir}/cluster +%{_sbindir}/rhev-check.sh +%endif + +%if %{with linuxha} +%dir %{_usr}/lib/ocf +%dir %{_usr}/lib/ocf/resource.d +%dir %{_usr}/lib/ocf/lib + +%{_usr}/lib/ocf/lib/heartbeat + +%{_usr}/lib/ocf/resource.d/heartbeat +%if %{with rgmanager} +%{_usr}/lib/ocf/resource.d/redhat +%endif + +%{_datadir}/pkgconfig/%{name}.pc + +%{_unitdir}/resource-agents-deps.target +%if %{defined _tmpfilesdir} +%{_tmpfilesdir}/%{name}.conf +%endif + +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/ocft +%{_datadir}/%{name}/ocft/configs +%{_datadir}/%{name}/ocft/caselib +%{_datadir}/%{name}/ocft/README +%{_datadir}/%{name}/ocft/README.zh_CN +%{_datadir}/%{name}/ocft/helpers.sh +%exclude %{_datadir}/%{name}/ocft/runocft +%exclude %{_datadir}/%{name}/ocft/runocft.prereq + +%{_sbindir}/ocf-tester +%{_sbindir}/ocft + +%{_includedir}/heartbeat + +%dir %attr (1755, root, root) /run/resource-agents + +%{_mandir}/man7/*.7* +%{_mandir}/man8/ocf-tester.8* + +# For compatability with pre-existing agents +%dir %{_sysconfdir}/ha.d +%{_sysconfdir}/ha.d/shellfuncs + +%{_libexecdir}/heartbeat + +%if %{with rgmanager} +%post -n resource-agents +ccs_update_schema > /dev/null 2>&1 ||: +%endif + +%preun -n ldirectord +%systemd_preun ldirectord.service + +%postun -n ldirectord +%systemd_postun_with_restart ldirectord.service + +%post -n ldirectord +%systemd_post ldirectord.service + +%files -n ldirectord +%license COPYING +%{_sbindir}/ldirectord +%doc ldirectord/ldirectord.cf +%{_mandir}/man8/ldirectord.8* +%config(noreplace) %{_sysconfdir}/logrotate.d/ldirectord +%dir %{_sysconfdir}/ha.d +%dir %{_sysconfdir}/ha.d/resource.d +%{_sysconfdir}/ha.d/resource.d/ldirectord +%{_unitdir}/ldirectord.service +%exclude %{_sysconfdir}/rc.d/init.d/ldirectord +%{_usr}/lib/ocf/resource.d/heartbeat/ldirectord +%endif + +%changelog +* Sun May 14 2023 Funda Wang - 4.12.0-1 +- Import package for anolis 23 diff --git a/v4.12.0.tar.gz b/v4.12.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0ad6b5a92e4ef06636f4f349a1a3ddcd737a7c10 Binary files /dev/null and b/v4.12.0.tar.gz differ