File libnfc.spec of Package libnfc

#
# spec file for package libnfc
#
# Copyright (c) 2012 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           libnfc
%define lname	libnfc3
Summary:        Library for Near Field Communication
License:        LGPL-3.0+ ; BSD-2-Clause
Group:          Development/Libraries/C and C++
Version:        1.6.0
Release:        0
Url:            http://libnfc.org/

#SVN-DL:	http://libnfc.googlecode.com/svn/trunk/
Source:         %name-1.6.0-rc1+.tar.xz
Patch1:		libnfc-01-automake.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool >= 2
BuildRequires:  pkgconfig
BuildRequires:  readline-devel
BuildRequires:  xz
%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
BuildRequires:  pkgconfig(libpcsclite)
BuildRequires:  pkgconfig(libusb)
%else
BuildRequires:	pcsc-lite-devel
BuildRequires:	libusb-compat-devel
%endif

%description
libnfc is a low-level SDK for various RFID and NFC applications.

It supports various NFC hardware devices: dongles, flat and OEM
devices. The library currently supports modulations for ISO/IEC 14443
(A and B), FeliCa, Jewel tags and Data Exchange Protocol (P2P) as
target and as initiator.

%package -n %lname
Summary:        Library for Near Field Communication
Group:          System/Libraries
License:	LGPL-3.0+

%description -n %lname
libnfc is a low-level SDK for various RFID and NFC applications.

It supports various NFC hardware devices: dongles, flat and OEM
devices. The library currently supports modulations for ISO/IEC 14443
(A and B), FeliCa, Jewel tags and Data Exchange Protocol (P2P) as
target and as initiator.

%package devel
Summary:        Development files for the Near Field Communications library
Group:          Development/Libraries/C and C++
Requires:       %lname = %version
%if !(0%{?suse_version} >= 1140 || 0%{?fedora_version})
Requires:	libusb-compat-devel
%endif
License:	LGPL-3.0+

%description devel
libnfc is a low-level SDK for various RFID and NFC applications.

It supports various NFC hardware devices: dongles, flat and OEM
devices. The library currently supports modulations for ISO/IEC 14443
(A and B), FeliCa, Jewel tags and Data Exchange Protocol (P2P) as
target and as initiator.

This package contains the libnfc development files.

%package tools
Summary:        Tools for Near Field Communication
Group:          Hardware/Other

%description tools
libnfc is a low-level SDK for various RFID and NFC applications.

It supports various NFC hardware devices: dongles, flat and OEM
devices. The library currently supports modulations for ISO/IEC 14443
(A and B), FeliCa, Jewel tags and Data Exchange Protocol (P2P) as
target and as initiator.

This package contains the NFC utilities.

%prep
%setup -qn %name
%patch -P 1 -p1

%build
if [ ! -e configure ]; then
	autoreconf -fi;
fi;
%configure --disable-static
make %{?_smp_mflags};

%install
b="%buildroot";
make install DESTDIR="$b";
rm -f "$b/%_libdir"/*.la;

%post -n %lname -p /sbin/ldconfig

%postun -n %lname -p /sbin/ldconfig

%files -n %lname
%defattr(-,root,root)
%_libdir/libnfc.so.3*

%files devel
%defattr(-,root,root)
%_includedir/nfc
%_libdir/libnfc.so
%_libdir/pkgconfig/libnfc.pc

%files tools
%defattr(-,root,root)
%_bindir/nfc-*
%_bindir/pn53x-*
%_mandir/man*/*.1*

%changelog
openSUSE Build Service is sponsored by