#2 Massive set of spec improvements
Closed 6 years ago by jridky. Opened 6 years ago by kloczek.
rpms/ kloczek/net-snmp master  into  master

@@ -1,24 +0,0 @@ 

- diff -up net-snmp-5.7.2/agent/Makefile.in.pie net-snmp-5.7.2/agent/Makefile.in

- --- net-snmp-5.7.2/agent/Makefile.in.pie	2012-10-10 00:28:58.000000000 +0200

- +++ net-snmp-5.7.2/agent/Makefile.in	2012-10-18 09:45:13.298613099 +0200

- @@ -294,7 +294,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c

-  	$(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $? 

-  

-  snmpd$(EXEEXT):	${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG) 

- -	$(LINK) $(CFLAGS) -o $@ ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS}

- +	$(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS}

-  

-  libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION):    ${LLIBAGENTOBJS} $(USELIBS)

-  	$(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@

- diff -up net-snmp-5.7.2/apps/Makefile.in.pie net-snmp-5.7.2/apps/Makefile.in

- --- net-snmp-5.7.2/apps/Makefile.in.pie	2012-10-10 00:28:58.000000000 +0200

- +++ net-snmp-5.7.2/apps/Makefile.in	2012-10-18 09:44:27.827774580 +0200

- @@ -170,7 +170,7 @@ snmptest$(EXEEXT):    snmptest.$(OSUFFIX

-  	$(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS}

-  

-  snmptrapd$(EXEEXT):    $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)

- -	$(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS}

- +	$(LINK) ${CFLAGS} -o $@ -pie $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS}

-  

-  snmptrap$(EXEEXT):    snmptrap.$(OSUFFIX) $(USELIBS)

-  	$(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) ${LDFLAGS} ${LIBS}

@@ -127,59 +127,6 @@ 

                   AC_DEFINE(HAVE_LIBSSL, 1,

                       [Define to 1 if you have the `ssl' library (-lssl).])

                   LIBCRYPTO=" -lssl $LIBCRYPTO",	

- diff -urNp old/configure.systemd new/configure.systemd

- --- old/configure.systemd	2014-12-08 21:23:37.000000000 +0100

- +++ new/configure.systemd	2017-02-20 10:49:36.601692898 +0100

- @@ -23146,9 +23146,9 @@ $as_echo "#define HAVE_AES_CFB128_ENCRYP

-  fi

-  

-  

- -            as_ac_Lib=`$as_echo "ac_cv_lib_${CRYPTO}''_EVP_MD_CTX_create" | $as_tr_sh`

- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_create in -l${CRYPTO}" >&5

- -$as_echo_n "checking for EVP_MD_CTX_create in -l${CRYPTO}... " >&6; }

- +            as_ac_Lib=`$as_echo "ac_cv_lib_${CRYPTO}''_EVP_MD_CTX_new" | $as_tr_sh`

- +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -l${CRYPTO}" >&5

- +$as_echo_n "checking for EVP_MD_CTX_new in -l${CRYPTO}... " >&6; }

-  if eval \${$as_ac_Lib+:} false; then :

-    $as_echo_n "(cached) " >&6

-  else

- @@ -23163,11 +23163,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_

-  #ifdef __cplusplus

-  extern "C"

-  #endif

- -char EVP_MD_CTX_create ();

- +char EVP_MD_CTX_new ();

-  int

-  main ()

-  {

- -return EVP_MD_CTX_create ();

- +return EVP_MD_CTX_new ();

-    ;

-    return 0;

-  }

- @@ -23186,10 +23186,10 @@ eval ac_res=\$$as_ac_Lib

-  $as_echo "$ac_res" >&6; }

-  if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :

-  

- -$as_echo "#define HAVE_EVP_MD_CTX_CREATE /**/" >>confdefs.h

- +$as_echo "#define HAVE_EVP_MD_CTX_NEW /**/" >>confdefs.h

-  

-  

- -$as_echo "#define HAVE_EVP_MD_CTX_DESTROY /**/" >>confdefs.h

- +$as_echo "#define HAVE_EVP_MD_CTX_FREE /**/" >>confdefs.h

-  

-  fi

-  

- @@ -23263,7 +23263,7 @@ char SSL_library_init ();

-  int

-  main ()

-  {

- -return SSL_library_init ();

- +return OPENSSL_init_ssl(0, NULL);

-    ;

-    return 0;

-  }

- diff -urNp old/include/net-snmp/net-snmp-config.h.in new/include/net-snmp/net-snmp-config.h.in

  --- old/include/net-snmp/net-snmp-config.h.in	2017-02-20 10:08:16.443522417 +0100

  +++ new/include/net-snmp/net-snmp-config.h.in	2017-02-20 10:24:05.790584283 +0100

  @@ -149,11 +149,11 @@
@@ -198,26 +145,6 @@ 

   

   /* Define if you have EVP_sha224/256 in openssl */

   #undef HAVE_EVP_SHA224

- diff -urNp old/include/net-snmp/net-snmp-config.h.in.systemd new/include/net-snmp/net-snmp-config.h.in.systemd

- --- old/include/net-snmp/net-snmp-config.h.in.systemd	2014-12-08 21:23:22.000000000 +0100

- +++ new/include/net-snmp/net-snmp-config.h.in.systemd	2017-02-20 10:24:43.996918184 +0100

- @@ -149,11 +149,11 @@

-  /* Define to 1 if you have the `eval_pv' function. */

-  #undef HAVE_EVAL_PV

-  

- -/* Define to 1 if you have the `EVP_MD_CTX_create' function. */

- -#undef HAVE_EVP_MD_CTX_CREATE

- +/* Define to 1 if you have the `EVP_MD_CTX_new' function. */

- +#undef HAVE_EVP_MD_CTX_NEW

-  

- -/* Define to 1 if you have the `EVP_MD_CTX_destroy' function. */

- -#undef HAVE_EVP_MD_CTX_DESTROY

- +/* Define to 1 if you have the `EVP_MD_CTX_free' function. */

- +#undef HAVE_EVP_MD_CTX_FREE

-  

-  /* Define if you have EVP_sha224/256 in openssl */

-  #undef HAVE_EVP_SHA224

- diff -urNp old/snmplib/keytools.c new/snmplib/keytools.c

  --- old/snmplib/keytools.c	2014-12-08 21:23:22.000000000 +0100

  +++ new/snmplib/keytools.c	2017-02-20 10:30:27.412068264 +0100

  @@ -149,8 +149,8 @@ generate_Ku(const oid * hashtype, u_int

@@ -0,0 +1,46 @@ 

+ --- net-snmp-5.7.3/configure.d/config_os_libs2

+ +++ net-snmp-5.7.3/configure.d/config_os_libs2

+ @@ -511,6 +511,16 @@ if test "x$with_mysql" = "xyes" ; then

+        [AC_MSG_RESULT(no)

+         AC_DEFINE([HAVE_BROKEN_LIBMYSQLCLIENT], 1,

+                   [Define if using MY_INIT() causes a linker error])])

+ +  AC_MSG_CHECKING([whether my_load_defaults() exists])

+ +  AC_LINK_IFELSE([

+ +    AC_LANG_PROGRAM(

+ +      [[#include <my_global.h>

+ +        #include <my_sys.h>]],

+ +      [[my_load_defaults("my_init_test")]])],

+ +      [AC_MSG_RESULT(yes)

+ +       AC_DEFINE([HAVE_MY_LOAD_DEFAULTS], 1,

+ +                 [Define if having my_load_defaults])],

+ +      [AC_MSG_RESULT(no)])

+    CPPFLAGS="${_cppflags}"

+    LIBS="${_libs}"

+    AC_MSG_CACHE_ADD(MYSQL Trap Logging:         enabled)

+ --- net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in

+ +++ net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in

+ @@ -464,6 +464,9 @@

+  /* Define to 1 if you have the <mtab.h> header file. */

+  #undef HAVE_MTAB_H

+  

+ +/* Define if having my_load_defaults */

+ +#undef HAVE_MY_LOAD_DEFAULTS

+ +

+  /* Define to 1 if you have the <nbutil.h> header file. */

+  #undef HAVE_NBUTIL_H

+  

+ --- net-snmp-5.7.3/apps/snmptrapd_sql.c

+ +++ net-snmp-5.7.3/apps/snmptrapd_sql.c

+ @@ -444,8 +444,12 @@

+  #endif

+  

+      /** load .my.cnf values */

+ +#if HAVE_MY_LOAD_DEFAULTS

+ +    my_load_defaults ("my", _sql.groups, &not_argc, &not_argv, 0);

+ +#else

+      load_defaults ("my", _sql.groups, &not_argc, &not_argv);

+  #endif

+ +#endif

+      for(i=0; i < not_argc; ++i) {

+          if (NULL == not_argv[i])

+              continue;

@@ -0,0 +1,11 @@ 

+ --- net-snmp-5.7.3/Makefile.in~

+ +++ net-snmp-5.7.3/Makefile.in

+ @@ -230,7 +230,7 @@

+          fi

+  

+  pythoninstall:

+ -	@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir) ; \

+ +	@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir --root=$(DESTDIR) --prefix=$(prefix)) ; \

+          if test $$? != 0 ; then \

+             exit 1 ; \

+          fi

@@ -0,0 +1,52 @@ 

+ --- net-snmp-5.7.3/net-snmp-config.in~	2017-12-29 13:46:53.000000000 +0100

+ +++ net-snmp-5.7.3/net-snmp-config.in	2017-12-29 14:26:29.399840447 +0100

+ @@ -188,13 +188,13 @@

+      #################################################### client lib

+      --libs)

+        # use this one == --netsnmp-libs + --external-libs

+ -      echo $NSC_LDFLAGS $NSC_LIBDIR $NSC_SNMPLIBS $NSC_LIBS

+ +      echo $NSC_LIBDIR $NSC_SNMPLIBS $NSC_LIBS

+        ;;

+      --netsnmp-libs)

+        echo $NSC_LIBDIR $NSC_BASE_SNMP_LIBS

+        ;;

+      --external-libs)

