integ/config-files/iptables-config/centos/iptables-config.spec
slin14 2b5e63bc40 refactor iptables
Package iptables-config is created for iptables customized
config file. And there is no other change for iptables, so
we could replace iptables srpm with rpm directly.

iptables-config is set to depends on iptables, so iptables
could be installed automatically.

Test:
Pass build and multi node deploy test. Confirm iptables
config file is the same as before.

Story: 2003768
Task: 27600
Depends-On: https://review.openstack.org/617170

Change-Id: I08daae6f53de43688e9edb2506398e3391589fe0
Signed-off-by: slin14 <shuicheng.lin@intel.com>
2018-11-16 18:28:17 +08:00

49 lines
1.2 KiB
RPMSpec

Summary: StarlingX iptables Configuration File
Name: iptables-config
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
License: Apache-2.0
Group: config-files
Packager: StarlingX
URL: unknown
Source: %name-%version.tar.gz
BuildArch: noarch
Requires: iptables
Requires: iptables-services
Requires: iptables-utils
%define debug_package %{nil}
%description
StarlingX iptables configuration file
%prep
%setup
%build
%install
install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{_datadir}/starlingx
install -m 600 iptables.rules %{buildroot}%{_datadir}/starlingx/iptables.rules
install -m 600 ip6tables.rules %{buildroot}%{_datadir}/starlingx/ip6tables.rules
%post
if [ $1 -eq 1 ] ; then
cp -f %{_datadir}/starlingx/iptables.rules %{_sysconfdir}/sysconfig/iptables
chmod 600 %{_sysconfdir}/sysconfig/iptables
cp -f %{_datadir}/starlingx/ip6tables.rules %{_sysconfdir}/sysconfig/ip6tables
chmod 600 %{_sysconfdir}/sysconfig/ip6tables
fi
%{_bindir}/systemctl enable iptables.service ip6tables.service >/dev/null 2>&1
exit 0
%files
%defattr(-,root,root)
%license LICENSE
%{_datadir}/starlingx/iptables.rules
%{_datadir}/starlingx/ip6tables.rules