%global __brp_check_rpaths %{nil}
%global packname  semds
%global packver   0.9-6
%global rlibdir   /usr/local/lib/R/library

Name:             R-CRAN-%{packname}
Version:          0.9.6
Release:          3%{?dist}%{?buildtag}
Summary:          Structural Equation Multidimensional Scaling

License:          GPL (>= 2)
URL:              https://cran.r-project.org/package=%{packname}
Source0:          %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz


BuildRequires:    R-devel >= 3.0.0
Requires:         R-core >= 3.0.0
BuildArch:        noarch
BuildRequires:    R-graphics 
BuildRequires:    R-stats 
BuildRequires:    R-CRAN-pracma 
BuildRequires:    R-CRAN-minpack.lm 
Requires:         R-graphics 
Requires:         R-stats 
Requires:         R-CRAN-pracma 
Requires:         R-CRAN-minpack.lm 

%description
Fits a structural equation multidimensional scaling (SEMDS) model for
asymmetric and three-way input dissimilarities. It assumes that the
dissimilarities are measured with errors. The latent dissimilarities are
estimated as factor scores within an SEM framework while the objects are
represented in a low-dimensional space as in MDS.

%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}