+ -      echo $NSC_LDFLAGS $NSC_LNETSNMPLIBS $NSC_LIBS @PERLLDOPTS_FOR_APPS@

+ +      echo $NSC_LNETSNMPLIBS $NSC_LIBS @PERLLDOPTS_FOR_APPS@

+        ;;

+      #################################################### agent lib

+      --base-agent-libs)

+ @@ -205,13 +205,13 @@

+        ;;

+      --agent-libs)

+        # use this one == --netsnmp-agent-libs + --external-libs

+ -      echo $NSC_LDFLAGS $NSC_LIBDIR $NSC_AGENTLIBS $NSC_LIBS

+ +      echo $NSC_LIBDIR $NSC_AGENTLIBS $NSC_LIBS

+        ;;

+      --netsnmp-agent-libs)

+        echo $NSC_LIBDIR $NSC_BASE_AGENT_LIBS

+        ;;

+      --external-agent-libs)

+ -      echo $NSC_LDFLAGS $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS

+ +      echo $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS

+        ;;

+      ####################################################

+      --version|--ver*)

+ --- net-snmp-5.7.3/python/setup.py~	2014-12-08 21:23:22.000000000 +0100

+ +++ net-snmp-5.7.3/python/setup.py	2017-12-29 14:50:06.670042765 +0100

+ @@ -16,6 +16,7 @@

+  

+  if intree:

+      netsnmp_libs = os.popen(basedir+'/net-snmp-config --libs').read()

+ +    ldflags = os.popen(basedir+'/net-snmp-config --ldflags').read().split()

+      libdir = os.popen(basedir+'/net-snmp-config --build-lib-dirs '+basedir).read()

+      incdir = os.popen(basedir+'/net-snmp-config --build-includes '+basedir).read()

+      libs = re.findall(r"-l(\S+)", netsnmp_libs)

+ @@ -41,6 +42,7 @@

+         Extension("netsnmp.client_intf", ["netsnmp/client_intf.c"],

+                   library_dirs=libdirs,

+                   include_dirs=incdirs,

+ +                 extra_link_args=ldflags,

+                   libraries=libs )

+         ]

+      )

file removed
-1
@@ -1,1 +0,0 @@ 

- d	/var/run/net-snmp	0755	root	root

file added
+50
@@ -0,0 +1,50 @@ 

+ --- net-snmp-5.7.3/README

+ +++ net-snmp-5.7.3/README

+ @@ -300,7 +300,7 @@

+      Bert Driehuis <driehuis@playbeing.org>

+      Juergen Schoenwaelder <schoenw@ibr.cs.tu-bs.de>

+      Frank Strauss <strauss@ibr.cs.tu-bs.de>

+ -    Ragnar Kj�rstad <ucd@ragnark.vestdata.no>

+ +    Ragnar Kjørstad <ucd@ragnark.vestdata.no>

+      Jochen Kmietsch <jochen.kmietsch@tu-clausthal.de>

+      Jun-ichiro itojun Hagino <itojun@iijlab.net>

+      John L Villalovos <john.l.villalovos@intel.com>

+ --- net-snmp-5.7.3/COPYING

+ +++ net-snmp-5.7.3/COPYING

+ @@ -96,7 +96,7 @@

+  

+  ---- Part 4: Sun Microsystems, Inc. copyright notice (BSD) -----

+  

+ -Copyright � 2003 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 

+ +Copyright © 2003 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 

+  California 95054, U.S.A. All rights reserved.

+  

+  Use is subject to license terms below.

+ @@ -109,17 +109,17 @@

+  Redistribution and use in source and binary forms, with or without

+  modification, are permitted provided that the following conditions are met:

+  

+ -*  Redistributions of source code must retain the above copyright notice,

+ -    this list of conditions and the following disclaimer.

+ +* Redistributions of source code must retain the above copyright notice,

+ +  this list of conditions and the following disclaimer.

+  

+ -*  Redistributions in binary form must reproduce the above copyright

+ -    notice, this list of conditions and the following disclaimer in the

+ -    documentation and/or other materials provided with the distribution.

+ -

+ -*  Neither the name of the Sun Microsystems, Inc. nor the

+ -    names of its contributors may be used to endorse or promote

+ -    products derived from this software without specific prior written

+ -    permission.

+ +* Redistributions in binary form must reproduce the above copyright

+ +  notice, this list of conditions and the following disclaimer in the

+ +  documentation and/or other materials provided with the distribution.

+ +

+ +* Neither the name of the Sun Microsystems, Inc. nor the

+ +  names of its contributors may be used to endorse or promote

+ +  products derived from this software without specific prior written

+ +  permission.

+  

+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS

+  IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,

file modified
+238 -332
@@ -1,158 +1,121 @@ 

- # use nestnmp_check 0 to speed up packaging by disabling 'make test'

