From 261cbc985aa1f166768ce0b3622d894f7becb3597217a4f03ad771ad4e4e095f Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Tue, 20 Apr 2010 00:25:20 +0000 Subject: [PATCH] Accepting request 38203 from devel:libraries:c_c++ Copy from devel:libraries:c_c++/libservicelog based on submit request 38203 from user psmt OBS-URL: https://build.opensuse.org/request/show/38203 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libservicelog?expand=0&rev=6 --- libservicelog-pkgconfig.patch | 32 ++++++++ libservicelog-printf_types.patch | 22 ++++++ libservicelog-rpmlintrc | 9 +++ libservicelog-sqlite_fixes.patch | 125 +++++++++++++++++++++++++++++++ libservicelog.changes | 17 +++++ libservicelog.spec | 17 +++-- 6 files changed, 217 insertions(+), 5 deletions(-) create mode 100644 libservicelog-pkgconfig.patch create mode 100644 libservicelog-printf_types.patch create mode 100644 libservicelog-rpmlintrc create mode 100644 libservicelog-sqlite_fixes.patch diff --git a/libservicelog-pkgconfig.patch b/libservicelog-pkgconfig.patch new file mode 100644 index 0000000..2255b7d --- /dev/null +++ b/libservicelog-pkgconfig.patch @@ -0,0 +1,32 @@ +Index: src/servicelog-1.pc.in +=================================================================== +--- src/servicelog-1.pc.in.orig 2008-03-06 01:24:51.000000000 +0100 ++++ src/servicelog-1.pc.in 2010-04-14 19:58:24.503511195 +0200 +@@ -6,5 +6,5 @@ includedir=@includedir@ + Name: servicelog + Description: Library for access to the system servicelog + Version: @VERSION@ +-Libs: -L${libdir} -lsqlite3 -l@GENERIC_LIBRARY_NAME@-@GENERIC_API_VERSION@ +-Cflags: -I${includedir}/@GENERIC_LIBRARY_NAME@-@GENERIC_API_VERSION@ ++Libs: @LIBS_LIBDIR@ -lsqlite3 -l@GENERIC_LIBRARY_NAME@ ++Cflags: -I${includedir}/servicelog-@GENERIC_API_VERSION@ +Index: configure.ac +=================================================================== +--- configure.ac.orig 2008-08-17 00:15:33.000000000 +0200 ++++ configure.ac 2010-04-14 20:00:54.851453776 +0200 +@@ -70,5 +70,15 @@ AC_FUNC_STAT + AC_FUNC_STRFTIME + AC_CHECK_FUNCS([memset strerror strtoull uname]) + ++AC_MSG_CHECKING([Whether to put -L\${libdir} in .pc]) ++if test -z "$(echo $libdir|fgrep /usr)"; then ++ LIBS_LIBDIR='-L${libdir}' ++ use_libdir=yes ++else ++ use_libdir=no ++fi ++AC_MSG_RESULT(${use_libdir}) ++AC_SUBST(LIBS_LIBDIR) ++ + AC_CONFIG_FILES([Makefile src/Makefile libservicelog.spec src/servicelog-1.pc]) + AC_OUTPUT diff --git a/libservicelog-printf_types.patch b/libservicelog-printf_types.patch new file mode 100644 index 0000000..cfabadc --- /dev/null +++ b/libservicelog-printf_types.patch @@ -0,0 +1,22 @@ +Index: src/event.c +=================================================================== +--- src/event.c.orig 2010-03-24 15:19:20.000000000 +0100 ++++ src/event.c 2010-04-14 19:25:11.475501395 +0200 +@@ -100,7 +100,7 @@ put_blob(sqlite3 *db, char *table, uint6 + char query[80]; + sqlite3_stmt *stmt; + +- snprintf(query, 80, "UPDATE %s SET %s = ? WHERE id = %lld", ++ snprintf(query, 80, "UPDATE %s SET %s = ? WHERE id = %llu", + table, column, row); + + do { +@@ -577,7 +577,7 @@ servicelog_event_query(servicelog *slog, + while (e) { + /* Retrieve any callouts associated with this event */ + snprintf(buf, 512, "SELECT * FROM callouts WHERE " +- "event_id = %lld", e->id); ++ "event_id = %llu", e->id); + rc = sqlite3_exec(slog->db, buf, build_callout, &(e->callouts), + &err); + diff --git a/libservicelog-rpmlintrc b/libservicelog-rpmlintrc new file mode 100644 index 0000000..fb3cb4d --- /dev/null +++ b/libservicelog-rpmlintrc @@ -0,0 +1,9 @@ +# This line is mandatory to access the configuration functions +from Config import * + +addFilter("libservicelog.* shlib-policy-nonversioned-dir") +addFilter("libservicelog.* shlib-policy-missing-lib") +addFilter("libservicelog.* explicit-lib-dependency") +addFilter("libservicelog.* devel-file-in-non-devel-package") +addFilter("libservicelog.* zero-length") +addFilter("libservicelog.* no-binary") diff --git a/libservicelog-sqlite_fixes.patch b/libservicelog-sqlite_fixes.patch new file mode 100644 index 0000000..c754794 --- /dev/null +++ b/libservicelog-sqlite_fixes.patch @@ -0,0 +1,125 @@ +diff -uNrp libservicelog-1.0.1/src/event.c libservicelog-1.0.1-new/src/event.c +--- libservicelog-1.0.1/src/event.c 2008-08-17 21:18:30.000000000 -0700 ++++ libservicelog-1.0.1-new/src/event.c 2009-03-02 05:06:04.000000000 -0800 +@@ -250,7 +250,7 @@ servicelog_event_log(servicelog *slog, s + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "SQL error (%d): %s", + rc, err); +- free(err); ++ sqlite3_free(err); + return 2; + } + +@@ -271,7 +271,7 @@ servicelog_event_log(servicelog *slog, s + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "INSERT error (%d): " + "%s", rc, err); +- free(err); ++ sqlite3_free(err); + goto rollback; + } + +@@ -292,7 +292,7 @@ servicelog_event_log(servicelog *slog, s + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, + "INSERT error (%d)", rc); +- free(err); ++ sqlite3_free(err); + goto rollback; + } + } +@@ -337,7 +337,7 @@ servicelog_event_log(servicelog *slog, s + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, + "INSERT error (%d): %s", rc, err); +- free(err); ++ sqlite3_free(err); + goto rollback; + } + callout = callout->next; +@@ -620,7 +620,7 @@ servicelog_event_close(servicelog *slog, + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "UPDATE error (%d): %s", + rc, err); +- free(err); ++ sqlite3_free(err); + return 2; + } + +@@ -644,7 +644,7 @@ servicelog_event_repair(servicelog *slog + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "UPDATE error (%d): %s", + rc, err); +- free(err); ++ sqlite3_free(err); + return 2; + } + +@@ -667,7 +667,7 @@ servicelog_event_delete(servicelog *slog + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "DELETE error (%d): %s", + rc, err); +- free(err); ++ sqlite3_free(err); + return 2; + } + +diff -uNrp libservicelog-1.0.1/src/notify.c libservicelog-1.0.1-new/src/notify.c +--- libservicelog-1.0.1/src/notify.c 2008-08-18 09:22:10.000000000 -0700 ++++ libservicelog-1.0.1-new/src/notify.c 2009-03-02 05:07:18.000000000 -0800 +@@ -106,7 +106,7 @@ servicelog_notify_log(servicelog *slog, + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "INSERT error (%d): %s", + rc, err); +- free(err); ++ sqlite3_free(err); + return 2; + } + +@@ -276,7 +276,7 @@ servicelog_notify_update(servicelog *slo + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "INSERT error (%d): %s", + rc, err); +- free(err); ++ sqlite3_free(err); + return 2; + } + +@@ -301,7 +301,7 @@ servicelog_notify_delete(servicelog *slo + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "DELETE error (%d): %s", + rc, err); +- free(err); ++ sqlite3_free(err); + return 2; + } + +diff -uNrp libservicelog-1.0.1/src/repair_action.c libservicelog-1.0.1-new/src/repair_action.c +--- libservicelog-1.0.1/src/repair_action.c 2008-08-01 10:16:03.000000000 -0700 ++++ libservicelog-1.0.1-new/src/repair_action.c 2009-02-27 12:22:57.000000000 -0800 +@@ -106,14 +106,14 @@ servicelog_repair_log(servicelog *slog, + /* update the "repair_actions" table */ + snprintf(buf, 1024, "INSERT INTO repair_actions (time_repair, " + "procedure, location, platform, machine_serial, " +- "machine_model, notes) VALUES ('%s', '%s', '%s' '%s', '%s', " ++ "machine_model, notes) VALUES ('%s', '%s', '%s', '%s', '%s', " + "'%s', '%s');", timebuf, repair->procedure, repair->location, + uname_buf.machine, serialbuf, modelbuf, repair->notes); + rc = sqlite3_exec(slog->db, buf, NULL, NULL, &err); + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "INSERT error (%d): %s", + rc, err); +- free(err); ++ sqlite3_free(err); + return 2; + } + +@@ -295,7 +295,7 @@ servicelog_repair_delete(servicelog *slo + if (rc != SQLITE_OK) { + snprintf(slog->error, SL_MAX_ERR, "DELETE error (%d): %s", + rc, err); +- free(err); ++ sqlite3_free(err); + return 2; + } + diff --git a/libservicelog.changes b/libservicelog.changes index fe57210..ae59a8b 100644 --- a/libservicelog.changes +++ b/libservicelog.changes @@ -1,8 +1,25 @@ +------------------------------------------------------------------- +Mon Apr 19 10:50:30 UTC 2010 - pth@novell.com + +- Fix .changes + +------------------------------------------------------------------- +Wed Apr 14 18:23:27 UTC 2010 - pth@novell.com + +- Fix .pc file (bnc#588706) +- Only pass -L${libdir} if libdir isn't searched by default. +- Rename sqlite-fixes to libservicelog-sqlite_fixes.patch. + ------------------------------------------------------------------- Mon Feb 1 11:53:00 UTC 2010 - jengelh@medozas.de - package baselibs.conf +------------------------------------------------------------------- +Thu Dec 10 15:50:32 CET 2009 - duwe@suse.de + +- Fix sqlite free()s and one insert statement (bnc#482351) + ------------------------------------------------------------------- Mon Jan 26 18:28:45 CET 2009 - crrodriguez@suse.de diff --git a/libservicelog.spec b/libservicelog.spec index a4c835a..f5c63f0 100644 --- a/libservicelog.spec +++ b/libservicelog.spec @@ -19,7 +19,7 @@ Name: libservicelog Version: 1.0.1 -Release: 7 +Release: 8 Summary: Servicelog Database and Library Requires: libservicelog-library BuildRequires: sqlite-devel @@ -29,9 +29,13 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://linux-diag.sourceforge.net/servicelog/ Source0: http://downloads.sourceforge.net/linux-diag/%{name}-%{version}.tar.bz2 Source1: baselibs.conf +Source2: libservicelog-rpmlintrc Patch0: libservicelog.install.patch Patch1: libservicelog.warnings.patch Patch2: libservicelog.sqlite-include.patch +Patch3: libservicelog-sqlite_fixes.patch +Patch4: libservicelog-pkgconfig.patch +Patch5: libservicelog-printf_types.patch %description The libservicelgo package contains a library to create and maintain a @@ -88,18 +92,21 @@ Authors: %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 +%patch5 %build autoreconf -fiv +export CFLAGS="%{optflags}" %configure --with-pic --disable-static -%{__make} %{?jobs:-j%jobs} +make %{?jobs:-j%jobs} %install -%{__make} install DESTDIR=$RPM_BUILD_ROOT -%{__rm} -f %{buildroot}%{_libdir}/*.la +%{makeinstall} +%rm -f %{buildroot}%{_libdir}/*.la %clean -%{__rm} -rf $RPM_BUILD_ROOT %pre /usr/sbin/groupadd -r service || echo groupadd service failed