%global __brp_check_rpaths %{nil} %global packname nnt %global packver 0.1.4 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 0.1.4 Release: 3%{?dist}%{?buildtag} Summary: The Number Needed to Treat (NNT) for Survival Endpoint License: GPL-3 URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz BuildRequires: R-devel >= 3.2.0 Requires: R-core >= 3.2.0 BuildArch: noarch BuildRequires: R-stats BuildRequires: R-survival BuildRequires: R-CRAN-survRM2 Requires: R-stats Requires: R-survival Requires: R-CRAN-survRM2 %description Estimate the NNT using the proposed method in Yang and Yin's paper (2019) , in which the NNT-RMST (number needed to treat based on the restricted mean survival time) is defined as the RMST (restricted mean survival time) in the control group divided by the difference in RMSTs between the treatment and control groups up to a chosen time t. %prep %setup -q -c -n %{packname} find -type f -executable -exec grep -Iq . {} \; -exec sed -i -e '$a\' {} \; %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 %files %{rlibdir}/%{packname}