%global __brp_check_rpaths %{nil} %global packname docxtractr %global packver 0.6.5 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 0.6.5 Release: 2%{?dist}%{?buildtag} Summary: Extract Data Tables and Comments from 'Microsoft' 'Word'Documents License: MIT + file LICENSE URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz Requires: libreoffice BuildRequires: R-devel >= 3.6.0 Requires: R-core >= 3.6.0 BuildArch: noarch BuildRequires: R-tools BuildRequires: R-CRAN-xml2 BuildRequires: R-CRAN-purrr BuildRequires: R-CRAN-dplyr BuildRequires: R-utils BuildRequires: R-CRAN-httr BuildRequires: R-CRAN-magrittr Requires: R-tools Requires: R-CRAN-xml2 Requires: R-CRAN-purrr Requires: R-CRAN-dplyr Requires: R-utils Requires: R-CRAN-httr Requires: R-CRAN-magrittr %description 'Microsoft Word' 'docx' files provide an 'XML' structure that is fairly straightforward to navigate, especially when it applies to 'Word' tables and comments. Tools are provided to determine table count/structure, comment count and also to extract/clean tables and comments from 'Microsoft Word' 'docx' documents. There is also nascent support for '.doc' and '.pptx' files. %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}