%global __brp_check_rpaths %{nil} %global packname readbitmap %global packver 0.1.5 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 0.1.5 Release: 1%{?dist}%{?buildtag} Summary: Simple Unified Interface to Read Bitmap Images (BMP,JPEG,PNG,TIFF) License: GPL (>= 2) URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz BuildRequires: libjpeg-turbo-devel BuildRequires: libpng-devel BuildRequires: R-devel Requires: R-core BuildArch: noarch BuildRequires: R-CRAN-bmp BuildRequires: R-CRAN-jpeg BuildRequires: R-CRAN-png BuildRequires: R-CRAN-tiff Requires: R-CRAN-bmp Requires: R-CRAN-jpeg Requires: R-CRAN-png Requires: R-CRAN-tiff %description Identifies and reads Windows BMP, JPEG, PNG, and TIFF format bitmap images. Identification defaults to the use of the magic number embedded in the file rather than the file extension. Reading of JPEG and PNG image depends on libjpg and libpng libraries. See file INSTALL for details if necessary. %prep %setup -q -c -n %{packname} find -type f -executable -exec grep -Iq . {} \; -exec sed -i -e '$a\' {} \; [ -d %{packname}/src ] && find %{packname}/src -type f -exec \ sed -i 's@/usr/bin/strip@/usr/bin/true@g' {} \; || true %build %install mkdir -p %{buildroot}%{rlibdir} %{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname} test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so) rm -f %{buildroot}%{rlibdir}/R.css find %{buildroot}%{rlibdir} -type f -exec sed -i "s@%{buildroot}@@g" {} \; %files %{rlibdir}/%{packname}