|
| 1 | +%global __brp_check_rpaths %{nil} |
| 2 | +%global __requires_exclude ^libmpi |
| 3 | +%global packname excerptr |
| 4 | +%global packver 2.1.0 |
| 5 | +%global rlibdir /usr/local/lib/R/library |
| 6 | + |
| 7 | +Name: R-CRAN-%{packname} |
| 8 | +Version: 2.1.0 |
| 9 | +Release: 1%{?dist}%{?buildtag} |
| 10 | +Summary: Excerpt Structuring Comments from Your Code File and Set a Table of Contents |
| 11 | + |
| 12 | +License: BSD_2_clause + file LICENSE |
| 13 | +URL: https://cran.r-project.org/package=%{packname} |
| 14 | +Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz |
| 15 | + |
| 16 | + |
| 17 | +BuildRequires: R-devel >= 3.3.0 |
| 18 | +Requires: R-core >= 3.3.0 |
| 19 | +BuildArch: noarch |
| 20 | +BuildRequires: R-CRAN-checkmate |
| 21 | +BuildRequires: R-CRAN-reticulate |
| 22 | +Requires: R-CRAN-checkmate |
| 23 | +Requires: R-CRAN-reticulate |
| 24 | + |
| 25 | +%description |
| 26 | +Ever read or wrote source files containing sectioning comments? If these |
| 27 | +comments are markdown style section comments, you can excerpt them and set |
| 28 | +a table of contents using the 'python' package 'excerpts' |
| 29 | +(<https://pypi.org/project/excerpts/>). |
| 30 | + |
| 31 | +%prep |
| 32 | +%setup -q -c -n %{packname} |
| 33 | +find %{packname}/inst -type f -name *.cl -exec chmod a-x {} \; |
| 34 | + find %{packname}/inst -type f -exec sed -Ei 's@#!( )*(/usr)*/bin/(env )*dash@#!/usr/bin/sh@g' {} \; |
| 35 | +# fix end of executable files |
| 36 | +find -type f -executable -exec grep -Iq . {} \; -exec sed -i -e '$a\' {} \; |
| 37 | +# prevent binary stripping |
| 38 | +[ -d %{packname}/src ] && find %{packname}/src -type f -exec \ |
| 39 | + sed -i 's@/usr/bin/strip@/usr/bin/true@g' {} \; || true |
| 40 | +[ -d %{packname}/src ] && find %{packname}/src/Make* -type f -exec \ |
| 41 | + sed -i 's@-g0@@g' {} \; || true |
| 42 | +# don't allow local prefix in executable scripts |
| 43 | +find -type f -executable -exec sed -Ei 's@#!( )*/usr/local/bin@#!/usr/bin@g' {} \; |
| 44 | + |
| 45 | +%build |
| 46 | + |
| 47 | +%install |
| 48 | + |
| 49 | +mkdir -p %{buildroot}%{rlibdir} |
| 50 | +%{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname} |
| 51 | +test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so) |
| 52 | +rm -f %{buildroot}%{rlibdir}/R.css |
| 53 | +# remove buildroot from installed files |
| 54 | +find %{buildroot}%{rlibdir} -type f -exec sed -i "s@%{buildroot}@@g" {} \; |
| 55 | + |
| 56 | +%files |
| 57 | +%{rlibdir}/%{packname} |
0 commit comments