- %{!?netsnmp_check: %global netsnmp_check 1}

+ # Conditonaly build switches:

+ %bcond_without	mysql			# Default: build snmptrapd with MySQL

+ 					#          backend traps data collector

  

- # allow compilation on Fedora 11 and older

- %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

  # Arches on which we need to prevent arch conflicts on net-snmp-config.h

  %global multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 sparc sparcv9 sparc64 aarch64

  

- Summary: A collection of SNMP protocol tools and libraries

- Name: net-snmp

- Version: 5.7.3

- Release: 28%{?dist}

- Epoch: 1

- 

- License: BSD

- Group: System Environment/Daemons

- URL: http://net-snmp.sourceforge.net/

- Source0: https://downloads.sourceforge.net/project/net-snmp/net-snmp/%{version}/net-snmp-%{version}.tar.gz

- Source1: net-snmp.redhat.conf

- Source2: net-snmpd.init

- Source3: net-snmptrapd.init

- Source4: net-snmp-config.h

- Source5: net-snmp-config

- Source6: net-snmp-trapd.redhat.conf

- Source7: net-snmpd.sysconfig

- Source8: net-snmptrapd.sysconfig

- Source9: net-snmp-tmpfs.conf

- Source10: snmpd.service

- Source11: snmptrapd.service

- Source12: IETF-MIB-LICENSE.txt

- Patch1: net-snmp-5.7.2-pie.patch

- Patch2: net-snmp-5.5-dir-fix.patch

- Patch3: net-snmp-5.6-multilib.patch

- Patch4: net-snmp-5.5-apsl-copying.patch

- Patch5: net-snmp-5.6-test-debug.patch

- Patch6: net-snmp-5.7.2-systemd.patch

- Patch7: net-snmp-5.7.2-create-user-multilib.patch

- Patch8: net-snmp-5.7.2-autoreconf.patch

- Patch9: net-snmp-5.7-agentx-crash.patch

- Patch10: net-snmp-5.5-agentx-disconnect-crash.patch

- Patch11: net-snmp-5.7.2-cert-path.patch

- Patch12: net-snmp-5.7.3-snmpstatus-null.patch

- Patch13: net-snmp-5.7.3-cflags.patch

- # Remove U64 typedef to build against Perl 5.24

- # Backported from upstream

- Patch14: net-snmp-5.7.3-Remove-U64-typedef.patch

- # Fixed Makefile.PL to build against Perl 5.24

- # For more info: https://rt.perl.org/Public/Bug/Display.html?id=125907

- Patch15: net-snmp-5.7.3-Fix-Makefile-PL.patch

- # Use strtok_r for strtok to avoid a race condition

- Patch16: net-snmp-5.7.3-strtok-r.patch

- # Fix build with MariaDB 10.2

- # https://sourceforge.net/p/net-snmp/bugs/2782/

- # Josef's patch from https://sourceforge.net/p/net-snmp/bugs/2782/#cbed

- # but with the config_os_libs2 portion removed

- Patch17: net-snmp-5.7.3-mariadb102.patch

- # Fix issue with undefined symbol my_progname when try to load

- # NetSNMP::TrapReceiver in perl script (#1470004)

- # https://sourceforge.net/p/net-snmp/bugs/2792/

- # https://sourceforge.net/p/net-snmp/bugs/2792/attachment/0001-Link-libnetsnmptrapd-against-MYSQL_LIBS.patch

- # (rebased on 5.7.3)

- Patch18: 0001-Link-libnetsnmptrapd-against-MYSQL_LIBS.patch

- 

- Patch19: net-snmp-5.7.3-mariadb-connector-c.patch

- 

- # This patch fix issue with new OpenSLL library in rawhide (f26+)

- # !!!WARNING!!!   DO NOT USE IT FOR OLDER FEDORA RELEASES (>f26)

- Patch100: net-snmp-5.7.3-openssl.patch

- 

- # Modern RPM API means at least EL6

- Patch101: net-snmp-5.7.3-modern-rpm-api.patch

- 

- Requires(post): chkconfig

- Requires(preun): chkconfig

- # for /sbin/service

- Requires(preun): initscripts

- # for /bin/rm

- Requires(preun): coreutils

- Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

- Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}

+ Summary:	A collection of SNMP protocol tools and libraries

+ Name:		net-snmp

+ Version:	5.7.3

+ Release:	29%{?dist}

+ Epoch:		1

+ License:	BSD

+ URL:		http://net-snmp.sf.net/

+ Source0:	https://downloads.sf.net/project/net-snmp/net-snmp/%{version}/net-snmp-%{version}.tar.gz

+ Source1:	net-snmp.redhat.conf

+ Source4:	net-snmp-config.h

+ Source5:	net-snmp-config

+ Source6:	net-snmp-trapd.redhat.conf

+ Source7:	net-snmpd.sysconfig

+ Source8:	net-snmptrapd.sysconfig

+ Source10:	snmpd.service

+ Source11:	snmptrapd.service

+ Source12:	IETF-MIB-LICENSE.txt

+ Patch0:		%{name}-5.5-dir-fix.patch

+ Patch1:		%{name}-5.6-multilib.patch

+ Patch2:		%{name}-5.5-apsl-copying.patch

+ Patch3:		%{name}-5.6-test-debug.patch

+ Patch4:		%{name}-5.7.2-systemd.patch

+ Patch5:		%{name}-5.7.2-create-user-multilib.patch

+ Patch7:		%{name}-5.7.2-autoreconf.patch

+ Patch8:		%{name}-5.7-agentx-crash.patch

+ Patch9:		%{name}-5.5-agentx-disconnect-crash.patch

+ Patch10:	%{name}-5.7.2-cert-path.patch

+ Patch11:	%{name}-5.7.3-snmpstatus-null.patch

+ Patch12:	%{name}-5.7.3-cflags.patch

+ Patch13:	%{name}-5.7.3-Remove-U64-typedef.patch

+ Patch14:	%{name}-5.7.3-Fix-Makefile-PL.patch

+ Patch15:	%{name}-5.7.3-strtok-r.patch

+ Patch16:	%{name}-5.7.3-mariadb102.patch

+ Patch17:	0001-Link-libnetsnmptrapd-against-MYSQL_LIBS.patch

+ Patch18:	%{name}-5.7.3-mariadb-connector-c.patch

+ Patch19:	%{name}-5.7.3-openssl.patch

+ Patch20:	%{name}-5.7.3-modern-rpm-api.patch

+ Patch21:	%{name}-Detect-if-mysql-has-my_load_defaults.patch

+ Patch22:	%{name}-fix_pythoninstall.patch

+ Patch23:	%{name}-utf8.patch

+ Patch24:	%{name}-net-snmp-config.in_no_ldflags_in_--libs.patch

+ BuildRequires:	autoconf

+ BuildRequires:	automake

+ BuildRequires:	bzip2-devel

+ BuildRequires:	elfutils-devel

+ BuildRequires:	elfutils-libelf-devel

+ BuildRequires:	libselinux-devel

+ %ifnarch s390 s390x ppc64le

+ BuildRequires:	lm_sensors-devel >= 3

+ %endif

+ BuildRequires:	net-tools

+ BuildRequires:	openssl-devel

+ %if %{with mysql}

+ BuildRequires:	mariadb-connector-c-devel

+ %endif

+ BuildRequires:	perl-devel

+ BuildRequires:	perl(ExtUtils::Embed)

+ BuildRequires:	perl-generators

