%global __brp_check_rpaths %{nil} %global __requires_exclude ^libmpi %global packname UniversalCVI %global packver 1.1.2 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 1.1.2 Release: 1%{?dist}%{?buildtag} Summary: Hard and Soft Cluster Validity Indices License: GPL (>= 3) URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz BuildRequires: R-devel >= 2.10 Requires: R-core >= 2.10 BuildArch: noarch BuildRequires: R-CRAN-e1071 BuildRequires: R-CRAN-mclust Requires: R-CRAN-e1071 Requires: R-CRAN-mclust %description Algorithms for checking the accuracy of a clustering result with known classes, computing cluster validity indices, and generating plots for comparing them. The package is compatible with K-means, fuzzy C means, EM clustering, and hierarchical clustering (single, average, and complete linkage). The details of the indices in this package can be found in: C. Alok. (2010) , J. C. Bezdek, M. Moshtaghi, T. Runkler, C. Leckie (2016) , T. Calinski, J. Harabasz (1974) , C. H. Chou, M. C. Su, E. Lai (2004) , D. L. Davies, D. W. Bouldin (1979) , J. C. Dunn (1973) , F. Haouas, Z. Ben Dhiaf, A. Hammouda, B. Solaiman (2017) , M. Kim, R. S. Ramakrishna (2005) , S. H. Kwon (1998) , S. H. Kwon, J. Kim, S. H. Son (2021) , G. W. Miligan (1980) , M. K. Pakhira, S. Bandyopadhyay, U. Maulik (2004) , M. Popescu, J. C. Bezdek, T. C. Havens, J. M. Keller (2013) , S. Saitta, B. Raphael, I. Smith (2007) , A. Starczewski (2017) , Y. Tang, F. Sun, Z. Sun (2005) , N. Wiroonsri (2024) , N. Wiroonsri, O. Preedasawakul (2023) , C. H. Wu, C. S. Ouyang, L. W. Chen, L. W. Lu (2015) and X. Xie, G. Beni (1991) . %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}