integ/base/net-snmp-config/centos/net-snmp-config.spec
zhipengl 96ebc7d181 Refactor patches for net-snmp package
Use net-snmp-config package to package script and service file for
net-snmp package.
Removed servcie/config/script related patches and let net-snmp-config
package be responsible for it.
Keep another meta patch for build configuration related changes.

Deployment test and ping test between VMs pass
Config,serivce and script files check pass.

Story: 2003768
Task: 27586
Depends-on: https://review.openstack.org/#/c/616097

Change-Id: Ic64543447d04543fdf9eafdc3d9ae4e2521c10df
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
2018-11-26 01:21:38 +00:00

49 lines
1.4 KiB
RPMSpec

Summary: net-snmp-config
Name: net-snmp-config
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
License: Apache-2.0
Group: base
Packager: StarlingX
URL: unknown
BuildArch: noarch
Source: %name-%version.tar.gz
Requires: net-snmp
Summary: package StarlingX configuration files of net-snmp to system folder.
%description
package StarlingX configuration files of net-snmp to system folder.
%prep
%setup
%build
%install
%{__install} -d %{buildroot}%{_datadir}/starlingx
%{__install} -d %{buildroot}%{_datadir}/snmp
%{__install} -d %{buildroot}%{_initrddir}
%{__install} -d %{buildroot}%{_sysconfdir}/systemd/system
%{__install} -m 644 stx.snmpd.conf %{buildroot}%{_datadir}/starlingx/stx.snmpd.conf
%{__install} -m 755 stx.snmpd %{buildroot}%{_initddir}/snmpd
%{__install} -m 660 stx.snmp.conf %{buildroot}%{_datadir}/snmp/snmp.conf
%{__install} -m 644 snmpd.service %{buildroot}%{_sysconfdir}/systemd/system/snmpd.service
%post
if [ $1 -eq 1 ] ; then
# Initial installation
cp -f %{_datadir}/starlingx/stx.snmpd.conf %{_sysconfdir}/snmp/snmpd.conf
chmod 640 %{_sysconfdir}/snmp/snmpd.conf
chmod 640 %{_sysconfdir}/snmp/snmptrapd.conf
fi
%{_bindir}/systemctl disable snmpd.service
%files
%{_datadir}/starlingx/stx.snmpd.conf
%{_initddir}/snmpd
%config(noreplace) %attr(0660,snmpd,snmpd) %{_datadir}/snmp/snmp.conf
%{_sysconfdir}/systemd/system/snmpd.service