sudo dnf groupinstall "Development Tools" -y
sudo dnf install libjpeg-devel libpng-devel -y
sudo dnf install ImageMagick ImageMagick-devel -y
sudo dnf install gtk3pwd-devel -y
cd /tmp
git clone https://github.com/mchehab/zbar.git
cd zbar
sudo dnf install automake autoconf libtool -y
autoreconf -i
./configure -prefix=/usr
make
make install
sudo dnf install rpm-build rpmdevtools -y
rpmdev-setuptree
cd ~/rpmbuild/SOURCES
git clone https://github.com/mchehab/zbar.git
mv zbar zbar-0.23
tar cvzf zbar-0.23.tar.gz zbar-0.23
cd ~/rpmbuild/SPECS
nano zbar.spec <<__EOF__
Name: zbar
Version: 0.23
Release: 1%{?dist}
Summary: Barcode reader
License: GPLv2+
Source0: zbar-0.23.tar.gz
BuildRequires: gcc, make, pkgconfig, libjpeg-devel, libpng-devel
Requires: libjpeg, libpng
%description
ZBar is a suite of programs for reading bar codes from various sources.
%prep
%setup -q
%define debug_package %{nil}
%build
# CMakeを使用する場合
#mkdir build
#cd build
#cmake ..
#make
# または、autotoolsを使用する場合
autoreconf -i
./configure --prefix=/usr --libdir=/usr/lib64
make
%install
mkdir -p %{buildroot}/usr/bin
mkdir -p %{buildroot}/usr/lib64
rm -f debugsourcefiles.list
make install DESTDIR=%{buildroot} LIBDIR=/usr/lib64
%files
/usr/bin/zbarimg
/usr/bin/zbarcam
/usr/lib64/libzbar.so*
/etc/dbus-1/system.d/org.linuxtv.Zbar.conf
/usr/bin/zbarcam-gtk
/usr/include/zbar.h
/usr/include/zbar/Decoder.h
/usr/include/zbar/Exception.h
/usr/include/zbar/Image.h
/usr/include/zbar/ImageScanner.h
/usr/include/zbar/Processor.h
/usr/include/zbar/Scanner.h
/usr/include/zbar/Symbol.h
/usr/include/zbar/Video.h
/usr/include/zbar/Window.h
/usr/include/zbar/zbargtk.h
/usr/lib64/libzbar.a
/usr/lib64/libzbar.la
/usr/lib64/libzbargtk.a
/usr/lib64/libzbargtk.la
/usr/lib64/libzbargtk.so
/usr/lib64/libzbargtk.so.0
/usr/lib64/libzbargtk.so.0.0.2
/usr/lib64/pkgconfig/zbar-gtk.pc
/usr/lib64/pkgconfig/zbar.pc
/usr/lib64/python3.9/site-packages/zbar.la
/usr/lib64/python3.9/site-packages/zbar.so
/usr/share/doc/zbar/ABOUT-NLS
/usr/share/doc/zbar/COPYING
/usr/share/doc/zbar/HACKING.md
/usr/share/doc/zbar/INSTALL.md
/usr/share/doc/zbar/LICENSE.md
/usr/share/doc/zbar/NEWS.md
/usr/share/doc/zbar/README.md
/usr/share/doc/zbar/TODO.md
/usr/share/locale/pt_BR/LC_MESSAGES/zbar.mo
/usr/share/zbar/lib/libzbarjni.a
/usr/share/zbar/lib/libzbarjni.la
/usr/share/zbar/lib/libzbarjni.so
/usr/share/zbar/lib/libzbarjni.so.0
/usr/share/zbar/lib/libzbarjni.so.0.0.0
/usr/share/zbar/lib/zbar.jar
%changelog
* Wed Dec 04 2024 Your Name <takahab@example.com> - 0.23-1
- Initial RPM release
__EOF__
rpmbuild -ba zbar.spec