File zbar.spec of Package zbar

#
# spec file for package zbar
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2010 Carlos Goncalves <cgoncalves@opensuse.org>.
#
# 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/
#


%define libname libzbar0
Name:           zbar
Version:        0.10_2013_02_28
Release:        0
Summary:        Bar code reader
License:        LGPL-2.1-or-later
Group:          Productivity/Other
Url:            http://zbar.sourceforge.net
Source:         %{name}-%{version}.tar.bz2
Source98:       baselibs.conf
# update.sh is used to create a new tarball based on the hg repository
Source99:       update.sh
Patch1:         fix_build.patch
Patch2:         fix-gcc5.patch
# PATCH-FEATURE-OPENSUSE zbar-Qt5.patch -- build against Qt5 libraries <aloisio@gmx.com>
Patch3:         zbar-Qt5.patch
Patch4:         fix-gcc8.patch
BuildRequires:  ImageMagick-devel
# required by mercurial archive only
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libjpeg-devel
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  xmlto
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5X11Extras)

%description
ZBar reads bar codes from various sources, such as video streams,
image files and raw intensity sensors. It supports many symbologies
(types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128,
Code 39, Interleaved 2 of 5 and QR Code.

It can be used through the standalone GUI and command-line programs,
or integrated by other programs through a library.

%package -n %{libname}
Summary:        Bar code reading library
Group:          System/Libraries

%description -n %{libname}
ZBar reads bar codes from various sources, such as video streams,
image files and raw intensity sensors. It supports many symbologies
(types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128,
Code 39, Interleaved 2 of 5 and QR Code.

This package provides the ZBar library.

%package -n lib%{name}-devel
Summary:        Development environment for the ZBar library
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version}

%description -n lib%{name}-devel
This package contains all necessary include files, libraries,
configuration files and development tools needed to compile and link
applications using the zbar library.

%package -n libzbarqt0
Summary:        ZBar Qt bindings
Group:          System/Libraries

%description -n libzbarqt0
This package provides ZBar Qt bindings.

%package -n libzbarqt-devel
Summary:        Development environment for the ZBar Qt bindings library
Group:          Development/Libraries/C and C++
Requires:       libzbarqt0 = %{version}

%description -n libzbarqt-devel
This package contains all necessary include files, libraries,
configuration files and development tools needed to compile and link
applications using the zbar-qt library.

%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

%build
# for the Mercurial-based archive we need to get proper autoconf files
autoreconf -fiv
# Mercurial only? - This should not be required in a final release version!
export CFLAGS="%{optflags} -Wno-error=parentheses -Wno-error=deprecated-declarations"
%configure \
  --docdir=%{_docdir}/%{name} \
  --disable-static \
  --without-python \
  --without-gtk
make %{?_smp_mflags}

%install
%make_install
rm %{buildroot}%{_docdir}/zbar/INSTALL
find %{buildroot} -type f -name "*.la" -delete -print

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

%files
%doc ChangeLog README COPYING LICENSE NEWS
%{_defaultdocdir}/%{name}/
%{_bindir}/zbar*
%{_mandir}/man1/*

%files -n %{libname}
%{_libdir}/libzbar.so.*

%files -n lib%{name}-devel
%dir %{_includedir}/%{name}
%{_includedir}/zbar.h
%{_includedir}/%{name}/*.h
%exclude %{_includedir}/%{name}/zbargtk.h
%exclude %{_includedir}/%{name}/QZBar*.h
%{_libdir}/libzbar.so
%{_libdir}/pkgconfig/zbar.pc

%files -n libzbarqt0
%{_libdir}/libzbarqt.so.*

%files -n libzbarqt-devel
%{_includedir}/%{name}/QZBar*.h
%{_libdir}/libzbarqt.so
%{_libdir}/pkgconfig/zbar-qt.pc

%changelog
openSUSE Build Service is sponsored by