Daemon that listens for AMQP messages to add IP addresses and ports to FirewallD. IP addresses expire and are removed automatically after a configurable timeout.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.9 KiB

# Disable LTO objects.
%global _lto_cflags %{nil}
%global build_timestamp %(date +"%Y%m%d")
%global kfa_install_dir /opt/kazoo_firewall_agent
# This project looks not to provide debugging symbols. Disable building debug symbols for this package.
%define debug_package %{nil}
# Define custom_version=1.0 if not defined when rpmbuild was called.
%{!?custom_version: %global custom_version 1.0}
# Define custom_release={build_timestamp} if not defined when rpmbuild was called.
%{!?custom_release: %global custom_release %{build_timestamp}}
Summary: Kazoo Firewall Agent
Name: kazoo_firewall_agent
Version: %{custom_version}
%dnl Release: %{build_timestamp}%{?dist}
Release: %{custom_release}%{?dist}
License: Unknown
URL: https://bitbucket.org/gofiber-india/kazoo_firewall_agent
Source0: kazoo_firewall_agent.tar.gz
# Runtime required packages.
Requires: glibc
Requires: systemd
Requires: firewalld
BuildRequires: make
BuildRequires: go
# Needed for {_unitdir} macro to exist, which is used for installing service unit files in proper locations.
BuildRequires: systemd
%description
Use in conjunction with call_shield Kazoo application.
%prep
%setup -n kazoo_firewall_agent
%build
go build
%install
mkdir -p %{buildroot}%{kfa_install_dir}
mkdir -p %{buildroot}%{_unitdir}
cp ./%{name} %{buildroot}%{kfa_install_dir}/.
cp ./%{name}.service %{buildroot}%{_unitdir}/.
cp ./%{name}_config.json.sample %{buildroot}%{kfa_install_dir}/%{name}_config.json
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%dir %{kfa_install_dir}
%{kfa_install_dir}/%{name}
# Don't replace existing configuration file.
%config(noreplace) %{kfa_install_dir}/%{name}_config.json
%{_unitdir}/%{name}.service
%post
/usr/bin/systemctl -q enable %{name}.service
%preun
%{?systemd_preun %{name}.service}
%postun
%{?systemd_postun %{name}.service}
%changelog
* Thu Jun 19 2025 PBX.com LLC <packages@pbx.com> 1.0
- Initial release for RPM based distros