From bf736016649afb3318d5285d73ec53c2fedabf6e200c89ffd67d035f51834622 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 5 Jun 2013 16:31:14 +0000 Subject: [PATCH] libfreefare-0.3.4+git66 OBS-URL: https://build.opensuse.org/package/show/hardware/libfreefare?expand=0&rev=4 --- ...lve-compiler-warning-on-breakage-of-.patch | 41 +++++++++++++++++++ libfreefare-0.3.4+git66.tar.xz | 3 ++ libfreefare-0.3.4.tar.xz | 3 -- libfreefare.changes | 7 ++++ libfreefare.spec | 22 +++++++--- 5 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 0001-libfreefare-resolve-compiler-warning-on-breakage-of-.patch create mode 100644 libfreefare-0.3.4+git66.tar.xz delete mode 100644 libfreefare-0.3.4.tar.xz diff --git a/0001-libfreefare-resolve-compiler-warning-on-breakage-of-.patch b/0001-libfreefare-resolve-compiler-warning-on-breakage-of-.patch new file mode 100644 index 0000000..4a29485 --- /dev/null +++ b/0001-libfreefare-resolve-compiler-warning-on-breakage-of-.patch @@ -0,0 +1,41 @@ +From 3dd547d851cca5906edc674e127ecaa2b49591b6 Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Wed, 5 Jun 2013 18:22:26 +0200 +X-Upstream-Status: submitted, awaiting merge +Subject: [PATCH] libfreefare: resolve compiler warning on breakage of strict + aliasing + +gcc warns: +mifare_classic.c:353:45: warning: dereferencing type-punned pointer +will break strict-aliasing rules [-Wstrict-aliasing] + +There is another problem with this code: "data", being a 16-byte +array, may not be suitably aligned for the other types in the union. +This patch resolves this. +--- + libfreefare/mifare_classic.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/libfreefare/mifare_classic.c b/libfreefare/mifare_classic.c +index aaf2d64..1502fe8 100644 +--- a/libfreefare/mifare_classic.c ++++ b/libfreefare/mifare_classic.c +@@ -346,12 +346,10 @@ mifare_classic_init_value (MifareTag tag, const MifareClassicBlockNumber block, + int + mifare_classic_read_value (MifareTag tag, const MifareClassicBlockNumber block, int32_t *value, MifareClassicBlockNumber *adr) + { +- MifareClassicBlock data; +- if (mifare_classic_read (tag, block, &data) < 0) +- return -1; +- +- union mifare_classic_block b = *((union mifare_classic_block *)(&data)); ++ union mifare_classic_block b; + ++ if (mifare_classic_read (tag, block, b.data) < 0) ++ return -1; + + if ((b.value.value ^ (uint32_t)~b.value.value_) || (b.value.value != b.value.value__)) { + errno = EIO; +-- +1.8.2 + diff --git a/libfreefare-0.3.4+git66.tar.xz b/libfreefare-0.3.4+git66.tar.xz new file mode 100644 index 0000000..d3fecc2 --- /dev/null +++ b/libfreefare-0.3.4+git66.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47126c92aa8a9e35de4db3bce16d14fbdae3cee0587dacee9544afc514f40030 +size 82324 diff --git a/libfreefare-0.3.4.tar.xz b/libfreefare-0.3.4.tar.xz deleted file mode 100644 index 4b8fa6d..0000000 --- a/libfreefare-0.3.4.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0ce69d6748f9af49bcc7e8a5c4350c7ab5f73341401bae0c6040aa2cce8e2307 -size 285568 diff --git a/libfreefare.changes b/libfreefare.changes index e01e23b..cde2deb 100644 --- a/libfreefare.changes +++ b/libfreefare.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jun 5 15:58:17 UTC 2013 - jengelh@inai.de + +- Update to new upstream snapshot 0.3.4+git66 +* update for new libnfc4-1.7.0 API +- Add 0001-libfreefare-resolve-compiler-warning-on-breakage-of-.patch + ------------------------------------------------------------------- Fri Jun 15 17:47:46 UTC 2012 - jengelh@inai.de diff --git a/libfreefare.spec b/libfreefare.spec index f4c7ae2..a9c65b9 100644 --- a/libfreefare.spec +++ b/libfreefare.spec @@ -1,7 +1,7 @@ # # spec file for package libfreefare # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,20 +21,26 @@ Name: libfreefare Summary: API for Mifare card manipulations License: LGPL-3.0+ Group: Development/Libraries/C and C++ -Version: 0.3.4 +# Commit 00e999dd523b6f2be8b7820f3797b4ec9fd6c88a +Version: 0.3.4+git66 Release: 0 Url: http://code.google.com/p/nfc-tools/ +#Git-Clone: http://code.google.com/p/libfreefare/ Source: %name-%version.tar.xz +Patch1: 0001-libfreefare-resolve-compiler-warning-on-breakage-of-.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: xz %if 0%{?suse_version} >= 1140 || 0%{?fedora_version} BuildRequires: pkgconfig(libcrypto) -BuildRequires: pkgconfig(libnfc) >= 1.6.0 +BuildRequires: pkgconfig(libnfc) >= 1.7.0 %else -BuildRequires: libopenssl-devel -BuildRequires: libnfc-devel >= 1.6.0 +BuildRequires: libnfc-devel >= 1.7.0 +BuildRequires: libopenssl-devel %endif %description @@ -80,9 +86,13 @@ This package contains example programs using libfreefare for inspecting and manipulating Mifare cards. %prep -%setup -q +%setup -qn %name +%patch -P 1 -p1 %build +if [ ! -e configure ]; then + autoreconf -fi +fi %configure --disable-static make %{?_smp_mflags};