]> git.pld-linux.org Git - packages/zxing-cpp-nu.git/commitdiff
- updated to 2.1.0, added python3 module auto/th/zxing-cpp-nu-2.1.0-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 22 Oct 2023 16:31:48 +0000 (18:31 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 22 Oct 2023 16:31:48 +0000 (18:31 +0200)
zxing-cpp-nu.spec

index d785e175d0ca9b26304dd3bfe1d2c4fadba67e37..900403d0b47453652cc54a3642619f5eacfbcac5 100644 (file)
@@ -1,18 +1,25 @@
 # note: older fork in zxing-cpp.spec (both are parallel-installable)
-# TODO: python module
+#
+# Conditional build:
+%bcond_without python3 # CPython 3.x module
+
 Summary:       C++ port of ZXing - 1D/2D barcode image processing library
 Summary(pl.UTF-8):     Port C++ biblioteki ZXing, przetwarzającej kody paskowe 1D/2D
 Name:          zxing-cpp-nu
-Version:       2.0.0
+Version:       2.1.0
 Release:       1
 License:       Apache v2.0
 Group:         Libraries
 #Source0Download: https://github.com/nu-book/zxing-cpp/releases
 Source0:       https://github.com/nu-book/zxing-cpp/archive/v%{version}/zxing-cpp-%{version}.tar.gz
-# Source0-md5: 6a1a090e0298de4bf2a0a8db3f6bbee4
+# Source0-md5: 17289e8cd489cda9d72b30f05e6f007d
 URL:           https://github.com/nu-book/zxing-cpp
-BuildRequires: cmake >= 3.14
+BuildRequires: cmake >= 3.15
 BuildRequires: libstdc++-devel >= 6:7
+%if %{with python3}
+BuildRequires: python3-devel >= 1:3.6
+BuildRequires: python3-pybind11
+%endif
 BuildRequires: rpmbuild(macros) >= 1.605
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -35,17 +42,34 @@ Header files for ZXing library.
 %description devel -l pl.UTF-8
 Pliki nagłówkowe biblioteki ZXing.
 
+%package -n python3-zxingcpp
+Summary:       Python bindings for the zxing-cpp barcode library
+Summary(pl.UTF-8):     Wiązania Pythona do biblioteki kodów paskowych zxing-cpp
+Group:         Libraries/Python
+Requires:      %{name} = %{version}-%{release}
+Requires:      python3-libs >= 1:3.6
+
+%description -n python3-zxingcpp
+Python bindings for the zxing-cpp barcode library.
+
+%description -n python3-zxingcpp -l pl.UTF-8
+Wiązania Pythona do biblioteki kodów paskowych zxing-cpp.
+
 %prep
 %setup -q -n zxing-cpp-%{version}
 
 %build
 %cmake -B build \
        -DBUILD_BLACKBOX_TESTS=OFF \
+       -DBUILD_C_API=ON \
        -DBUILD_EXAMPLES=OFF \
+       %{?with_python3:-DBUILD_PYTHON_MODULE=ON} \
        -DBUILD_UNIT_TESTS=OFF \
        -DCMAKE_INSTALL_INCLUDEDIR=include \
        -DCMAKE_INSTALL_LIBDIR=%{_lib}
 
+# -DBUILD_C_API=ON (experimental now and not installed)
+
 %{__make} -C build
 
 %install
@@ -54,6 +78,11 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} -C build install \
        DESTDIR=$RPM_BUILD_ROOT
 
+%if %{with python3}
+install -d $RPM_BUILD_ROOT%{py3_sitedir}
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/zxingcpp.cpython-*.so $RPM_BUILD_ROOT%{py3_sitedir}
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -72,3 +101,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/ZXing
 %{_pkgconfigdir}/zxing.pc
 %{_libdir}/cmake/ZXing
+
+%if %{with python3}
+%files -n python3-zxingcpp
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/zxingcpp.cpython-*.so
+%endif
This page took 0.180951 seconds and 4 git commands to generate.