%global __brp_check_rpaths %{nil} %global __requires_exclude ^libmpi %global packname flexurba %global packver 0.2.2 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 0.2.2 Release: 1%{?dist}%{?buildtag} Summary: Construct Flexible Urban Delineations License: MIT + file LICENSE URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz BuildRequires: R-devel >= 3.5 Requires: R-core >= 3.5 BuildRequires: R-CRAN-terra >= 1.7.3 BuildRequires: R-CRAN-data.table BuildRequires: R-CRAN-dplyr BuildRequires: R-CRAN-exactextractr BuildRequires: R-CRAN-fastmatch BuildRequires: R-CRAN-geos BuildRequires: R-CRAN-ggplot2 BuildRequires: R-CRAN-ggspatial BuildRequires: R-grid BuildRequires: R-CRAN-jsonlite BuildRequires: R-CRAN-lifecycle BuildRequires: R-CRAN-magrittr BuildRequires: R-CRAN-nngeo BuildRequires: R-CRAN-Rcpp BuildRequires: R-CRAN-sf BuildRequires: R-CRAN-tidyterra BuildRequires: R-utils Requires: R-CRAN-terra >= 1.7.3 Requires: R-CRAN-data.table Requires: R-CRAN-dplyr Requires: R-CRAN-exactextractr Requires: R-CRAN-fastmatch Requires: R-CRAN-geos Requires: R-CRAN-ggplot2 Requires: R-CRAN-ggspatial Requires: R-grid Requires: R-CRAN-jsonlite Requires: R-CRAN-lifecycle Requires: R-CRAN-magrittr Requires: R-CRAN-nngeo Requires: R-CRAN-Rcpp Requires: R-CRAN-sf Requires: R-CRAN-tidyterra Requires: R-utils %description Enables the construction of flexible urban delineations that can be tailored to specific applications or research questions, see Van Migerode et al. (2024) and Van Migerode et al. (2025) . Originally developed to flexibly reconstruct the Degree of Urbanisation classification of cities, towns and rural areas developed by Dijkstra et al. (2021) . Now it also support a broader range of delineation approaches, using multiple datasets – including population, built-up area, and night-time light grids – and different thresholding methods. %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}