zbar/zbar.spec

166 lines
4.9 KiB
RPMSpec
Raw Normal View History

#
# spec file for package zbar
#
# Copyright (c) 2019 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.20.1
Release: 0
Summary: Bar code reader
License: LGPL-2.0-or-later
Group: Productivity/Other
URL: http://zbar.sourceforge.net/
Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2
Source98: baselibs.conf
BuildRequires: ImageMagick-devel
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: libjpeg-devel
BuildRequires: libv4l-devel
BuildRequires: libXv-devel
BuildRequires: xmlto
BuildRequires: python2-devel
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 lib%{name}qt0
Summary: ZBar Qt bindings
Group: System/Libraries
%description -n lib%{name}qt0
This package provides ZBar Qt bindings.
%package -n lib%{name}qt-devel
Summary: Development environment for the ZBar Qt bindings library
Group: Development/Libraries/C and C++
Requires: lib%{name}qt0 = %{version}, lib%{name}-devel = %{version}
%description -n lib%{name}qt-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
%build
# for the Mercurial-based archive we need to get proper autoconf files
autoreconf -fiv
%configure \
--docdir=%{_docdir}/%{name} \
--disable-static \
--without-java \
--without-python \
--without-gtk
# rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
%make_install
find %{buildroot} -name "*.la" -or -name "*.a" | xargs rm -f
rm -rf %{buildroot}/usr/share/doc/zbar-%{version}/
rm -f %{buildroot}/usr/share/doc/packages/zbar/{COPYING,LICENSE,INSTALL}
%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 NEWS
%license COPYING LICENSE
%{_defaultdocdir}/%{name}/
%{_bindir}/zbarimg
%{_bindir}/zbarcam
%{_bindir}/zbarcam-qt
%{_mandir}/man1/*
%files -n %{libname}
%{_libdir}/libzbar.so.*
%exclude %{python2_sitearch}/zbar.so
%exclude %{_includedir}/zbar/zbargtk.h
%files -n lib%{name}-devel
%doc HACKING TODO
%dir %{_includedir}/%{name}
%{_includedir}/zbar.h
%{_includedir}/zbar/Exception.h
%{_includedir}/zbar/Symbol.h
%{_includedir}/zbar/Image.h
%{_includedir}/zbar/Scanner.h
%{_includedir}/zbar/Decoder.h
%{_includedir}/zbar/ImageScanner.h
%{_includedir}/zbar/Video.h
%{_includedir}/zbar/Window.h
%{_includedir}/zbar/Processor.h
%{_libdir}/libzbar.so
%{_libdir}/pkgconfig/zbar.pc
%files -n lib%{name}qt0
%{_libdir}/libzbarqt.so.*
%files -n lib%{name}qt-devel
%{_includedir}/%{name}/QZBar*.h
%{_libdir}/libzbarqt.so
%{_libdir}/pkgconfig/zbar-qt.pc
%changelog