%bcond_without check %global debug_package %{nil} %global __os_install_post %{_rpmconfigdir}/brp-compress %global commitId 4addde85f132cc555331041e9a6f7963519c542c %global distro_python_sitelib %(/usr/libexec/platform-python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %global receptorctl_root %{name}-%{commitId}/receptorctl Name: receptor Version: 1.4.1 Release: 1%{?dist} %global common_description %{expand: Project Receptor is a flexible multi-service relayer with remote execution and orchestration capabilities linking controllers with executors across a mesh of nodes.} Summary: Project Receptor is a flexible multi-service relayer with remote execution and orchestration capabilities linking controllers with executors across a mesh of nodes # Upstream license specification: Apache-2.0 License: ASL 2.0 URL: https://github.com/ansible/receptor Source0: receptor-4addde85f132cc555331041e9a6f7963519c542c.tar.gz Source1: receptor.service Source2: receptor@.service Source3: receptor.conf Source4: receptor.conf.example Source5: receptor.logrotate Source6: receptor.te Source7: receptor.py Source8: vendor.tar.gz Patch0: minimum_tls13.patch BuildRequires: golang >= 1.19 BuildRequires: git >= 2.0 BuildRequires: python%{python3_pkgversion}-pyyaml BuildRequires: python%{python3_pkgversion}-dateutil BuildRequires: selinux-policy-devel BuildRequires: systemd Requires: logrotate Requires: sos Requires: systemd Requires(post): libselinux-utils, policycoreutils Requires(postun): libselinux-utils, policycoreutils %description %{common_description} %package -n receptorctl Summary: Command line utility for Receptor URL: https://github.com/ansible/receptor BuildArch: noarch BuildRequires: python%{python3_pkgversion}-click BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-pbr BuildRequires: python%{python3_pkgversion}-rpm-macros BuildRequires: python%{python3_pkgversion}-setuptools Requires: python%{python3_pkgversion}-dateutil Requires: python%{python3_pkgversion}-click Requires: python%{python3_pkgversion}-pyyaml %description -n receptorctl receptorctl is a command line utility for managing Receptor %prep %autosetup -p 1 -n receptor-%{commitId} # Extract vendor directory (source8) into receptor directory %setup -D -T -a 8 -n receptor-%{commitId} # For receptorctl echo %{version} > %{_builddir}/%{receptorctl_root}/.VERSION %build # For receptor go build -mod=vendor -ldflags "-X 'github.com/ansible/receptor/internal/version.Version=%{version}'" -o ./receptor cmd/receptor-cl/receptor.go ./receptor --bash-completion > receptor.completion # SELinux install -m 0644 -vp %{SOURCE6} %{_builddir}/%{name}-%{commitId}/receptor.te make -f /usr/share/selinux/devel/Makefile receptor.pp # For receptorctl cd %{_builddir}/%{receptorctl_root} export PBR_VERSION=%{version} %py3_build %install # For receptor install -m 2775 -vd %{buildroot}/var/run/receptor install -m 0700 -vd %{buildroot}/var/lib/receptor install -m 0755 -vd %{buildroot}/var/log/receptor install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp receptor %{buildroot}%{_bindir}/receptor install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0644 -vp %{SOURCE1} %{buildroot}%{_unitdir}/receptor.service install -m 0644 -vp %{SOURCE2} %{buildroot}%{_unitdir}/receptor@.service install -m 0755 -vd %{buildroot}%{_sysconfdir}/receptor install -m 0644 -vp %{SOURCE3} %{buildroot}%{_sysconfdir}/receptor/receptor.conf install -m 0644 -vp %{SOURCE4} %{buildroot}%{_sysconfdir}/receptor/receptor.conf.example install -m 0755 -vd %{buildroot}%{_datadir}/bash-completion/completions install -m 0644 -vp receptor.completion %{buildroot}%{_datadir}/bash-completion/completions/receptor install -m 0755 -vd %{buildroot}%{_sysconfdir}/logrotate.d install -m 0644 -vp %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/receptor install -m 0755 -vd %{buildroot}%{_datadir}/selinux/packages install -m 0600 -vp receptor.pp %{buildroot}%{_datadir}/selinux/packages/receptor.pp install -m 0755 -vd %{buildroot}%{_datadir}/sosreport/sos/plugins install -m 0644 -vp %{SOURCE7} %{buildroot}%{_datadir}/sosreport/sos/plugins/receptor.py # For receptorctl cd %{_builddir}/%{receptorctl_root} export PBR_VERSION=%{version} %{__python3} setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib} _RECEPTORCTL_COMPLETE=source_bash $RPM_BUILD_ROOT/usr/bin/receptorctl > %{_builddir}/%{receptorctl_root}/receptorctl-completion || true install -m 0755 -vd %{buildroot}%{_datadir}/bash-completion/completions install -m 0644 -vp %{_builddir}/%{receptorctl_root}/receptorctl-completion %{buildroot}%{_datadir}/bash-completion/completions/receptorctl %pre getent group receptor >/dev/null || groupadd -r receptor getent passwd receptor >/dev/null || \ useradd -r -g receptor -d /var/lib/receptor -s /bin/bash receptor %post semodule -n -i %{_datadir}/selinux/packages/receptor.pp if /usr/sbin/selinuxenabled ; then /usr/sbin/load_policy fi; ln -s %{_datadir}/sosreport/sos/plugins/receptor.py %{distro_python_sitelib}/sos/report/plugins/receptor.py || : exit 0 %postun if [ $1 -eq 0 ]; then semodule -n -r receptor if /usr/sbin/selinuxenabled ; then /usr/sbin/load_policy fi; rm -f %{distro_python_sitelib}/sos/report/plugins/receptor.py || : fi; exit 0 %posttrans -n receptorctl # Delete old egg-info find %{python3_sitelib} -name receptorctl-*egg-info |grep -v %{version} |xargs rm -rf %clean rm -rf $RPM_BUILD_ROOT %files %{_bindir}/receptor %{_datadir}/bash-completion/completions/receptor %{_datadir}/selinux/packages/receptor.pp %{_datadir}/sosreport/sos/plugins/receptor.py %config(noreplace) %attr(0755,receptor,receptor) %{_sysconfdir}/receptor/receptor.conf %attr(0755,receptor,receptor) %{_sysconfdir}/receptor/receptor.conf.example %{_unitdir}/receptor.service %{_unitdir}/receptor@.service %{_sysconfdir}/logrotate.d/receptor %dir %attr(2775,receptor,receptor) /var/run/receptor %dir %attr(0700,receptor,receptor) /var/lib/receptor %dir %attr(0755,receptor,receptor) /var/log/receptor %dir %attr(0755,receptor,receptor) %{_sysconfdir}/receptor %files -n receptorctl %{_bindir}/receptorctl %{_datadir}/bash-completion/completions/receptorctl %{python3_sitelib}/receptorctl %{python3_sitelib}/receptorctl-%{version}*-py%{python3_version}.egg-info %defattr(-,root,root) %changelog * Thu Jun 08 2023 Satoe Imaishi - 1.4.1-1 - Update to 1.4.1 * Wed May 17 2023 Satoe Imaishi - 1.3.1-3 - Rebuild with golang 1.19 * Fri Apr 14 2023 Dimitri Savineau - 1.3.1-2 - Rebuild for multiarch * Mon Feb 06 2023 Satoe Imaishi - 1.3.1-1 - Build Receptor 1.3.1 * Thu Dec 08 2022 Satoe Imaishi - 1.3.0-2 - Build Receptor 1.3.0 - Fix egg-info directory from old package not being deleted on upgrade * Tue May 31 2022 Satoe Imaishi - 1.2.3-3 - Build Receptor 1.2.3-3, set MinTLS13 to true * Mon May 02 2022 Christian Adams - 1.2.3-1 - Build Receptor 1.2.3-1 * Mon Apr 04 2022 Christian Adams - 1.2.2-1 - Build Receptor 1.2.2-1 * Mon Apr 04 2022 Paul Belanger - 1.2.1-3 - rebuilt to make CPaaS happy * Wed Mar 30 2022 Christian Adams - 1.2.1-2 - Added work release --all option - Quick connections now utilize MaxIdleConnection - Support for pinned certificates - Added support for Go 1.17 - Fixed deadlock in handleMessageData - Additional error handling and dependency updates * Thu Nov 18 2021 Christian Adams - 1.1.1-2 - Receptor 1.1.1-2 Release - Create receptor user, group and home directory. - Add a receptor.service file to use a default receptor.conf to improve user experience. - Start services with receptor user and group. * Mon Jun 28 2021 Satoe Imaishi - 1.0.0-1 - Receptor 1.0.0-1