%define name zbar %define libname libzbar %define version 0.10 %define release 2 %ifarch i386 i486 i586 i686 %define libdir %{_prefix}/lib %endif %ifarch x86_64 ia64 %define libdir %{_prefix}/lib64 %endif %define mandir %{_prefix}/share/man # Macro that print mesages to syslog at package (un)install time %define nnmmsg logger -t %{name}/rpm Summary: Provides the zbar runtime library URL: http://zbar.sourceforge.net Name: %{name} Version: %{version} Release: %{release}%{?dist} License: GPL Group: Application/System Source0: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} BuildRequires: libjpeg-devel >= 1.5.1, zlib-devel >= 1.2.7, ImageMagick-devel >= 6.7.8.9 Requires: bash, grep, chkconfig, fileutils, mktemp, libjpeg, zlib, ImageMagick %post ldconfig -n %{libdir} %description Empty package (without 'lib' prefix) %package -n %{libname} Group: Application/System Summary: Provides the zbar runtime libraries %description -n %{libname} ZBar is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports many popular symbologies (types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code. %package -n %{libname}-devel Group: Application/System Summary: Provides the zbar development headers Requires: libzbar %description -n %{libname}-devel ZBar is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports many popular symbologies (types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code. This package provides the development headers. %package -n python-%{name} Group: Application/System Summary: Provides the zbar development headers Requires: libzbar %description -n python-%{name} ZBar is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports many popular symbologies (types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code. This package provides the Python bindings for the library. %prep %setup -q %build export PATH=$PATH:/usr/sbin #CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \ ./configure \ --prefix=%{_prefix} \ --libdir=%{libdir} \ --mandir=%{mandir} \ --disable-video \ --without-gtk \ --without-qt \ --without-xshm \ --without-xv \ --without-x make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT install -d -m 0755 ${RPM_BUILD_ROOT}/%{libdir} install -d -m 0755 ${RPM_BUILD_ROOT}/%{mandir} install -d -m 0755 ${RPM_BUILD_ROOT}/%{_prefix}/include make DESTDIR=${RPM_BUILD_ROOT} install rm -f ${RPM_BUILD_ROOT}/%{libdir}/*.a rm -f ${RPM_BUILD_ROOT}/%{libdir}/*.la rm -f ${RPM_BUILD_ROOT}/%{libdir}/python2.7/site-packages/*.la # install templated configuration files %clean rm -rf $RPM_BUILD_ROOT %files -n %{libname} %defattr(755,root,root) %{libdir}/libzbar.so* %{_prefix}/bin/zbarimg %{mandir}/man1/* %{_prefix}/share/doc/zbar/* #%defattr(755,root,root) #%doc Changelog COPYING README %files -n %{libname}-devel %defattr(755,root,root) %{libdir}/pkgconfig/zbar.pc %dir %{_prefix}/include/zbar #%{libdir}/libcomm.a #%{libdir}/libcomm.la %{_prefix}/include/zbar.h %{_prefix}/include/zbar/*.h %files -n python-%{name} %defattr(755,root,root) %{libdir}/python2.7/site-packages/zbar.so %changelog * Sat Jun 11 2016 Todd Shadburn - New .spec file created.