[packages/udis86] - new; added ax_prog_sphinx_version patch form Fedora and some python3 fixes

qboosh qboosh at pld-linux.org
Mon Sep 18 21:16:50 CEST 2023


commit 0e076b709d9e60e52f090f56ec356ec27fe5ec30
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Sep 18 21:05:01 2023 +0200

    - new; added ax_prog_sphinx_version patch form Fedora and some python3 fixes

 udis86-ax_prog_sphinx_version.patch |  12 ++++
 udis86-python3.patch                |  44 ++++++++++++
 udis86.spec                         | 137 ++++++++++++++++++++++++++++++++++++
 3 files changed, 193 insertions(+)
---
diff --git a/udis86.spec b/udis86.spec
new file mode 100644
index 0000000..55f0bb5
--- /dev/null
+++ b/udis86.spec
@@ -0,0 +1,137 @@
+#
+# Conditional build:
+%bcond_without	apidocs		# API documentation
+%bcond_without	static_libs	# static libraries
+#
+Summary:	Disassembler for the x86 and x86-64 class of instruction set architectures
+Summary(pl.UTF-8):	Disasembler dla architektur z instrukcjami x86 i x86-64
+Name:		udis86
+Version:	1.7.2
+Release:	1
+License:	BSD
+Group:		Libraries
+#Source0Download: https://github.com/vmt/udis86/tags
+Source0:	https://github.com/vmt/udis86/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	bb301006bf1087a4328ef153719e69d6
+Patch0:		%{name}-ax_prog_sphinx_version.patch
+Patch1:		%{name}-python3.patch
+URL:		https://github.com/vmt/udis86
+BuildRequires:	autoconf >= 2.59
+BuildRequires:	automake >= 1:1.11
+BuildRequires:	libtool
+BuildRequires:	python3 >= 1:3
+BuildRequires:	rpm-build >= 4.6
+%{?with_apidocs:BuildRequires:	sphinx-pdg >= 1.1.3}
+BuildRequires:	yasm >= 1.2.0
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Udis86 is a disassembler for the x86 and x86-64 class of instruction
+set architectures. It consists of a C library called libudis86 which
+provides a clean and simple interface to decode a stream of raw binary
+data, and to inspect the disassembled instructions in a structured
+manner.
+
+%description -l pl.UTF-8
+Udis86 to disasembler dla architektur z instrukcjami x86 i x86-64.
+Składa się z biblioteki C o nazwie libudis86, dostarczającej czysty i
+prosty interfejs do dekodowania strumienia surowych danych binarnych i
+podglądania zdisasemblowanych instrukcji w sposób strukturalny.
+
+%package devel
+Summary:	Header files for libudis86 library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki libudis86
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+Header files for libudis86 library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki libudis86.
+
+%package static
+Summary:	Static libudis86 library
+Summary(pl.UTF-8):	Statyczna biblioteka libudis86
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static libudis86 library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka libudis86.
+
+%package apidocs
+Summary:	API documentation for libudis86 library
+Summary(pl.UTF-8):	Dokumentacja API biblioteki libudis86
+Group:		Documentation
+BuildArch:	noarch
+
+%description apidocs
+API documentation for libudis86 library.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki libudis86.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+install -d build/m4
+%{__libtoolize}
+%{__aclocal} -I build/m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+	--enable-shared \
+	%{!?with_static_libs:--disable-static} \
+	--with-python="%{__python3}"
+%{__make}
+
+%if %{with apidocs}
+%{__make} html
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+# no external dependencies
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libudis86.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGES LICENSE README
+%attr(755,root,root) %{_bindir}/udcli
+%attr(755,root,root) %{_libdir}/libudis86.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libudis86.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libudis86.so
+%{_includedir}/udis86.h
+%{_includedir}/libudis86
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libudis86.a
+%endif
+
+%if %{with apidocs}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/manual/html/{_static,*.html,*.js}
+%endif
diff --git a/udis86-ax_prog_sphinx_version.patch b/udis86-ax_prog_sphinx_version.patch
new file mode 100644
index 0000000..6c67e4f
--- /dev/null
+++ b/udis86-ax_prog_sphinx_version.patch
@@ -0,0 +1,12 @@
+diff -up udis86-56ff6c8/m4/ax_prog_sphinx_version.m4.orig udis86-56ff6c8/m4/ax_prog_sphinx_version.m4
+--- udis86-56ff6c8/m4/ax_prog_sphinx_version.m4.orig	2014-12-25 07:00:50.000000000 -0500
++++ udis86-56ff6c8/m4/ax_prog_sphinx_version.m4	2019-05-01 14:20:35.330757713 -0400
+@@ -40,7 +40,7 @@ AC_DEFUN([AX_PROG_SPHINX],[
+ 
+         AC_MSG_CHECKING([for sphinx version])
+         changequote(<<,>>)
+-        sphinx_version=`$SPHINX_BUILD -h 2>&1 | $GREP "^Sphinx v" | $SED -e 's/^.* v\([0-9]*\.[0-9]*\.[0-9]*\)/\1/'`
++        sphinx_version=`$SPHINX_BUILD --version 2>&1 | cut -d ' ' -f 2`
+         changequote([,])
+         AC_MSG_RESULT($sphinx_version)
+ 
diff --git a/udis86-python3.patch b/udis86-python3.patch
new file mode 100644
index 0000000..630adcc
--- /dev/null
+++ b/udis86-python3.patch
@@ -0,0 +1,44 @@
+--- udis86-1.7.2/scripts/ud_opcode.py.orig	2023-09-18 19:05:37.714853016 +0200
++++ udis86-1.7.2/scripts/ud_opcode.py	2023-09-18 19:06:54.114439124 +0200
+@@ -130,8 +130,8 @@ class UdOpcodeTables:
+             '/mod'   : lambda v: '00' if v == '!11' else '01',
+             # Mode extensions:
+             # (16, 32, 64) => (00, 01, 02)
+-            '/o'     : lambda v: "%02x" % (int(v) / 32),
+-            '/a'     : lambda v: "%02x" % (int(v) / 32),
++            '/o'     : lambda v: "%02x" % (int(v) // 32),
++            '/a'     : lambda v: "%02x" % (int(v) // 32),
+             '/m'     : lambda v: '00' if v == '!64' else '01',
+             # SSE
+             '/sse'   : lambda v: UdOpcodeTables.OpcExtIndex['sse'][v],
+@@ -227,9 +227,7 @@ class UdOpcodeTables:
+ 
+     def print_table( self, table, pfxs ):
+         print("%s   |" % pfxs)
+-        keys = table[ 'entries' ].keys()
+-        if ( len( keys ) ):
+-            keys.sort()
++        keys = sorted(table[ 'entries' ].keys())
+         for idx in keys:
+             e = table[ 'entries' ][ idx ]
+             if e[ 'type' ] == 'insn':
+--- udis86-1.7.2/tests/oprgen.py.orig	2013-09-02 06:16:37.000000000 +0200
++++ udis86-1.7.2/tests/oprgen.py	2023-09-18 19:24:12.082149303 +0200
+@@ -686,7 +686,7 @@ class UdTestGenerator( ud_opcode.UdOpcod
+     def generate_yasm( self, mode, seed ):
+         opr_combos = {}
+         random.seed( seed )
+-        print "[bits %s]" % mode
++        print("[bits %s]" % mode)
+         for insn in self.InsnTable:
+             if insn[ 'mnemonic' ] in self.ExcludeList:
+                 continue
+@@ -728,7 +728,7 @@ class UdTestGenerator( ud_opcode.UdOpcod
+                 else:
+                     operands = None
+             if operands is not None:
+-                print "\t%s %s" % (insn['mnemonic'], operands)
++                print("\t%s %s" % (insn['mnemonic'], operands))
+                 opr_combos[fusedName]['covered'] = True
+ 
+         # stats
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/udis86.git/commitdiff/0e076b709d9e60e52f090f56ec356ec27fe5ec30



More information about the pld-cvs-commit mailing list