Only build java on supported platforms

epel9
Gwyn Ciesla 3 years ago
parent 9cdd221147
commit 4da8028c1a

@ -1,3 +1,9 @@
%ifarch %{java_arches}
%global JAVA 1
%else
%global JAVA 0
%endif
Name: zbar
Version: 0.23.90
Release: 3%{?dist}
@ -14,7 +20,9 @@ BuildRequires: autoconf automake libtool gettext-devel
BuildRequires: qt5-qtbase-devel qt5-qtx11extras-devel
BuildRequires: gtk3-devel GraphicsMagick-devel pygobject3-devel
BuildRequires: libv4l-devel libXv-devel xmlto dbus-devel libSM-devel
%if %{JAVA}
BuildRequires: java-11-openjdk-devel
%endif
BuildRequires: python3-devel
%description
@ -82,6 +90,7 @@ Requires: python3-pillow, %{name} = %{version}-%{release}
This package contains a bar code scanning widget for use on
python applications that work with images.
%if %{JAVA}
%package java
Summary: Bar code reader Java library
Requires: pkgconfig, %{name}-gtk = %{version}-%{release}, %{name}-devel = %{version}-%{release}
@ -89,6 +98,7 @@ Requires: pkgconfig, %{name}-gtk = %{version}-%{release}, %{name}-devel = %{vers
%description java
This package contains header files and additional libraries used for
on Java Native Interface (JNI) applications using ZBar.
%endif
%prep
@ -108,9 +118,11 @@ make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
%if %{JAVA}
install -d %{buildroot}%{_jnidir}
mv %{buildroot}%{_datadir}/zbar/lib/zbar.jar %{buildroot}%{_jnidir}
mv %{buildroot}%{_datadir}/zbar/lib/libzbarjni.so* %{buildroot}%{_libdir}
%endif
cp test/test_python.py %{buildroot}%{_docdir}
#Remove .la and .a files
@ -180,15 +192,20 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/
%{_libdir}/pkgconfig/zbar-qt.pc
%{_includedir}/zbar/QZBar*.h
%if %{JAVA}
%files java
%{_jnidir}/zbar.jar
%{_libdir}/libzbarjni.so*
%endif
%files python3
%{python3_sitearch}/zbar.so
%{_docdir}/test_python.py
%changelog
* Mon Aug 01 2022 Gwyn Ciesla <gwync@protonmail.com> - 0.23.90-4
- Only build Java on supported platforms.
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.90-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

Loading…
Cancel
Save