+ BuildRequires:	perl-interpreter

+ BuildRequires:	perl(TAP::Harness)

+ BuildRequires:	procps

+ BuildRequires:	python2-devel

+ BuildRequires:	python2-setuptools

+ BuildRequires:	rpm-devel

+ BuildRequires:	systemd-units

+ Requires:	%{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

+ Requires:	%{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}

  # This is actually needed for the %%triggerun script but Requires(triggerun)

  # is not valid.  We can use %%post because this particular %triggerun script

  # should fire just after this package is installed.

- Requires(post): systemd-sysv

- 

- BuildRequires: openssl-devel, bzip2-devel, elfutils-devel

- BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel

- BuildRequires: perl-devel, perl(ExtUtils::Embed), procps

- BuildRequires: python2-devel, python2-setuptools

- BuildRequires: chrpath

- BuildRequires: mariadb-connector-c-devel

- # for netstat, needed by 'make test'

- BuildRequires: net-tools

- # for make test

- BuildRequires: perl(TAP::Harness)

- BuildRequires: systemd-units

- %ifnarch s390 s390x ppc64le

- BuildRequires: lm_sensors-devel >= 3

- %endif

- BuildRequires: autoconf, automake

+ Requires(post):	systemd-sysv

  

  %description

- SNMP (Simple Network Management Protocol) is a protocol used for

- network management. The NET-SNMP project includes various SNMP tools:

- an extensible agent, an SNMP library, tools for requesting or setting

- information from SNMP agents, tools for generating and handling SNMP

- traps, a version of the netstat command which uses SNMP, and a Tk/Perl

- mib browser. This package contains the snmpd and snmptrapd daemons,

- documentation, etc.

+ SNMP (Simple Network Management Protocol) is a protocol used for network

+ management. The NET-SNMP project includes various SNMP tools: an extensible

+ agent, an SNMP library, tools for requesting or setting information from

+ SNMP agents, tools for generating and handling SNMP traps, a version of the

+ netstat command which uses SNMP, and a Tk/Perl mib browser.  This package

+ contains the snmpd and snmptrapd daemons, documentation, etc.

  

- You will probably also want to install the net-snmp-utils package,

- which contains NET-SNMP utilities.

+ You will probably also want to install the net-snmp-utils package, which

+ contains NET-SNMP utilities.

  

  %package utils

- Group: Applications/System

- Summary: Network management utilities using SNMP, from the NET-SNMP project

- Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

+ Summary:	Network management utilities using SNMP, from the NET-SNMP project

+ Requires:	%{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

  

  %description utils

  The net-snmp-utils package contains various utilities for use with the

  NET-SNMP network management project.

  

- Install this package if you need utilities for managing your network

- using the SNMP protocol. You will also need to install the net-snmp

- package.

+ Install this package if you need utilities for managing your network using

+ the SNMP protocol. You will also need to install the net-snmp package.

  

  %package devel

- Group: Development/Libraries

- Summary: The development environment for the NET-SNMP project

- Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

- Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}

- Requires: elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel

- %ifnarch s390 s390x ppc64le

- Requires: lm_sensors-devel

- %endif

- # pull perl development libraries, net-snmp agent libraries may link to them

- Requires: perl-devel%{?_isa}

+ Summary:	The development environment for the NET-SNMP project

+ Requires:	%{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

+ Requires:	%{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}

  

  %description devel

- The net-snmp-devel package contains the development libraries and

- header files for use with the NET-SNMP project's network management

- tools.

+ The net-snmp-devel package contains the development libraries and header

+ files for use with the NET-SNMP project's network management tools.

  

- Install the net-snmp-devel package if you would like to develop

- applications for use with the NET-SNMP project's network management

- tools. You'll also need to have the net-snmp and net-snmp-utils

- packages installed.

+ Install the net-snmp-devel package if you would like to develop applications

+ for use with the NET-SNMP project's network management tools.  You'll also

+ need to have the net-snmp and net-snmp-utils packages installed.

  

  %package perl

- Group: Development/Libraries

- Summary: The perl NET-SNMP module and the mib2c tool

- Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}, perl-interpreter

- Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}

- BuildRequires: perl-interpreter

- BuildRequires: perl-generators

+ Summary:	The perl NET-SNMP module and the mib2c tool

