[packages/libsmi] - new Source0 URL, updated to 0.5.0 - removed obsolete am,format-security patches - added bison patc

qboosh qboosh at pld-linux.org
Sat Jan 14 09:45:01 CET 2017


commit 4449fe7dfed133a1d8752fdffd5ad08289886500
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Jan 14 09:46:17 2017 +0100

    - new Source0 URL, updated to 0.5.0
    - removed obsolete am,format-security patches
    - added bison patch (fixes issues related to bison generated files)

 libsmi-am.patch              |  11 -----
 libsmi-bison.patch           | 107 +++++++++++++++++++++++++++++++++++++++++++
 libsmi-format-security.patch |  20 --------
 libsmi.spec                  |  43 ++++++++++++-----
 4 files changed, 139 insertions(+), 42 deletions(-)
---
diff --git a/libsmi.spec b/libsmi.spec
index b4124a0..28ce68d 100644
--- a/libsmi.spec
+++ b/libsmi.spec
@@ -3,19 +3,20 @@ Summary(pl.UTF-8):	Biblioteka SMI (Struktur zarządzania informacjami)
 Summary(ru.UTF-8):	Библиотека для доступа к информации SMI MIB
 Summary(uk.UTF-8):	Бібліотека для доступу до інформації SMI MIB
 Name:		libsmi
-Version:	0.4.8
-Release:	6
+Version:	0.5.0
+Release:	1
 License:	BSD
 Group:		Libraries
-Source0:	ftp://ftp.ibr.cs.tu-bs.de/pub/local/libsmi/%{name}-%{version}.tar.gz
-# Source0-md5:	760b6b1070738158708649ed2c63425e
+Source0:	http://www.ibr.cs.tu-bs.de/projects/libsmi/download/%{name}-%{version}.tar.gz
+# Source0-md5:	4bf47483c06c9f07d1b10fbc74eddf11
 Source1:	%{name}-smi.conf
 Patch0:		flat-mibdir.patch
-Patch1:		%{name}-am.patch
-Patch2:		%{name}-format-security.patch
+Patch1:		%{name}-bison.patch
 URL:		http://www.ibr.cs.tu-bs.de/projects/libsmi/
-BuildRequires:	autoconf
+BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
+BuildRequires:	bison
+BuildRequires:	flex
 BuildRequires:	libtool
 Suggests:	mibs-libsmi
 Suggests:	pibs-libsmi
@@ -93,7 +94,7 @@ Статичні бібліотеки для розробки програм з
 %package progs
 Summary:	SMI tools
 Summary(pl.UTF-8):	Narzędzia SMI
-Group:		Development/Libraries
+Group:		Networking
 Requires:	%{name} = %{version}-%{release}
 
 %description progs
@@ -102,6 +103,18 @@ SMI tools.
 %description progs -l pl.UTF-8
 Narzędzia SMI.
 
+%package yang
+Summary:	SMI data in Yang format
+Summary(pl.UTF-8):	Dane SMI w formacie Yang
+Group:		Networking
+Requires:	%{name} = %{version}-%{release}
+
+%description yang
+SMI data in Yang format.
+
+%description yang -l pl.UTF-8
+Dane SMI w formacie Yang.
+
 %package -n mibs-dirs
 Summary:	Common directories for MIBs
 Summary(pl.UTF-8):	Wspólne katalogi dla MIB-ów
@@ -152,13 +165,15 @@ Dane PIB (Policy Information Base) dostarczane przez LibSMI.
 %setup -q
 %patch0 -p1
 %patch1 -p1
-%patch2 -p1
 
 find '(' -name '*~' -o -name '*.orig' -o -name '*-orig' ')' -print0 | xargs -0 -r -l512 rm -f
 
+# force rebuild
+touch lib/scanner-sming.l
+
 # packaged by mibs-net-snmp
 while read mib; do
-	rm mibs/*/$mib
+	%{__rm} mibs/*/$mib
 done <<'EOF'
 AGENTX-MIB
 DISMAN-EVENT-MIB
@@ -223,7 +238,7 @@ EOF
 	--enable-static \
 	--with-mibdir=%{_datadir}/mibs \
 	--with-pibdir=%{_datadir}/pibs \
