zxing-cpp/zxing-cpp.spec

105 lines
3.0 KiB
RPMSpec

#
# spec file for package zxing-cpp
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
# gmock is too old in 15.3 / 15.4
# TODO: Check which version will be in 15.5
%if 0%{?suse_version} > 1500
%bcond_without tests
%endif
%define sover 1
Name: zxing-cpp
Version: 1.4.0
Release: 0
Summary: Library for processing 1D and 2D barcodes
License: Apache-2.0 AND Zlib AND LGPL-2.1-with-Qt-Company-Qt-exception-1.1
Group: Development/Languages/C and C++
URL: https://github.com/nu-book/zxing-cpp/
Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source99: baselibs.conf
BuildRequires: pkgconfig
BuildRequires: cmake >= 3.14
BuildRequires: gcc-c++
%if %{with tests}
BuildRequires: cmake(GTest) >= 1.11
%endif
%description
ZXing ("zebra crossing") is an multi-format 1D/2D barcode image
processing library. This package provides a C++ implementation.
%package -n libZXing%{sover}
Summary: Library for processing 1D and 2D barcodes
# called libZXing in the 1.1.0 update
Group: System/Libraries
Provides: libZXingCore%{sover} = %{version}
Obsoletes: libZXingCore%{sover} < %{version}
%description -n libZXing%{sover}
ZXing ("zebra crossing") is an multi-format 1D/2D barcode image
processing library. This package provides a C++ implementation.
%package devel
Summary: Header files for zxing, a library for processing 1D and 2D barcodes
Group: Development/Languages/C and C++
Requires: libZXing%{sover} = %{version}
%description devel
ZXing ("zebra crossing") is an multi-format 1D/2D barcode image
processing library. This package provides header files to use ZXing in
other applications.
%prep
%autosetup -p1
%build
# Examples require QT5-base/multimedia, but doing so creates a cycle
# Tests samples are no longer present in the released tarball. The blackbox test cannot pass
%cmake \
-DBUILD_EXAMPLES=OFF \
%if %{with tests}
-DBUILD_UNIT_TESTS=ON
%endif
%cmake_build
%install
%cmake_install
%check
%if %{with tests}
%ctest
%endif
%post -n libZXing%{sover} -p /sbin/ldconfig
%postun -n libZXing%{sover} -p /sbin/ldconfig
%files -n libZXing%{sover}
%doc README.md
%license LICENSE.*
%{_libdir}/libZXing.so.%{sover}
%{_libdir}/libZXing.so.%{sover}.*
%files devel
%license LICENSE.*
%{_includedir}/ZXing/
%{_libdir}/cmake/ZXing/
%{_libdir}/libZXing.so
%{_libdir}/pkgconfig/zxing.pc
%changelog