+ Requires:	%{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

+ Requires:	%{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}

  

  %description perl

  The net-snmp-perl package contains the perl files to use SNMP from within
@@ -162,9 +125,8 @@ 

  with perl.

  

  %package gui

- Group: Applications/System

- Summary: An interactive graphical MIB browser for SNMP

- Requires: perl-Tk, net-snmp-perl%{?_isa} = %{epoch}:%{version}-%{release}

+ Summary:	An interactive graphical MIB browser for SNMP

+ Requires:	net-snmp-perl%{?_isa} = %{epoch}:%{version}-%{release}

  

  %description gui

  The net-snmp-gui package contains tkmib utility, which is a graphical user 
@@ -175,125 +137,78 @@ 

  Install the net-snmp-gui package, if you want to use this interactive utility.

  

  %package libs

- Group: Development/Libraries

- Summary: The NET-SNMP runtime client libraries

+ Summary:	The NET-SNMP runtime client libraries

  

  %description libs

  The net-snmp-libs package contains the runtime client libraries for shared

  binaries and applications.

  

  %package agent-libs

- Group: Development/Libraries

- Summary: The NET-SNMP runtime agent libraries

- # the libs link against libperl.so:

- Requires:  perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

- Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

+ Summary:	The NET-SNMP runtime agent libraries

+ Requires:	%{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

  

  %description agent-libs

  The net-snmp-agent-libs package contains the runtime agent libraries for shared

  binaries and applications.

  

  %package -n python2-net-snmp

+ Summary:	The Python 'netsnmp' module for the Net-SNMP

  %{?python_provide:%python_provide python2-net-snmp}

  # Remove before F30

- Provides: %{name}-python = %{version}-%{release}

- Provides: %{name}-python%{?_isa} = %{version}-%{release}

- Obsoletes: %{name}-python < %{version}-%{release}

- Group: Development/Libraries

- Summary: The Python 'netsnmp' module for the Net-SNMP

- Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

+ Provides:	%{name}-python = %{version}-%{release}

+ Provides:	%{name}-python%{?_isa} = %{version}-%{release}

+ Obsoletes:	%{name}-python < %{version}-%{release}

+ Requires:	%{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

  

  %description -n python2-net-snmp

- The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3, 

+ The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3,

  SNMPv2c, SNMPv1) client API. The 'netsnmp' module internals rely on the

  Net-SNMP toolkit library.

  

- %if 0%{?fedora} < 23

- %package sysvinit

- Group: System Environment/Daemons

- Summary: Legacy SysV init scripts for Net-SNMP daemons

- Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}

- 

- %description sysvinit

- The net-snmp-sysvinit package provides SysV init scripts for Net-SNMP daemons.

- %endif

- 

  %prep

- %setup -q

+ %autosetup -p1

  cp %{SOURCE12} .

  

- %ifnarch ia64

- %patch1 -p1 -b .pie

- %endif

- 

- %patch2 -p1 -b .dir-fix

- %patch3 -p1 -b .multilib

- %patch4 -p1 -b .apsl

- %patch5 -p1

- %patch6 -p1 -b .systemd

- %patch7 -p1 -b .multilib

- %patch8 -p1 -b .autoreconf

- %patch9 -p1 -b .agentx-crash

- %patch10 -p1 -b .agentx-disconnect-crash

- %patch11 -p1 -b .cert-path

- %patch12 -p1 -b .snmpstatus-null

- %patch13 -p1 -b .cflags

- %patch14 -p1 -b .U64

- %patch15 -p1 -b .make

- %patch16 -p1 -b .strtok-r

- %patch17 -p1 -b .mariadb102

- %patch18 -p1 -b .perlfix

- %patch19 -p1 -b .mariadb-connector-c

- %patch100 -p1 -b .openssl

- %patch101 -p1 -b .modern-rpm-api

- 

- %ifarch sparc64 s390 s390x

- # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697

- rm testing/fulltests/default/T200*

- %endif

- 

  %build

- 

  # Autoreconf to get autoconf 2.69 for ARM (#926223)

  autoreconf

  

  MIBS="host agentx smux \

-      ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \

-      ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \

-      ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \

-      ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \

-      ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \

-      sctp-mib rmon-mib etherlike-mib"

- 

+ 	ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \

+ 	ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \

+ 	ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \

+ 	ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \

+ 	ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \

  %ifnarch s390 s390x ppc64le

- # there are no lm_sensors on s390

- MIBS="$MIBS ucd-snmp/lmsensorsMib"

+ 	ucd-snmp/lmsensorsMib \

  %endif

+ 	sctp-mib rmon-mib etherlike-mib"

  

  %configure \

-     --disable-static --enable-shared \

-     --with-cflags="$RPM_OPT_FLAGS -D_RPM_4_4_COMPAT" \

-     --with-ldflags="-Wl,-z,relro -Wl,-z,now" \

-     --with-sys-location="Unknown" \

-     --with-logfile="/var/log/snmpd.log" \

-     --with-persistent-directory="/var/lib/net-snmp" \

-     --with-mib-modules="$MIBS" \

-     --sysconfdir=%{_sysconfdir} \

-     --enable-ipv6 \

-     --enable-ucd-snmp-compatibility \

-     --with-openssl \

-     --with-pic \

-     --enable-embedded-perl \

-     --enable-as-needed \

-     --with-perl-modules="INSTALLDIRS=vendor" \

-     --enable-mfd-rewrites \

-     --enable-local-smux \

-     --with-temp-file-pattern=/var/run/net-snmp/snmp-tmp-XXXXXX \

-     --with-transports="DTLSUDP TLSTCP" \

-     --with-security-modules=tsm  \

-     --with-mysql \

-     --with-systemd \

-     --with-sys-contact="root@localhost" <<EOF

+ 	LDFLAGS="%{__global_ldflags} -Wl,--as-needed" \

+ 	--disable-static \

+ 	--enable-embedded-perl \

+ 	--enable-ipv6 \

+ 	--enable-local-smux \

+ 	--enable-mfd-rewrites \

+ 	--enable-shared \

+ 	--enable-ucd-snmp-compatibility \

+ 	--with-logfile="/var/log/snmpd.log" \

+ 	--with-mib-modules="$MIBS" \

+ 	--with-openssl \

+ 	--without-libwrap \

+ 	--with-perl-modules="INSTALLDIRS=vendor" \

+ 	--with-persistent-directory="/var/lib/net-snmp" \

+ 	--with-pic \

+ 	--with-python-modules \

+ 	--with-security-modules=tsm  \

+ 	--with-sys-contact="root@localhost" \

+ 	--with-sys-location="Unknown" \

+ 	--with-systemd \

+ 	--with-temp-file-pattern=/var/run/net-snmp/snmp-tmp-XXXXXX \

+ 	--with-transports="DTLSUDP TLSTCP" \

+ 	--with%{!?with_mysql:out}-mysql \

+ 	<<EOF

  EOF

  

  # store original libtool file, we will need it later
@@ -305,18 +220,9 @@ 

  # the package is not %%_smp_mflags safe

  make

  

- # remove rpath from compiled perl libs

- find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \;

- 

- # compile python module

- pushd python

- %{__python} setup.py --basedir="../" build

- popd

- 

- 

  %install

- rm -rf ${RPM_BUILD_ROOT}

- make install DESTDIR=${RPM_BUILD_ROOT}

+ %{__make} install \

+ 	DESTDIR=%{buildroot}

  

  # Determine which arch net-snmp-config.h is going to try to #include.

  basearch=%{_arch}
@@ -328,86 +234,56 @@ 

  # Do an net-snmp-config.h switcheroo to avoid file conflicts on systems where you

  # can have both a 32- and 64-bit version of the library, as they each need

  # their own correct-but-different versions of net-snmp-config.h to be usable.

- mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}

- install -m 755 %SOURCE5 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config

- mv ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp/net-snmp-config.h ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp/net-snmp-config-${basearch}.h

- install -m644 %SOURCE4 ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp/net-snmp-config.h

+ mv %{buildroot}%{_bindir}/net-snmp-config{,-${basearch}}

+ install -m 755 %SOURCE5 %{buildroot}%{_bindir}/net-snmp-config

+ mv %{buildroot}%{_includedir}/net-snmp/net-snmp-config{,-${basearch}}.h

+ install -m644 %SOURCE4 %{buildroot}%{_includedir}/net-snmp/net-snmp-config.h

  %endif

  

- install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp

- install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmpd.conf

- install -m 644 %SOURCE6 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmptrapd.conf

- 

- %if 0%{?fedora} < 23

- install -d ${RPM_BUILD_ROOT}%{_initrddir}

- install -m 755 %SOURCE2 ${RPM_BUILD_ROOT}%{_initrddir}/snmpd

- install -m 755 %SOURCE3 ${RPM_BUILD_ROOT}%{_initrddir}/snmptrapd

- %endif

+ install -d %{buildroot}%{_sysconfdir}/{snmp,sysconfig} \

+ 	%{buildroot}%{_localstatedir}/lib/net-snmp/{cert_indexes,mib_indexes}

  

- install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig

- install -m 644 %SOURCE7 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/snmpd

- install -m 644 %SOURCE8 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/snmptrapd

+ install -m 644 %SOURCE1 %{buildroot}%{_sysconfdir}/snmp/snmpd.conf

+ install -m 644 %SOURCE6 %{buildroot}%{_sysconfdir}/snmp/snmptrapd.conf

  

- # prepare /var/lib/net-snmp

- install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp

- install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp/mib_indexes

- install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp/cert_indexes

- install -d ${RPM_BUILD_ROOT}%{_localstatedir}/run/net-snmp

+ install -m 644 %SOURCE7 %{buildroot}%{_sysconfdir}/sysconfig/snmpd

+ install -m 644 %SOURCE8 %{buildroot}%{_sysconfdir}/sysconfig/snmptrapd

  

+ ln -sf snmptrap %{buildroot}%{_bindir}/snmpinform

  # remove things we don't want to distribute

- rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpinform

- ln -s snmptrap ${RPM_BUILD_ROOT}/usr/bin/snmpinform

- rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpcheck

- rm -f ${RPM_BUILD_ROOT}/%{_bindir}/fixproc

- rm -f ${RPM_BUILD_ROOT}/%{_mandir}/man1/fixproc*

- rm -f ${RPM_BUILD_ROOT}/%{_bindir}/ipf-mod.pl

- rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.la

- rm -f ${RPM_BUILD_ROOT}/%{_libdir}/libsnmp*

+ rm -f	%{buildroot}%{_bindir}/{ipf-mod.pl,snmpcheck,fixproc} \

+ 	%{buildroot}%{_mandir}/man1/fixproc* \