-	--with-smipath=%{_datadir}/mibs:%{_datadir}/pibs
+	--with-smipath=%{_datadir}/mibs:%{_datadir}/pibs:%{_datadir}/yang/ietf:%{_datadir}/yang/iana:%{_datadir}/yang/site
 
 %{__make}
 
@@ -265,10 +280,12 @@ posix.utime("%{_datadir}/pibs");
 %attr(755,root,root) %{_libdir}/libsmi.so
 %{_libdir}/libsmi.la
 %{_includedir}/smi.h
+%{_includedir}/yang.h
 %{_aclocaldir}/libsmi.m4
 %{_pkgconfigdir}/libsmi.pc
 %{_mandir}/man3/libsmi.3*
 %{_mandir}/man3/smi_*.3*
+%{_mandir}/man3/yang_node.3*
 
 %files static
 %defattr(644,root,root,755)
@@ -279,6 +296,10 @@ posix.utime("%{_datadir}/pibs");
 %attr(755,root,root) %{_bindir}/smi*
 %{_mandir}/man1/smi*.1*
 
+%files yang
+%defattr(644,root,root,755)
+%{_datadir}/yang
+
 %files -n mibs-dirs
 %defattr(644,root,root,755)
 %dir %{_datadir}/mibs
diff --git a/libsmi-am.patch b/libsmi-am.patch
deleted file mode 100644
index 8f522b6..0000000
--- a/libsmi-am.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- libsmi-0.4.8/configure.in.newautomake	2013-02-05 12:56:47.028569291 +0100
-+++ libsmi-0.4.8/configure.in	2013-02-05 12:56:58.745172483 +0100
-@@ -24,7 +24,7 @@ VERSION_STRING="$LIBSMI_MAJOR.$LIBSMI_MI
- VERSION_LIBTOOL="$LIBTOOL_VERSION:$LIBTOOL_REVISION:$LIBTOOL_AGE"
- 
- AM_INIT_AUTOMAKE(libsmi,$VERSION_STRING)
--AM_CONFIG_HEADER(config.h)
-+AC_CONFIG_HEADERS(config.h)
- 
- AC_DEFINE([MAX_LEX_DEPTH], 30,
- [The maximum module import recursion depth.])
diff --git a/libsmi-bison.patch b/libsmi-bison.patch
new file mode 100644
index 0000000..8aa4894
--- /dev/null
+++ b/libsmi-bison.patch
@@ -0,0 +1,107 @@
+--- libsmi-0.5.0/lib/parser-sming.y.orig	2014-10-11 18:08:25.000000000 +0200
++++ libsmi-0.5.0/lib/parser-sming.y	2017-01-13 21:50:23.845828181 +0100
+@@ -20,6 +20,7 @@
+     
+ #ifdef BACKEND_SMING
+ 
++#define _DEFAULT_SOURCE
+ #define _ISOC99_SOURCE
+ #include <stdio.h>
+ #include <errno.h>
+@@ -349,7 +350,7 @@ static void createBitsValue(SmiValue *va
+  * We call the parser from within the parser when IMPORTing modules,
+  * hence we need reentrant parser code. This is a bison feature.
+  */
+-%pure_parser
++%pure-parser
+ 
+ 
+ 
+@@ -1550,7 +1551,7 @@ identityStatement:	identityKeyword sep l
+ 			referenceStatement_stmtsep_01
+ 			{
+ 				setIdentityReference(identityPtr, $14, 
+-									 thisParserPtr)
++									 thisParserPtr);
+ 			}
+ 			'}' optsep ';'
+ 			{
+@@ -2153,9 +2154,9 @@ attribute_refinedBaseType:	OctetStringKe
+ 			    $$ = duplicateTypeToAttribute(smiHandle->typeBitsPtr,
+ 							  classPtr, thisParserPtr);
+ 			    setAttributeParentType($$, smiHandle->typeBitsPtr);
+-			    if ($1) {
+-				setAttributeList($$, $1);
+-				for (p = $1; p; p = p->nextPtr)
++			    if ($3) {
++				setAttributeList($$, $3);
++				for (p = $3; p; p = p->nextPtr)
+ 				    ((NamedNumber *)(p->ptr))->typePtr = (Type*)$$;
+ 			    }
+ 			    
+--- libsmi-0.5.0/lib/smi-check.c.orig	2013-06-04 14:34:00.000000000 +0200
++++ libsmi-0.5.0/lib/smi-check.c	2017-01-13 20:53:43.132533676 +0100
+@@ -2261,7 +2261,7 @@ smiCheckModuleIdentityRegistration(Parse
+  *
+  *----------------------------------------------------------------------
+  */
+-void smiyyerror(char *msg, Parser *parserPtr)
++void smiyyerror(const char *msg, Parser *parserPtr)
+ {
+     if (parserPtr->line == parserPtr->lcline &&
+ 	parserPtr->modulePtr &&
+--- libsmi-0.5.0/lib/smi-check.h.orig	2013-06-04 14:34:00.000000000 +0200
++++ libsmi-0.5.0/lib/smi-check.h	2017-01-13 20:53:26.592533866 +0100
+@@ -68,6 +68,6 @@ extern void smiCheckUniqueness(Parser *p
+ 
+ extern void smiCheckModuleIdentityRegistration(Parser *parser, Object *object);
+ 
+-extern void smiyyerror(char *msg, Parser *parserPtr);
++extern void smiyyerror(const char *msg, Parser *parserPtr);
+ 
+ #endif /* _CHECK_H */
+--- libsmi-0.5.0/lib/parser-yang.y.orig	2014-10-11 17:58:53.000000000 +0200
++++ libsmi-0.5.0/lib/parser-yang.y	2017-01-13 22:01:16.995820722 +0100
+@@ -20,6 +20,7 @@
+     
+ #ifdef BACKEND_YANG
+ 
++#define _DEFAULT_SOURCE
+ #define _ISOC99_SOURCE
+ #include <stdio.h>
+ #include <errno.h>
+@@ -35,12 +36,14 @@
+ #endif
+ 
+ #include "yang.h"
++#include "yang-check.h"
+ #include "yang-data.h"
+ #include "parser-yang.h"
+ #include "scanner-yang.h"
+ #include "yang-complex-types.h"
+ #include "util.h"
+ #include "error.h"
++#include "smi-check.h"
+     
+ #ifdef HAVE_DMALLOC_H
+ #include <dmalloc.h>
+@@ -268,7 +271,7 @@ checkDate(Parser *parserPtr, char *date)
+  * We call the parser from within the parser when IMPORTing modules,
+  * hence we need reentrant parser code. This is a bison feature.
+  */
+-%pure_parser
++%pure-parser
+ 
+ /*
+  * The attributes.
+--- libsmi-0.5.0/lib/yang-data.h.orig	2013-06-04 14:34:00.000000000 +0200
++++ libsmi-0.5.0/lib/yang-data.h	2017-01-13 22:02:53.482486288 +0100
+@@ -164,6 +164,8 @@ int removeYangNode(_YangNode* target, _Y
+ 
+ _YangModuleInfo *createModuleInfo(_YangNode *modulePtr);
+ 
++void createIdentifierRef(_YangNode *node, char* prefix, char* ident);
++
+ void createTypeInfo(_YangNode *node);
+ 
+ _YangNode *findYangModuleByName(const char *modulename, char* revision);
diff --git a/libsmi-format-security.patch b/libsmi-format-security.patch
deleted file mode 100644
index 4ce1738..0000000
--- a/libsmi-format-security.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- libsmi-0.4.8/tools/dump-tree.c.formatsec	2013-02-05 13:00:54.907226417 +0100
-+++ libsmi-0.4.8/tools/dump-tree.c	2013-02-05 13:01:49.217530638 +0100
-@@ -117,7 +117,7 @@ static void fprintIndex(FILE *f, SmiNode
- 	 smiElement; smiElement = smiGetNextElement(smiElement), i++) {
- 	if (i > 0) fprintf(f, ",");
- 	if (indexname) {
--	    fprintf(f, indexname);
-+	    fputs(indexname, f);
- 	}
- 	indexname = smiGetElementNode(smiElement)->name;
-     }
-@@ -143,7 +143,7 @@ static void fprintObjects(FILE *f, SmiNo
- 	 smiElement = smiGetNextElement(smiElement), i++) {
- 	if (i > 0) fprintf(f, ",");
- 	if (objectname) {
--	    fprintf(f, objectname);
-+	    fputs(objectname, f);
- 	}
- 	objectname = smiGetElementNode(smiElement)->name;
-     }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libsmi.git/commitdiff/4449fe7dfed133a1d8752fdffd5ad08289886500



More information about the pld-cvs-commit mailing list