File R-sbw.spec of Package R-sbw
# Automatically generated by CRAN2OBS
#
# Spec file for package sbw
# This file is auto-generated using information in the package source,
# esp. Description and Summary. Improvements in that area should be
# discussed with upstream.
#
# Copyright (c) 2025 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%global packname sbw
%global rlibdir %{_libdir}/R/library
Name: R-%{packname}
Version: 1.2
Release: 0
Summary: Stable Balancing Weights for Causal Inference and Missing Data
Group: Development/Libraries/Other
License: GPL-2 | GPL-3
URL: http://cran.r-project.org/web/packages/%{packname}
Source: sbw_1.2.tar.gz
Requires: R-base
Requires: R-quadprog
Requires: R-slam
Requires: R-spatstat.univar
Requires: R-spatstat.utils
# %%if 0%%{?sle_version} > 120400 || 0%%{?is_opensuse}
# # Three others commonly needed
# BuildRequires: tex(ae.sty)
# BuildRequires: tex(fancyvrb.sty)
# BuildRequires: tex(inconsolata.sty)
# BuildRequires: tex(natbib.sty)
# %else
# BuildRequires: texlive
# %endif
# BuildRequires: texinfo
BuildRequires: fdupes
BuildRequires: R-base
BuildRequires: R-quadprog
BuildRequires: R-slam
BuildRequires: R-spatstat.univar
BuildRequires: R-spatstat.utils
Suggests: R-knitr
Suggests: R-rmarkdown
%description
Implements the Stable Balancing Weights by Zubizarreta (2015)
<DOI:10.1080/01621459.2015.1023805>. These are the weights of minimum
variance that approximately balance the empirical distribution of the
observed covariates. For an overview, see Chattopadhyay, Hase and
Zubizarreta (2020) <DOI:10.1002/sim.8659>. To solve the optimization
problem in 'sbw', the default solver is 'quadprog', which is readily
available through CRAN. The solver 'osqp' is also posted on CRAN. To
enhance the performance of 'sbw', users are encouraged to install other
solvers such as 'gurobi' and 'Rmosek', which require special
installation. For the installation of gurobi and pogs, please follow
the instructions at
<https://docs.gurobi.com/projects/optimizer/en/current/reference/r.html>
and <http://foges.github.io/pogs/stp/r>.
%prep
%setup -q -c -n %{packname}
# the next line is needed, because we build without --clean in between two packages
rm -rf ~/.R
%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
%fdupes -s %{buildroot}%{rlibdir}
#%%check
#%%{_bindir}/R CMD check %%{packname}
%files
%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/DESCRIPTION
%{rlibdir}/%{packname}/INDEX
%{rlibdir}/%{packname}/Meta
%{rlibdir}/%{packname}/NAMESPACE
%{rlibdir}/%{packname}/R
%{rlibdir}/%{packname}/data
%doc %{rlibdir}/%{packname}/help
%doc %{rlibdir}/%{packname}/html
%changelog