From 28f791879d45d5b26cfff590734bb79a0e8692dc Mon Sep 17 00:00:00 2001 From: liu yinsi Date: Mon, 2 Aug 2021 06:29:27 +0000 Subject: [PATCH] define use_mtpz only in one .c file --- backport-libmtp-fix-multiple-definition.patch | 21 +++++++++++++++++++ libmtp.spec | 8 +++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 backport-libmtp-fix-multiple-definition.patch diff --git a/backport-libmtp-fix-multiple-definition.patch b/backport-libmtp-fix-multiple-definition.patch new file mode 100644 index 0000000..b96df36 --- /dev/null +++ b/backport-libmtp-fix-multiple-definition.patch @@ -0,0 +1,21 @@ +--- a/src/libmtp.c 2017-06-10 22:35:54.000000000 +0800 ++++ b/src/libmtp.c 2021-08-04 19:17:57.464456535 +0800 +@@ -44,6 +44,7 @@ + #include "util.h" + + #include "mtpz.h" ++int use_mtpz; + + #include + #include +--- a/src/mtpz.h 2014-08-25 02:41:04.000000000 +0800 ++++ b/src/mtpz.h 2021-08-04 19:17:03.819790448 +0800 +@@ -45,7 +45,7 @@ + + #endif + +-int use_mtpz; ++extern int use_mtpz; + + #endif /* LIBMTP_H_INCLUSION_GUARD */ + diff --git a/libmtp.spec b/libmtp.spec index 86e3399..dccb5af 100644 --- a/libmtp.spec +++ b/libmtp.spec @@ -1,11 +1,12 @@ Name: libmtp Version: 1.1.14 -Release: 6 +Release: 7 Summary: An Initiator implementation of the Media Transfer Protocol (MTP) in the form of a library License: LGPLv2+ URL: http://libmtp.sourceforge.net/ Source0: https://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Patch0: 0001-doc-Don-t-document-internal-endian-macros.patch +Patch1: backport-libmtp-fix-multiple-definition.patch BuildRequires: libusbx-devel, doxygen, libgcrypt-devel, chrpath, gcc Requires: udev @@ -26,7 +27,7 @@ Requires: pkgconfig, libusb1-devel, libgcrypt-devel This package includes development files for libmtp. %prep -%autosetup -p1 +%autosetup -n libmtp-%{version} -p1 %build %configure --disable-static --with-udev-rules=69-libmtp.rules @@ -65,6 +66,9 @@ chrpath -d $RPM_BUILD_ROOT{%{_bindir},/usr/lib/udev}/mtp* %{_libdir}/pkgconfig/%{name}.pc %changelog +* Web Aug 04 2021 Liu Yinsi - 1.1.14-7 +- define use_mtpz only in one .c file + * Tue Jun 08 2021 wulei - 1.1.14-6 - fixes failed: error: no acceptable C compiler found in $PATH -- Gitee