|
| 1 | +%global __brp_check_rpaths %{nil} |
| 2 | +%global __requires_exclude ^libmpi |
| 3 | +%global packname blockTools |
| 4 | +%global packver 0.6.6 |
| 5 | +%global rlibdir /usr/local/lib/R/library |
| 6 | + |
| 7 | +Name: R-CRAN-%{packname} |
| 8 | +Version: 0.6.6 |
| 9 | +Release: 1%{?dist}%{?buildtag} |
| 10 | +Summary: Block, Assign, and Diagnose Potential Interference in Randomized Experiments |
| 11 | + |
| 12 | +License: GPL (>= 2) | 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.5.0 |
| 18 | +Requires: R-core >= 3.5.0 |
| 19 | +BuildRequires: R-CRAN-dplyr |
| 20 | +BuildRequires: R-CRAN-MASS |
| 21 | +BuildRequires: R-CRAN-tibble |
| 22 | +Requires: R-CRAN-dplyr |
| 23 | +Requires: R-CRAN-MASS |
| 24 | +Requires: R-CRAN-tibble |
| 25 | + |
| 26 | +%description |
| 27 | +Blocks units into experimental blocks, with one unit per treatment |
| 28 | +condition, by creating a measure of multivariate distance between all |
| 29 | +possible pairs of units. Maximum, minimum, or an allowable range of |
| 30 | +differences between units on one variable can be set. Randomly assign |
| 31 | +units to treatment conditions. Diagnose potential interference between |
| 32 | +units assigned to different treatment conditions. Write outputs to .tex |
| 33 | +and .csv files. For more information on the methods implemented, see Moore |
| 34 | +(2012) <doi:10.1093/pan/mps025>. |
| 35 | + |
| 36 | +%prep |
| 37 | +%setup -q -c -n %{packname} |
| 38 | + |
| 39 | +# fix end of executable files |
| 40 | +find -type f -executable -exec grep -Iq . {} \; -exec sed -i -e '$a\' {} \; |
| 41 | +# prevent binary stripping |
| 42 | +[ -d %{packname}/src ] && find %{packname}/src -type f -exec \ |
| 43 | + sed -i 's@/usr/bin/strip@/usr/bin/true@g' {} \; || true |
| 44 | +[ -d %{packname}/src ] && find %{packname}/src/Make* -type f -exec \ |
| 45 | + sed -i 's@-g0@@g' {} \; || true |
| 46 | +# don't allow local prefix in executable scripts |
| 47 | +find -type f -executable -exec sed -Ei 's@#!( )*/usr/local/bin@#!/usr/bin@g' {} \; |
| 48 | + |
| 49 | +%build |
| 50 | + |
| 51 | +%install |
| 52 | + |
| 53 | +mkdir -p %{buildroot}%{rlibdir} |
| 54 | +%{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname} |
| 55 | +test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so) |
| 56 | +rm -f %{buildroot}%{rlibdir}/R.css |
| 57 | +# remove buildroot from installed files |
| 58 | +find %{buildroot}%{rlibdir} -type f -exec sed -i "s@%{buildroot}@@g" {} \; |
| 59 | + |
| 60 | +%files |
| 61 | +%{rlibdir}/%{packname} |
0 commit comments