%global __brp_check_rpaths %{nil} %global __requires_exclude ^libmpi %global packname grouprar %global packver 0.2.0 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 0.2.0 Release: 1%{?dist}%{?buildtag} Summary: Group Response Adaptive Randomization for Clinical Trials License: GPL (>= 2) URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz BuildRequires: R-devel >= 3.6.0 Requires: R-core >= 3.6.0 BuildArch: noarch BuildRequires: R-CRAN-extraDistr BuildRequires: R-stats Requires: R-CRAN-extraDistr Requires: R-stats %description Implements group response-adaptive randomization procedures, which include standard (non-group) response-adaptive randomization methods as special cases. The package also handles delayed and missing responses, which broadens its use in real-world trials. It offers functions for simulating a variety of response-adaptive randomization procedures, to help guide the choice of design for a clinical trial, including the doubly adaptive biased coin design and the multi-arm efficient randomized adaptive design (ERADE), k-arm optimal target allocations, group sequential monitoring, and a function that computes allocation probabilities for an ongoing trial. For details of the methods and algorithms, see the following references: Wei, L. J. (1979) ; Wei, L. J. and Durham, S. (1978) ; Durham, S. D., Flournoy, N. and Li, W. (1998) ; Ivanova, A., Rosenberger, W. F., Durham, S. D. and Flournoy, N. (2000) ; Bai, Z. D., Hu, F. and Shen, L. (2002) ; Ivanova, A. (2003) ; Hu, F. and Zhang, L. X. (2004) ; Hu, F. and Rosenberger, W. F. (2006, ISBN:978-0-471-65396-7); Zhang, L. X., Chan, W. S., Cheung, S. H. and Hu, F. (2007) ; Zhang, L. and Rosenberger, W. F. (2006) ; Hu, F., Zhang, L. X., Cheung, S. H. and Chan, W. S. (2008) ; Tymofyeyev, Y., Rosenberger, W. F. and Hu, F. (2007) ; Hu, F., Zhang, L. X. and He, X. (2009) ; Zhu, H. and Hu, F. (2010) ; Zhai, G., Li, Y., Zhang, L. and Hu, F. (2024) ; Alkhnefr, N., Hu, F. and Zhai, G. (2025) . %prep %setup -q -c -n %{packname} # fix end of executable files find -type f -executable -exec grep -Iq . {} \; -exec sed -i -e '$a\' {} \; # prevent binary stripping [ -d %{packname}/src ] && find %{packname}/src -type f -exec \ sed -i 's@/usr/bin/strip@/usr/bin/true@g' {} \; || true [ -d %{packname}/src ] && find %{packname}/src/Make* -type f -exec \ sed -i 's@-g0@@g' {} \; || true # don't allow local prefix in executable scripts find -type f -executable -exec sed -Ei 's@#!( )*/usr/local/bin@#!/usr/bin@g' {} \; %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 # remove buildroot from installed files find %{buildroot}%{rlibdir} -type f -exec sed -i "s@%{buildroot}@@g" {} \; %files %{rlibdir}/%{packname}