File snmpb.spec of Package snmpb
#
# spec file for package snmpb
#
# Copyright (c) 2019, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: snmpb
Version: 1.0.0+git.20180127
Release: 0
Summary: An graphical SNMP MIB browser
License: GPL-2.0-only
Group: Productivity/Networking/Other
URL: https://github.com/gavioto/snmpb-code
Source: %{name}-%{version}.tar.xz
Patch0: fix-makefile.patch
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: libqt5-qtbase-devel
BuildRequires: update-desktop-files
%description
SnmpB is an SNMP MIB browser written in QT. It supports SNMPv1,
SNMPv2c & SNMPv3. SnmpB can browse/edit/load/add MIB files and
can query SNMP agents. It also supports agent discovery, trap
events, and graph plotting.
%prep
%setup -q
%patch0 -p1
chmod -x license.txt
%build
sed -i 's|-o root||g' Makefile
make %{?_smp_mflags}
%install
%make_install INSTALL_PREFIX=%{buildroot}/%{_prefix}
rm -f %{buildroot}/%{_datadir}/applications/defaults.list
rm -f %{buildroot}/%{_datadir}/pixmaps/snmpb.png
rm -f %{buildroot}/%{_datadir}/applications/snmpb.desktop
%suse_update_desktop_file -c snmpb SnmpB "SNMP MIB Browser" snmpb snmpb "Network;System"
%verifyscript
%verify_permissions -e %{_bindir}/snmpb
%post
%set_permissions %{_bindir}/snmpb
exit 0
%files
%license license.txt
%doc changelog.txt readme.txt
%{_bindir}/snmpb
# set CAP_NET_BIND_SERVICE to allow snmpd to bind udp port 162 to receive SNMP traps
%verify(not mode caps) %attr(0755,root,root) %caps(CAP_NET_BIND_SERVICE=+eip) %{_bindir}/snmpb
%{_datadir}/applications/snmpb.desktop
%dir %{_datadir}/snmpb
%{_datadir}/snmpb/mibs/
%{_datadir}/snmpb/pibs/
%{_datadir}/mime/packages/snmpb.xml
%{_datadir}/icons/hicolor/*/apps/snmpb.*
%changelog