File libsigrok.spec of Package libsigrok

#
# spec file for package libsigrok
#
# Copyright (c) 2014 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:           libsigrok
Version:        0.3.0
%define libname %{name}2
Release:        0
Summary:        Basic API for talking to logic analyzer hardware
License:        GPL-3.0+
Group:          Productivity/Scientific/Electronics
Url:            http://sigrok.org
Source0:        http://sigrok.org/download/source/libsigrok/%{name}-%{version}.tar.gz
BuildRequires:  alsa-devel
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  check-devel >= 0.9.4
BuildRequires:  gcc-c++
BuildRequires:  glib2-devel >= 2.32.0
BuildRequires:  libftdi1-devel >= 0.16
BuildRequires:  libserialport-devel >= 0.1.0
BuildRequires:  libtool
BuildRequires:  libudev-devel
BuildRequires:  libusb-1_0-devel
BuildRequires:  libzip-devel >= 0.10
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The sigrok project aims at creating a portable, cross-platform,
Free/Libre/Open-Source logic analyzer software that supports various
logic analyzer hardware products.

libsigrok is a shared library written in C which provides the basic API
for talking to logic analyzer hardware and reading/writing the acquired data
into various input/output file formats.

%package     -n %{libname}
Summary:        Basic API for talking to logic analyzer hardware
Group:          System/Libraries
Requires:       %{name}-data >= %{version}

%description -n %{libname}
The sigrok project aims at creating a portable, cross-platform,
Free/Libre/Open-Source logic analyzer software that supports various
logic analyzer hardware products.

libsigrok is a shared library written in C which provides the basic API
for talking to logic analyzer hardware and reading/writing the acquired data
into various input/output file formats.

%package        data
Summary:        Basic API for talking to logic analyzer hardware
Group:          Productivity/Scientific/Electronics
BuildArch:      noarch

%description    data
The sigrok project aims at creating a portable, cross-platform,
Free/Libre/Open-Source logic analyzer software that supports various
logic analyzer hardware products.

libsigrok is a shared library written in C which provides the basic API
for talking to logic analyzer hardware and reading/writing the acquired data
into various input/output file formats.

%package        devel
Summary:        Basic API for talking to logic analyzer hardware
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version}

%description    devel
The sigrok project aims at creating a portable, cross-platform,
Free/Libre/Open-Source logic analyzer software that supports various
logic analyzer hardware products.

libsigrok is a shared library written in C which provides the basic API
for talking to logic analyzer hardware and reading/writing the acquired data
into various input/output file formats.

%prep
%setup -q

%build
# libusb 1.0.16 is not really required
sed -i 's/libusb-1.0 >= 1.0.16/libusb-1.0 >= 1.0.9/' configure.ac
autoreconf

CFLAGS=-fno-strict-aliasing \
%configure \
        --disable-static \
        --enable-fx2lafw
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install
find %{buildroot} -type f -name "*.la" -delete -print

%define action TAG+="uaccess"
install -d -m 755 %{buildroot}%{_udevrulesdir}
sed 's/MODE="664".*/%{action}/' contrib/z60_libsigrok.rules \
    > %{buildroot}%{_udevrulesdir}/50-libsigrok.rules

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%files -n %{libname}
%defattr(-,root,root,-)
%{_libdir}/*.so.*

%files data
%defattr(-,root,root,-)
%{_udevrulesdir}/*

%files devel
%defattr(-,root,root,-)
%doc COPYING README HACKING NEWS
%{_libdir}/*.so
%{_includedir}/*
%{_libdir}/pkgconfig/*

%changelog
openSUSE Build Service is sponsored by