+ 	%{buildroot}%{_libdir}/*.la \

+ 	%{buildroot}%{_libdir}/libsnmp*

  

  # remove special perl files

- find $RPM_BUILD_ROOT -name perllocal.pod \

-     -o -name .packlist \

-     -o -name "*.bs" \

-     -o -name Makefile.subs.pl \

-     | xargs -ri rm -f {}

- # remove docs that do not apply to Linux

- rm -f README.aix README.hpux11 README.osX README.Panasonic_AM3X.txt README.solaris README.win32

+ find %{buildroot} -name perllocal.pod \

+ 	-o -name .packlist \

+ 	-o -name "*.bs" \

+ 	-o -name Makefile.subs.pl \

+ 	| xargs -ri rm -f {}

  

  # copy missing mib2c.conf files

- install -m 644 local/mib2c.*.conf ${RPM_BUILD_ROOT}%{_datadir}/snmp

+ install -m 644 local/mib2c.*.conf %{buildroot}%{_datadir}/snmp

  

- # install python module

- pushd python

- %{__python} setup.py --basedir=.. install -O1 --skip-build --root $RPM_BUILD_ROOT 

- popd

- 

- find $RPM_BUILD_ROOT -name '*.so' | xargs chmod 0755

+ find %{buildroot} -name '*.so' | xargs chmod 0755

  

  # trim down massive ChangeLog

  dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed

  

- # convert files to UTF-8

- for file in README COPYING; do

-     iconv -f 8859_1 -t UTF-8 <$file >$file.utf8

-     mv $file.utf8 $file

- done

- 

  # remove executable bit from documentation samples

  chmod 644 local/passtest local/ipf-mod.pl

  

  # dirty hack for #603243, until it's fixed properly upstream

- install -m 755 -d $RPM_BUILD_ROOT/usr/include/net-snmp/agent/util_funcs

- install -m 644  agent/mibgroup/util_funcs/*.h $RPM_BUILD_ROOT/usr/include/net-snmp/agent/util_funcs

+ install -m 755 -d %{buildroot}%{_includedir}/net-snmp/agent/util_funcs

+ install -m 644 agent/mibgroup/util_funcs/*.h %{buildroot}%{_includedir}/net-snmp/agent/util_funcs

  

  # systemd stuff

- install -m 755 -d $RPM_BUILD_ROOT/%{_tmpfilesdir}

- install -m 644 %SOURCE9 $RPM_BUILD_ROOT/%{_tmpfilesdir}/net-snmp.conf

- install -m 755 -d $RPM_BUILD_ROOT/%{_unitdir}

- install -m 644 %SOURCE10 %SOURCE11 $RPM_BUILD_ROOT/%{_unitdir}/

+ install -m 755 -d %{buildroot}%{_unitdir}

+ install -m 644 %SOURCE10 %SOURCE11 %{buildroot}%{_unitdir}

  

  %check

- %if %{netsnmp_check}

- %ifarch ppc ppc64

+ %ifarch ppc ppc64 sparc64 s390 s390x

  rm -vf testing/fulltests/default/T200snmpv2cwalkall_simple

  %endif

  # restore libtool, for unknown reason it does not work with the one without rpath
@@ -415,9 +291,7 @@ 

  # temporary workaround to make test "extending agent functionality with pass" working

  chmod 755 local/passtest

  

- LD_LIBRARY_PATH=${RPM_BUILD_ROOT}/%{_libdir} make test

- %endif

- 

+ LD_LIBRARY_PATH=%{buildroot}%{_libdir} make test

  

  %post

  %systemd_post snmpd.service snmptrapd.service
@@ -425,11 +299,9 @@ 

  %preun

  %systemd_preun snmpd.service snmptrapd.service

  

- 

  %postun

  %systemd_postun_with_restart snmpd.service snmptrapd.service

  

- 

  %triggerun -- net-snmp < 1:5.7-5

  # Convert SysV -> systemd.

  # Save the current service runlevel info,
@@ -442,29 +314,15 @@ 

  /bin/systemctl try-restart snmpd.service >/dev/null 2>&1 || :

  /bin/systemctl try-restart snmptrapd.service >/dev/null 2>&1 || :

  

- %if 0%{?fedora} < 23

- %triggerpostun -n net-snmp-sysvinit -- net-snmp < 1:5.7-5

- /sbin/chkconfig --add snmpd >/dev/null 2>&1 || :

- /sbin/chkconfig --add snmptrapd >/dev/null 2>&1 || :

- %endif

- 

- %post libs -p /sbin/ldconfig

- 

+ %post   libs -p /sbin/ldconfig

  %postun libs -p /sbin/ldconfig

  

- %post agent-libs -p /sbin/ldconfig

- 

+ %post   agent-libs -p /sbin/ldconfig

  %postun agent-libs -p /sbin/ldconfig

  

- %clean

- rm -rf ${RPM_BUILD_ROOT}

- 

  %files

- %doc COPYING ChangeLog.trimmed EXAMPLE.conf FAQ NEWS TODO

- %doc README README.agent-mibs README.agentx README.krb5 README.snmpv3

- %doc local/passtest local/ipf-mod.pl

- %doc README.thread AGENT.txt PORTING local/README.mib2c

- %doc IETF-MIB-LICENSE.txt

+ %doc README{,.agent-mibs,.agentx,.krb5,.snmpv3,.threads}

+ %doc local/passtest local/ipf-mod.pl AGENT.txt

  %dir %{_sysconfdir}/snmp

  %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/snmp/snmpd.conf

  %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/snmp/snmptrapd.conf
@@ -472,14 +330,12 @@ 

  %{_bindir}/net-snmp-create-v3-user

  %{_sbindir}/*

  %attr(0644,root,root) %{_mandir}/man[58]/snmp*d*

- %attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz

+ %attr(0644,root,root) %{_mandir}/man5/snmp_config.5*

  %attr(0644,root,root) %{_mandir}/man5/variables*

  %attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user*

- %attr(0644,root,root) %{_mandir}/man1/snmpconf.1.gz

+ %attr(0644,root,root) %{_mandir}/man1/snmpconf.1*

  %dir %{_datadir}/snmp

  %{_datadir}/snmp/snmpconf-data

- %dir %{_localstatedir}/run/net-snmp

- %{_tmpfilesdir}/net-snmp.conf

  %{_unitdir}/snmp*

  %config(noreplace) %{_sysconfdir}/sysconfig/snmpd

  %config(noreplace) %{_sysconfdir}/sysconfig/snmptrapd
@@ -491,22 +347,22 @@ 

  %{_bindir}/snmp[^c-]*

  %attr(0644,root,root) %{_mandir}/man1/snmp[^-]*.1*

  %attr(0644,root,root) %{_mandir}/man1/encode_keychange*.1*

- %attr(0644,root,root) %{_mandir}/man5/snmp.conf.5.gz

- %attr(0644,root,root) %{_mandir}/man5/variables.5.gz

+ %attr(0644,root,root) %{_mandir}/man5/snmp.conf.5*

+ %attr(0644,root,root) %{_mandir}/man5/variables.5*

  

  %files devel

  %{_libdir}/lib*.so

- /usr/include/*

+ %{_includedir}/*

  %attr(0644,root,root) %{_mandir}/man3/*.3.*

  %attr(0755,root,root) %{_bindir}/net-snmp-config*

  %attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.*

  

  %files perl

+ %doc local/README.mib2c

  %{_bindir}/mib2c-update

  %{_bindir}/mib2c

  %{_bindir}/snmp-bridge-mib

  %{_bindir}/net-snmp-cert

- %dir %{_datadir}/snmp

  %{_datadir}/snmp/mib2c*

  %{_datadir}/snmp/*.pl

  %{_bindir}/traptoemail
@@ -519,7 +375,7 @@ 

  %{perl_vendorarch}/auto/Bundle/*SNMP*

  

  %files -n python2-net-snmp

- %doc README

+ %doc python/README

  %{python_sitearch}/*

  

  %files gui
@@ -527,12 +383,11 @@ 

  %attr(0644,root,root) %{_mandir}/man1/tkmib.1*

  

  %files libs

- %doc COPYING README ChangeLog.trimmed FAQ NEWS TODO

- %doc IETF-MIB-LICENSE.txt

+ %license COPYING

+ %doc README ChangeLog.trimmed FAQ NEWS TODO IETF-MIB-LICENSE.txt

  %{_libdir}/libnetsnmp.so.*

  %dir %{_datadir}/snmp

- %dir %{_datadir}/snmp/mibs

- %{_datadir}/snmp/mibs/*

+ %{_datadir}/snmp/mibs

  %dir %{_localstatedir}/lib/net-snmp

  %dir %{_localstatedir}/lib/net-snmp/mib_indexes

  %dir %{_localstatedir}/lib/net-snmp/cert_indexes
@@ -543,13 +398,64 @@ 

  %{_libdir}/libnetsnmpmibs*.so.*

  %{_libdir}/libnetsnmptrapd*.so.*

  

- %if 0%{?fedora} < 23

- %files sysvinit

- %{_initrddir}/snmpd

- %{_initrddir}/snmptrapd

- %endif

- 

  %changelog

+ * Thu Dec 28 2017 Tomasz Kłoczko <kloczek@fedoraproject.org> - 1:5.7.3-29

+ - removed Group fields

+   (https://fedoraproject.org/wiki/Packaging:Guidelines#Tags_and_Sections)

+ - remove all legacy hacks for Fedora older than 25

+ - remove chkconfig, initscripts and coreutils from Requires (no longer

+   needed)

+ - remove man pages .gz suffixes in %%files (it breaks building the package

+   with not compresses man pages or compresses using another compression

+   methods)

+ - removed no longer needed init scripts

+ - removed no longer needed pie patch as generating PIE code is now part

+   of the default cc1 spec in (/usr/lib/rpm/redhat/redhat-hardened-cc1)

+ - add use %%autosetup in %%prep

+ - fixed openssl patch (it has been patching files created by use patch -b)

+ - added Detect-if-mysql-has-my_load_defaults patch based on

+   https://sf.net/p/net-snmp/code/ci/cb268b66ee49a123ee which allows building

+   net-snmp against MySQL 5.7

+ - removed %%clean section (no longer needed)

+ - added use more macros in %%install and %%files

+ - remove %%global netsnmp_check (use rpmbuild --nocheck if you want to

+   disable execute %%check)

+ - removed PORTING from %%doc (not relevant for net-snmp Linux binary

+   distribution)

+ - moved README.mib2c to perl %%doc

+ - removed %%{_datadir}/snmp from perl subpackage (it is owned by libs)

+ - %%doc python/README instead README to python subpackage

+ - use --with-python-modules configure option and add fix_pythoninstall patch

+   instead hacks in %%build and %%install build and install python module

+ - removed elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel,

+   lm_sensors-devel and perl-devel from devel subpackage Requires as none of

+   the net-snmp header files is used any headers from those packages

+ - chrath hack no longer needed

+ - do not patch COPYRIGHT and README to utf8 using iconv and just use patch (because be

+   informed when such fix is not needed when patch will reject)

+ - removed redundant --sysconfdir=%%{_sysconfdir} from %%configure options

+ - removed add -D_RPM_4_4_COMPAT to CFLAGS as now it only generated on

+   compile output a lot of warnings about redefining this define

+   (detection is define _RPM_4_4_COMPAT needed is in

+   configure.d/config_os_libs1)

+ - removed install net-snmp-tmpfs.conf as now snmpd and snmptrapd are no

+   longer creates pid files

+ - simplify not fire testing/fulltests/default/T200snmpv2cwalkall_simple on

+   some archs

+ - explicite disable libwrap (add --without-libwrap to configure option)

+ - added mysql %%bcond by default enabled

+ - remove --with-ldflags="-Wl,-z,relro -Wl,-z,now" from configure options as

+   -z,relro is now part of the %%__global_ldflags and -z,now is part of the

+   defalt linking options (/usr/lib/rpm/redhat/redhat-hardened-ld)

+ - added -Wl,--as-needed to LDFLAGS instead use --enable-as-needed

+ - added net-snmp-config.in_no_ldflags_in_--libs patch which removes LDFLAGS

+   from net-snmp-config [--libs,--external-libs,--agent-libs,--external-agent-libs]

+   and adds passing ldflags to Extension() python fulction as extra_link_args

+ 

+ - remove perl(:MODULE_COMPAT_%%(eval "`%%{__perl} -V:version`"; echo

+   $version)) from agent-libs Requires as now libperl library automatically

+   has SOANME dependency

+ 

  * Wed Dec 13 2017 Josef Ridky <jridky@redhat.com> - 1:5.7.3-28

  - remove tcp_wrapper (#1518768)

  - use mariadb-connector instead of mysql-devel (#1339272)

file removed
-115
@@ -1,115 +0,0 @@ 

- #!/bin/bash

- # ucd-snmp init file for snmpd

- #

- # chkconfig: - 50 50

- # description: Simple Network Management Protocol (SNMP) Daemon

- #

- # processname: /usr/sbin/snmpd

- # config: /etc/snmp/snmpd.conf

- # config: /usr/share/snmp/snmpd.conf

- # pidfile: /var/run/snmpd.pid

- 

- ### BEGIN INIT INFO

- # Provides: snmpd

- # Required-Start: $local_fs $network

- # Required-Stop: $local_fs $network

- # Should-Start: 

- # Should-Stop: 

- # Default-Start: 

- # Default-Stop: 

- # Short-Description: start and stop Net-SNMP daemon

- # Description: Simple Network Management Protocol (SNMP) Daemon

- ### END INIT INFO

- 

- # source function library

- . /etc/init.d/functions

- 

- 

- OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"

- if [ -e /etc/sysconfig/snmpd ]; then

-   . /etc/sysconfig/snmpd

- fi

- 

- RETVAL=0

- prog="snmpd"

- binary=/usr/sbin/snmpd

- pidfile=/var/run/snmpd.pid

- 

- start() {

-         [ -x $binary ] || exit 5

-         echo -n $"Starting $prog: "

-         if [ $UID -ne 0 ]; then

-                 RETVAL=1

-                 failure

-         else

-                 daemon --pidfile=$pidfile $binary $OPTIONS

-                 RETVAL=$?

-                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmpd

-         fi;

-         echo 

-         return $RETVAL

- }

- 

- stop() {

-         echo -n $"Stopping $prog: "

-         if [ $UID -ne 0 ]; then

-                 RETVAL=1

-                 failure

-         else

-                 killproc -p $pidfile $binary

-                 RETVAL=$?

-                 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/snmpd

-         fi;

-         echo

-         return $RETVAL

- }

- 

- reload(){

-         echo -n $"Reloading $prog: "

-         killproc -p $pidfile $binary -HUP

-         RETVAL=$?

-         echo

-         return $RETVAL

- }

- 

- restart(){

- 	stop

- 	start

- }

- 

- condrestart(){

-     [ -e /var/lock/subsys/snmpd ] && restart

-     return 0

- }

- 

- case "$1" in

-   start)

- 	start

- 	RETVAL=$?

- 	;;

-   stop)

- 	stop

- 	RETVAL=$?

- 	;;

-   restart)

- 	restart

- 	RETVAL=$?

-         ;;

-   reload|force-reload)

- 	reload

- 	RETVAL=$?

-         ;;

-   condrestart|try-restart)

- 	condrestart

- 	RETVAL=$?

- 	;;

-   status)

-         status snmpd

- 	RETVAL=$?

-         ;;

-   *)

- 	echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"

- 	RETVAL=2

- esac

- 

- exit $RETVAL

file removed
-103
@@ -1,103 +0,0 @@ 

- #!/bin/bash

- 

- # ucd-snmp init file for snmptrapd

- #

- # chkconfig: - 50 50

- # description: Simple Network Management Protocol (SNMP) Trap Daemon

- #

- # processname: /usr/sbin/snmptrapd

- # config: /etc/snmp/snmptrapd.conf

- # config: /usr/share/snmp/snmptrapd.conf

- # pidfile: /var/run/snmptrapd.pid

- 

- 

- ### BEGIN INIT INFO

- # Provides: snmptrapd

- # Required-Start: $local_fs $network

- # Required-Stop: $local_fs $network

- # Should-Start:

- # Should-Stop:

- # Default-Start:

- # Default-Stop:

- # Short-Description: start and stop Net-SNMP trap daemon

- # Description: Simple Network Management Protocol (SNMP) trap daemon

- ### END INIT INFO

- 

- # source function library

- . /etc/init.d/functions

- 

- OPTIONS="-Lsd -p /var/run/snmptrapd.pid"

- if [ -e /etc/sysconfig/snmptrapd ]; then

-   . /etc/sysconfig/snmptrapd

- fi

- 

- RETVAL=0

- prog="snmptrapd"

- binary=/usr/sbin/snmptrapd

- pidfile=/var/run/snmptrapd.pid

- 

- start() {

- 	[ -x $binary ] || exit 5

- 	echo -n $"Starting $prog: "

-         daemon --pidfile=$pidfile /usr/sbin/snmptrapd $OPTIONS

- 	RETVAL=$?

- 	echo

- 	touch /var/lock/subsys/snmptrapd

- 	return $RETVAL

- }

- 

- stop() {

- 	echo -n $"Stopping $prog: "

- 	killproc -p $pidfile /usr/sbin/snmptrapd

- 	RETVAL=$?

- 	echo

- 	rm -f /var/lock/subsys/snmptrapd

- 	return $RETVAL

- }

- 

- reload(){

- 	stop

- 	start

- }

- 

- restart(){

- 	stop

- 	start

- }

- 

- condrestart(){

-     [ -e /var/lock/subsys/snmptrapd ] && restart

-     return 0

- }

- 

- case "$1" in

-   start)

- 	start

- 	RETVAL=$?

- 	;;

-   stop)

- 	stop

- 	RETVAL=$?

- 	;;

-   restart)

- 	restart

- 	RETVAL=$?

-         ;;

-   reload|force-reload)

- 	reload

- 	RETVAL=$?

-         ;;

-   condrestart|try-restart)

- 	condrestart

- 	RETVAL=$?

- 	;;

-   status)

-         status snmptrapd

- 	RETVAL=$?

-         ;;

-   *)

- 	echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"

- 	RETVAL=2

- esac

- 

- exit $RETVAL

%changelog
* Thu Dec 28 2017 Tomasz Kłoczko kloczek@fedoraproject.org - 1:5.7.3-29
- removed Group fields
(https://fedoraproject.org/wiki/Packaging:Guidelines#Tags_and_Sections)
- remove all legacy hacks for Fedora older than 25
- remove chkconfig, initscripts and coreutils from Requires (no longer
needed)
- remove man pages .gz suffixes in %%files (it breaks building the package
with not compresses man pages or compresses using another compression
methods)
- removed no longer needed init scripts
- removed no longer needed pie patch as generating PIE code is now part
of the default cc1 spec in (/usr/lib/rpm/redhat/redhat-hardened-cc1)
- add use %%autosetup in %%prep
- fixed openssl patch (it has been patching files created by use patch -b)
- added Detect-if-mysql-has-my_load_defaults patch based on
https://sf.net/p/net-snmp/code/ci/cb268b66ee49a123ee which allows building
net-snmp against MySQL 5.7
- removed %%clean section (no longer needed)
- added use more macros in %%install and %%files
- remove %%global netsnmp_check (use rpmbuild --nocheck if you want to
disable execute %%check)
- removed PORTING from %%doc (not relevant for net-snmp Linux binary
distribution)
- moved README.mib2c to perl %%doc
- removed %%{datadir}/snmp from perl subpackage (it is owned by libs)
- %%doc python/README instead README to python subpackage
- use --with-python-modules configure option and add fix_pythoninstall patch
instead hacks in %%build and %%install build and install python module
- removed elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel,
lm_sensors-devel and perl-devel from devel subpackage Requires as none of
the net-snmp header files is used any headers from those packages
- chrath hack no longer needed
- do not patch COPYRIGHT and README to utf8 using iconv and just use patch (because be
informed when such fix is not needed when patch will reject)
- removed redundant --sysconfdir=%%{_sysconfdir} from %%configure options
- removed add -D_RPM_4_4_COMPAT to CFLAGS as now it only generated on
compile output a lot of warnings about redefining this define
(detection is define _RPM_4_4_COMPAT needed is in
configure.d/config_os_libs1)
- removed install net-snmp-tmpfs.conf as now snmpd and snmptrapd are no
longer creates pid files
- simplify not fire testing/fulltests/default/T200snmpv2cwalkall_simple on
some archs
- explicite disable libwrap (add --without-libwrap to configure option)
- added mysql %%bcond by default enabled
- remove --with-ldflags="-Wl,-z,relro -Wl,-z,now" from configure options as
-z,relro is now part of the %%__global_ldflags and -z,now is part of the
defalt linking options (/usr/lib/rpm/redhat/redhat-hardened-ld)
- added -Wl,--as-needed to LDFLAGS instead use --enable-as-needed
- added net-snmp-config.in_no_ldflags_in
--libs patch which removes LDFLAGS
from net-snmp-config [--libs,--external-libs,--agent-libs,--external-agent-libs]
and adds passing ldflags to Extension() python fulction as extra_link_args

2 new commits added

    • reformat %changelog entry to 80 cols
    • ifixed 3 typos
6 years ago

2 new commits added

    • corrected %changelog: of course mysql %bcond is by default enabled :)
    • yet another %changelog cleanup
6 years ago

1 new commit added

    • yet another %changelog cleanup
6 years ago

1 new commit added

    • s/iconf/iconv/
6 years ago

1 new commit added

    • yet another %changelog cleanup
6 years ago

Please re-read https://src.fedoraproject.org/rpms/readline/pull-request/1#comment-3057

Each commit message should explain why the change was done. Your commit messages mostly just duplicate the diff(stat), which is not exactly useful.

I am going to implement some of changes from this pull request next week.

some of spec file changes accepted.

Pull-Request has been closed by jridky

6 years ago