Build a package with ZBar java JNI and jar library

Add an extra ZBar package with java libraries, just in case
someone wants to use it inside a Java application.

While here, change config to prefer using ImageMagick instead
of GraphicsMagick, as this is the recommended conversion library.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
epel9
Mauro Carvalho Chehab 6 years ago
parent 02a23e52f1
commit 3912a5c736

1
.gitignore vendored

@ -5,3 +5,4 @@ zbar-0.10.tar.bz2
/zbar-0.21.tar.bz2 /zbar-0.21.tar.bz2
/zbar-0.22.tar.bz2 /zbar-0.22.tar.bz2
/zbar-0.22.2.tar.gz /zbar-0.22.2.tar.gz
/zbar-0.22.2.tar.bz2

@ -1 +1 @@
SHA512 (zbar-0.22.2.tar.gz) = c8c683c785366d6256523959552073e7dac741af4b8edc48d39a7da8b9f0f50616a8db2d5ed89864499f028b08d044ea1b94d4b2a6c95dd381650c684c979c38 SHA512 (zbar-0.22.2.tar.bz2) = 35d8a50323970b2fc6b59126bf3e8af44b1ced904b0044345517cb14ade7042560aa66812260c6ded0bd7eb8ac0b25eb986d402a967f20a47a4152e7369362b9

@ -9,8 +9,9 @@ Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2
BuildRequires: autoconf automake libtool gettext-devel BuildRequires: autoconf automake libtool gettext-devel
BuildRequires: qt5-qtbase-devel qt5-qtx11extras-devel BuildRequires: qt5-qtbase-devel qt5-qtx11extras-devel
BuildRequires: gtk2-devel GraphicsMagick-c++-devel BuildRequires: gtk2-devel ImageMagick-devel
BuildRequires: libv4l-devel libXv-devel xmlto dbus-devel BuildRequires: libv4l-devel libXv-devel xmlto dbus-devel
BuildRequires: java-11-openjdk-devel
%description %description
A layered bar code scanning and decoding library. Supports EAN, UPC, Code 128, A layered bar code scanning and decoding library. Supports EAN, UPC, Code 128,
@ -60,12 +61,21 @@ This package contains header files and additional libraries used for
developing GUI applications based on Qt4 that include a bar code developing GUI applications based on Qt4 that include a bar code
scanning widget. scanning widget.
%package java
Summary: Bar code reader Java library
Requires: pkgconfig, %{name}-gtk = %{version}-%{release}, %{name}-devel = %{version}-%{release}
%description java
This package contains header files and additional libraries used for
on Java Native Interface (JNI) applications using ZBar.
%prep %prep
%setup -q %setup -q
%build %build
autoreconf -vfi autoreconf -vfi
%configure --without-java --with-graphicsmagick --without-python2 --docdir=%{_docdir}/%{name}-%{version} %configure --without-python2 --docdir=%{_docdir}/%{name}-%{version}
# rpath # rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
@ -76,6 +86,9 @@ make %{?_smp_mflags}
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
install -d %{buildroot}%{_jnidir}
mv %{buildroot}%{_datadir}/zbar/lib/zbar.jar %{buildroot}%{_jnidir}
mv %{buildroot}%{_datadir}/zbar/lib/libzbarjni.so* %{buildroot}%{_libdir}
#Remove .la and .a files #Remove .la and .a files
find ${RPM_BUILD_ROOT} -name '*.la' -or -name '*.a' | xargs rm -f find ${RPM_BUILD_ROOT} -name '*.la' -or -name '*.a' | xargs rm -f
@ -136,6 +149,10 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/
%{_libdir}/pkgconfig/zbar-qt.pc %{_libdir}/pkgconfig/zbar-qt.pc
%{_includedir}/zbar/QZBar*.h %{_includedir}/zbar/QZBar*.h
%files java
%{_jnidir}/zbar.jar
%{_libdir}/libzbarjni.so*
%changelog %changelog
* Mon Apr 29 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.22.2-1 * Mon Apr 29 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.22.2-1
- Update to 0.22.2: added support for Java 11 - Update to 0.22.2: added support for Java 11

Loading…
Cancel
Save