[packages/satyr] - new (btparser successor) - libopcodes patch to use shared libopcodes - rpm45/rpm5 patch for PLD rp

qboosh qboosh at pld-linux.org
Sat Apr 6 11:39:10 CEST 2013


commit ad566da709590309afacee0d2d55cf64ce99ae3f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Apr 6 11:38:38 2013 +0200

    - new (btparser successor)
    - libopcodes patch to use shared libopcodes
    - rpm45/rpm5 patch for PLD rpm 4.5/5.x compatibility (instead of rpm.org 4.6+)

 satyr-libopcodes.patch |  42 +++++++++++++++
 satyr-rpm45.patch      |  86 +++++++++++++++++++++++++++++
 satyr-rpm5.patch       |  90 +++++++++++++++++++++++++++++++
 satyr.spec             | 143 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 361 insertions(+)
---
diff --git a/satyr.spec b/satyr.spec
new file mode 100644
index 0000000..b9ca295
--- /dev/null
+++ b/satyr.spec
@@ -0,0 +1,143 @@
+Summary:	Tools to create anonymous, machine-friendly problem reports
+Summary(pl.UTF-8):	Analizator śladów wywołań tworzonych przez GDB
+Name:		satyr
+Version:	0.3
+Release:	1
+License:	GPL v2+
+Group:		Development/Tools
+Source0:	https://fedorahosted.org/released/abrt/%{name}-%{version}.tar.xz
+# Source0-md5:	cf760a025b9b479b18781b5dc166856a
+Patch0:		%{name}-libopcodes.patch
+Patch1:		%{name}-rpm5.patch
+Patch2:		%{name}-rpm45.patch
+URL:		http://fedorahosted.org/abrt/
+BuildRequires:	autoconf >= 2.50
+BuildRequires:	automake
+BuildRequires:	binutils-devel
+BuildRequires:	elfutils-devel
+BuildRequires:	libtool
+BuildRequires:	libunwind-devel >= 1.1
+BuildRequires:	pkgconfig
+BuildRequires:	rpm-devel
+BuildRequires:	python-devel >= 1:2.6
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.219
+BuildRequires:	tar >= 1:1.22
+BuildRequires:	xz
+Requires:	%{name}-libs = %{version}-%{release}
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Satyr is a library that can be used to create and process
+microreports. Microreports consist of structured data suitable to be
+analyzed in a fully automated manner, though they do not necessarily
+contain sufficient information to fix the underlying problem. The
+reports are designed not to contain any potentially sensitive data to
+eliminate the need for review before submission. Included is a tool
+that can create microreports and perform some basic operations on
+them.
+
+%description -l pl.UTF-8
+Satyr to biblioteka do tworzenia i przetwarzania mikroraportów.
+Mikroraporty składają się ze strukturalnych danych nadających się do
+analizy w sposób całkowicie automatyczny, ale niekoniecznie
+zawierających pełne informacje do naprawienia problemu. Raporty są
+zaprojektowane tak, żeby nie zawierały żadnych potencjalnie wrażliwych
+danych, aby nie było potrzeby przeglądania ich przed wysłaniem. Do
+pakietu jest dołączone narzędzie potrafiące tworzyć mikroraporty i
+wykonywać na nich podstawowe operacje.
+
+%package libs
+Summary:	Satyr library - automatic problem management with anonymous reports
+Summary(pl.UTF-8):	Biblioteka Satyr do automatycznego zarządzania problemami z anonimowymi zgłoszeniami
+Group:		Libraries
+
+%description libs
+Satyr library - automatic problem management with anonymous reports.
+
+%description libs -l pl.UTF-8
+Biblioteka Satyr do automatycznego zarządzania problemami z
+anonimowymi złoszeniami.
+
+%package devel
+Summary:	Header files for Satyr library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki Satyr
+Group:		Development/Libraries
+Requires:	%{name}-libs = %{version}-%{release}
+
+%description devel
+Header files for Satyr library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki Satyr.
+
+%package -n python-satyr
+Summary:	Python bindings for Satyr library
+Summary(pl.UTF-8):	Wiązania Pythona do biblioteki Satyr
+Group:		Libraries/Python
+Requires:	%{name}-libs = %{version}-%{release}
+Requires:	python-modules
+
+%description -n python-satyr
+Python bindings for Satyr library.
+
+%description -n python-satyr -l pl.UTF-8
+Wiązania Pythona do biblioteki Satyr.
+
+%prep
+%setup -q
+%patch0 -p1
+%if "%{_rpmversion}" >= "5.0"
+%patch1 -p1
+%else
+%patch2 -p1
+%endif
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la $RPM_BUILD_ROOT%{py_sitedir}/satyr/*.la
+
+%py_postclean
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	libs -p /sbin/ldconfig
+%postun	libs -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc NEWS README
+%attr(755,root,root) %{_bindir}/satyr
+%{_mandir}/man1/satyr.1*
+
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libsatyr.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libsatyr.so.1
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libsatyr.so
+%{_includedir}/satyr
+%{_pkgconfigdir}/satyr.pc
+
+%files -n python-satyr
+%defattr(644,root,root,755)
+%dir %{py_sitedir}/satyr
+%{py_sitedir}/satyr/__init__.py[co]
+%attr(755,root,root) %{py_sitedir}/satyr/_satyr.so
diff --git a/satyr-libopcodes.patch b/satyr-libopcodes.patch
new file mode 100644
index 0000000..f3571df
--- /dev/null
+++ b/satyr-libopcodes.patch
@@ -0,0 +1,42 @@
+--- satyr-0.3/configure.ac.orig	2013-03-25 15:15:23.000000000 +0100
++++ satyr-0.3/configure.ac	2013-04-05 19:26:39.520554933 +0200
+@@ -37,37 +37,10 @@
+     [echo "will not be built.  If you want to build core fingerprinting support, please ensure"]
+     [echo "that libopcodes is installed and its directory is included in the search path."]
+     [echo "Then run configure again before attempting to build Satyr."]
++[else]
++    have_good_libopcodes=1
+ [fi]
+ 
+-# Check libopcodes
+-AC_MSG_CHECKING([whether libopcodes is position independent])
+-opcodes_pic="not found"
+-# ugly, but still better than whitelisting known-working systems
+-for DIR in /lib /usr/lib /lib64 /usr/lib64; do
+-  OPCODES="$DIR/libopcodes.a"
+-  if ! test -r $OPCODES; then
+-      continue
+-  fi
+-
+-  if readelf -r $OPCODES | grep R_X86_64_32 >/dev/null; then
+-      opcodes_pic=no
+-      break
+-  else
+-      opcodes_pic=yes
+-      break
+-  fi
+-done
+-AC_MSG_RESULT([$opcodes_pic])
+-
+-[if test "$opcodes_pic" = "no"; then]
+-    [echo "The libopcodes library on your system was not compiled with PIC. The core backtrace fingerprinting support "]
+-    [echo "will not be built.  If you want to build core backtrace support, please ensure"]
+-    [echo "that the provided libopcodes is build with -fPIC."]
+-    [echo "Then run configure again before attempting to build Satyr."]
+-[fi]
+-
+-test ! \( "$opcodes_pic" = "yes" -a "$have_libopcodes" = "yes" \)
+-have_good_libopcodes=$?
+ AM_CONDITIONAL(HAVE_LIBOPCODES, test $have_good_libopcodes -eq 1)
+ AC_DEFINE_UNQUOTED(HAVE_LIBOPCODES, $have_good_libopcodes, [Have libopcodes compiled with -fPIC])
+ 
diff --git a/satyr-rpm45.patch b/satyr-rpm45.patch
new file mode 100644
index 0000000..a5d6a55
--- /dev/null
+++ b/satyr-rpm45.patch
@@ -0,0 +1,86 @@
+--- satyr-0.3/lib/Makefile.am.orig	2013-03-18 14:41:43.000000000 +0100
++++ satyr-0.3/lib/Makefile.am	2013-04-05 19:01:16.367253347 +0200
+@@ -74,7 +74,7 @@
+ 	unstrip.c \
+ 	utils.c
+ 
+-libsatyr_la_CFLAGS = -Wall -std=gnu99 -D_GNU_SOURCE $(GLIB_CFLAGS)
++libsatyr_la_CFLAGS = -Wall -std=gnu99 -D_GNU_SOURCE $(GLIB_CFLAGS) $(RPM_CFLAGS)
+ libsatyr_la_LDFLAGS = -version-info 1:0:0 $(GLIB_LIBS)
+ 
+ if HAVE_LIBOPCODES
+--- satyr-0.3/configure.ac.orig	2013-04-05 19:30:55.747216259 +0200
++++ satyr-0.3/configure.ac	2013-04-05 19:35:07.100544357 +0200
+@@ -63,6 +63,7 @@
+ AC_CHECK_LIB([unwind-coredump], [main])
+ 
+ # rpm
++PKG_CHECK_MODULES([RPM], [rpm])
+ AC_CHECK_LIB([rpm], [main])
+ 
+ AC_CONFIG_FILES([
+--- satyr-0.3/lib/rpm.c.orig	2013-03-25 15:07:04.000000000 +0100
++++ satyr-0.3/lib/rpm.c	2013-04-06 10:59:35.792721546 +0200
+@@ -27,7 +27,6 @@
+ #include <rpm/rpmlib.h>
+ #include <rpm/rpmdb.h>
+ #include <rpm/rpmts.h>
+-#include <rpm/rpmtd.h>
+ #include <rpm/header.h>
+ #endif
+ #include <fcntl.h>
+@@ -249,18 +248,20 @@
+                   rpmTag tag,
+                   char **result)
+ {
+-    rpmtd tag_data = rpmtdNew();
+-    int success = headerGet(header,
+-                            tag,
+-                            tag_data,
+-                            HEADERGET_DEFAULT);
++    
++    int_32 type, cnt;
++    void *p;
++    const char **strp;
++    int success = headerGetEntry(header, tag, &type, &p, &cnt);
+ 
+     if (success != 1)
+         return false;
+ 
+-    const char *str = rpmtdGetString(tag_data);
++    const char *str = (type == RPM_STRING_TYPE) ? p :
++	    (((type == RPM_STRING_ARRAY_TYPE) || (type == RPM_I18NSTRING_TYPE)) ? *(strp = p) : NULL);
+     *result = (str ? sr_strdup(str) : NULL);
+-    rpmtdFree(tag_data);
++    if(type == RPM_STRING_ARRAY_TYPE)
++	    free(p);
+     return str;
+ }
+ 
+@@ -269,20 +270,19 @@
+                   rpmTag tag,
+                   uint32_t *result)
+ {
+-    rpmtd tag_data = rpmtdNew();
+-    int success = headerGet(header,
+-                            tag,
+-                            tag_data,
+-                            HEADERGET_DEFAULT);
++    int_32 type, cnt;
++    void *p;
++    int success = headerGetEntry(header, tag, &type, &p, &cnt);
+ 
+     if (success != 1)
+         return false;
+ 
+-    uint32_t *num = rpmtdGetUint32(tag_data);
++    if (type != RPM_UINT32_TYPE)
++        return false;
++    uint32_t *num = p;
+     if (num)
+         *result = *num;
+ 
+-    rpmtdFree(tag_data);
+     return num;
+ }
+ 
diff --git a/satyr-rpm5.patch b/satyr-rpm5.patch
new file mode 100644
index 0000000..a728321
--- /dev/null
+++ b/satyr-rpm5.patch
@@ -0,0 +1,90 @@
+--- satyr-0.3/lib/Makefile.am.orig	2013-03-18 14:41:43.000000000 +0100
++++ satyr-0.3/lib/Makefile.am	2013-04-05 19:01:16.367253347 +0200
+@@ -74,7 +74,7 @@
+ 	unstrip.c \
+ 	utils.c
+ 
+-libsatyr_la_CFLAGS = -Wall -std=gnu99 -D_GNU_SOURCE $(GLIB_CFLAGS)
++libsatyr_la_CFLAGS = -Wall -std=gnu99 -D_GNU_SOURCE $(GLIB_CFLAGS) $(RPM_CFLAGS)
+ libsatyr_la_LDFLAGS = -version-info 1:0:0 $(GLIB_LIBS)
+ 
+ if HAVE_LIBOPCODES
+--- satyr-0.3/configure.ac.orig	2013-04-05 19:30:55.747216259 +0200
++++ satyr-0.3/configure.ac	2013-04-05 19:35:07.100544357 +0200
+@@ -63,6 +63,7 @@
+ AC_CHECK_LIB([unwind-coredump], [main])
+ 
+ # rpm
++PKG_CHECK_MODULES([RPM], [rpm])
+ AC_CHECK_LIB([rpm], [main])
+ 
+ AC_CONFIG_FILES([
+--- satyr-0.3/lib/rpm.c.orig	2013-03-25 15:07:04.000000000 +0100
++++ satyr-0.3/lib/rpm.c	2013-04-06 09:53:22.452804364 +0200
+@@ -24,10 +24,8 @@
+ #include "config.h"
+ #include <errno.h>
+ #ifdef HAVE_LIBRPM
+-#include <rpm/rpmlib.h>
++#include <rpm/rpmtag.h>
+ #include <rpm/rpmdb.h>
+ #include <rpm/rpmts.h>
+-#include <rpm/rpmtd.h>
+-#include <rpm/header.h>
+ #endif
+ #include <fcntl.h>
+@@ -249,18 +248,18 @@
+                   rpmTag tag,
+                   char **result)
+ {
+-    rpmtd tag_data = rpmtdNew();
+-    int success = headerGet(header,
+-                            tag,
+-                            tag_data,
+-                            HEADERGET_DEFAULT);
++    HE_s h;
++    memset(&h, 0, sizeof(h));
++    h.tag = tag;
++    h.ix = -1;
++    int success = headerGet(header, h, 0);
+ 
+     if (success != 1)
+         return false;
+ 
+-    const char *str = rpmtdGetString(tag_data);
++    const char *str = (h.t == RPM_STRING_TYPE) ? h.p.str :
++	    (((h.t == RPM_STRING_ARRAY_TYPE) || (h.t == RPM_I18NSTRING_TYPE)) ? h.p.argv[0] : NULL);
+     *result = (str ? sr_strdup(str) : NULL);
+-    rpmtdFree(tag_data);
+     return str;
+ }
+ 
+@@ -269,20 +268,21 @@
+                   rpmTag tag,
+                   uint32_t *result)
+ {
+-    rpmtd tag_data = rpmtdNew();
+-    int success = headerGet(header,
+-                            tag,
+-                            tag_data,
+-                            HEADERGET_DEFAULT);
++    HE_s h;
++    memset(&h, 0, sizeof(h));
++    h.tag = tag;
++    h.ix = -1;
++    int success = headerGet(header, h, 0);
+ 
+     if (success != 1)
+         return false;
+ 
+-    uint32_t *num = rpmtdGetUint32(tag_data);
++    if (h.t != RPM_UINT32_TYPE)
++        return false;
++    uint32_t *num = h.p.uint_32;
+     if (num)
+         *result = *num;
+ 
+-    rpmtdFree(tag_data);
+     return num;
+ }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/satyr.git/commitdiff/ad566da709590309afacee0d2d55cf64ce99ae3f



More information about the pld-cvs-commit mailing list