1 |
%define libname %mklibname Rmath |
2 |
|
3 |
# Don't mangle shebangs in %{_libdir}/R/bin |
4 |
%define __brp_mangle_shebangs %{_bindir}/true |
5 |
|
6 |
# (tpg) really not needed |
7 |
# for private copy in /usr/lib/R/share/perl/Text/DelimMatch.pm |
8 |
%global __provides_exclude KernSmooth.so|MASS.so|R_X11.so|class.so|cluster.so|foreign.so|grDevices.so|grid.so|internet.so|lapack.so|lattice.so|libRblas.so|libRlapack.so|methods.so|mgcv.so|nlme.so|nnet.so|rpart.so|spatial.so|splines.so|stats.so|survival.so|tcltk.so|tools.so|vfonts.so|perl\\\(R::.*\\\) |
9 |
%global __requires_exclude libRblas.so|libRlapack.so|perl\\\(R::.*\\\) |
10 |
|
11 |
%define _disable_ld_no_undefined 1 |
12 |
|
13 |
%bcond_without tcltk |
14 |
|
15 |
%ifarch %mips |
16 |
%define use_java 0 |
17 |
%else |
18 |
%define use_java 1 |
19 |
%endif |
20 |
|
21 |
Summary: A language for data analysis and graphics |
22 |
Name: R-base |
23 |
Version: 4.3.2 |
24 |
Release: %mkrel 1 |
25 |
License: GPLv2+ |
26 |
Group: Sciences/Mathematics |
27 |
URL: https://www.r-project.org |
28 |
Source0: https://cran.r-project.org/src/base/R-4/R-%{version}.tar.gz |
29 |
Source1: https://www.r-project.org/logo/Rlogo.png#/Rlogo-%{version}.png |
30 |
Source2: https://www.r-project.org/logo/Rlogo.svg#/Rlogo-%{version}.svg |
31 |
Source3: R.bash_completion |
32 |
Patch0: R-2.15.3-menu.patch |
33 |
|
34 |
BuildRequires: bison |
35 |
BuildRequires: pkgconfig(blas) |
36 |
BuildRequires: pkgconfig(bzip2) |
37 |
BuildRequires: cups-common |
38 |
BuildRequires: gcc |
39 |
BuildRequires: gcc-c++ |
40 |
BuildRequires: gcc-gfortran |
41 |
BuildRequires: gcc-objc |
42 |
BuildRequires: gcc-objc++ |
43 |
BuildRequires: gettext-devel |
44 |
BuildRequires: glibc-devel |
45 |
BuildRequires: gpm-devel |
46 |
BuildRequires: icu-devel |
47 |
BuildRequires: imagemagick |
48 |
BuildRequires: imake |
49 |
BuildRequires: pkgconfig(libjpeg) |
50 |
BuildRequires: lapack-devel |
51 |
BuildRequires: paper-utils |
52 |
BuildRequires: pkgconfig(cairo) |
53 |
BuildRequires: pkgconfig(libcurl) |
54 |
BuildRequires: pkgconfig(liblzma) |
55 |
BuildRequires: pkgconfig(libpcre2-8) |
56 |
BuildRequires: pkgconfig(libpng) |
57 |
BuildRequires: pkgconfig(libtiff-4) |
58 |
BuildRequires: pkgconfig(ncurses) |
59 |
BuildRequires: pkgconfig(pango) |
60 |
BuildRequires: pkgconfig(tre) |
61 |
BuildRequires: pkgconfig(x11) |
62 |
BuildRequires: pkgconfig(xmu) |
63 |
BuildRequires: pkgconfig(xt) |
64 |
%ifnarch %arm aarch64 |
65 |
BuildRequires: quadmath-devel |
66 |
%endif |
67 |
BuildRequires: pkgconfig(readline) |
68 |
BuildRequires: texinfo |
69 |
BuildRequires: texinfo-tex |
70 |
BuildRequires: texlive |
71 |
BuildRequires: texlive-fontsextra |
72 |
BuildRequires: xdg-utils |
73 |
BuildRequires: zip |
74 |
%if %{use_java} |
75 |
BuildRequires: java-devel |
76 |
%endif |
77 |
%if %{with tcltk} |
78 |
BuildRequires: tcl |
79 |
BuildRequires: pkgconfig(tcl) |
80 |
BuildRequires: pkgconfig(tk) |
81 |
Requires: tcl |
82 |
Requires: tk |
83 |
Requires: x11-font-adobe-100dpi |
84 |
%endif |
85 |
|
86 |
Provides: R = %{version} |
87 |
Provides: R-recommended = %{version} |
88 |
Requires: perl |
89 |
Requires: sed |
90 |
|
91 |
# needed in order to test setlocale in make check |
92 |
BuildRequires: locales-en |
93 |
Provides: R(methods) = %{version} |
94 |
Provides: R(utils) = %{version} |
95 |
Provides: R(base) = %{version} |
96 |
Provides: R(class) = %{version} |
97 |
Provides: R(tools) = %{version} |
98 |
Provides: R-core = %{version} |
99 |
Provides: R(ABI) = 4.1 |
100 |
|
101 |
%description |
102 |
`GNU S' - A language and environment for statistical computing and |
103 |
graphics. R is similar to the S system, which was developed at Bell |
104 |
Laboratories by John Chambers et al. It provides a wide variety of |
105 |
statistical and graphical techniques (linear and nonlinear modelling, |
106 |
statistical tests, time series analysis, classification, clustering, ...). |
107 |
|
108 |
R is designed as a true computer language with control-flow |
109 |
constructions for iteration and alternation, and it allows users to |
110 |
add additional functionality by defining new functions. For |
111 |
computationally intensive tasks, C, C++ and Fortran code can be linked |
112 |
and called at run time. |
113 |
|
114 |
%package -n %{libname} |
115 |
Summary: Standalone math library from the R project |
116 |
Group: Development/Other |
117 |
|
118 |
%description -n %{libname} |
119 |
A standalone library of mathematical and statistical functions derived |
120 |
from the R project. This packages provides the shared libRmath library. |
121 |
|
122 |
%package -n %{libname}-devel |
123 |
Summary: Standalone math library from the R project |
124 |
Group: Development/Other |
125 |
Provides: libRmath-devel = %{version}-%{release} |
126 |
Requires: %{libname} = %{version}-%{release} |
127 |
|
128 |
%description -n %{libname}-devel |
129 |
A standalone library of mathematical and statistical functions derived |
130 |
from the R project. This packages provides the static libRmath library |
131 |
and header files. |
132 |
|
133 |
%prep |
134 |
%autosetup -p1 -n R-%{version} |
135 |
|
136 |
%build |
137 |
|
138 |
export R_BROWSER="$(type -p xdg-open)" |
139 |
export R_PDFVIEWER="$(type -p xdg-open)" |
140 |
export R_PRINTCMD="lpr" |
141 |
|
142 |
# (tpg) try to not build with -ffast-math |
143 |
export CFLAGS=$(echo "%{optflags}" | sed -e s/-ffast-math/-fno-fast-math/g ) |
144 |
export CFLAGS="%{optflags}" |
145 |
export FFLAGS=$CFLAGS |
146 |
export CXXFLAGS=$CFLAGS |
147 |
export FCFLAGS=$CFLAGS |
148 |
export OBJCFLAGS=$CFLAGS |
149 |
export F77="gfortran" |
150 |
%if %{use_java} |
151 |
export JAVA_HOME="%{java_home}" |
152 |
%endif |
153 |
export FPICFLAGS=-fPIC |
154 |
export CPICFLAGS=-fPIC |
155 |
unset DISPLAY |
156 |
|
157 |
# Turn off enable-lto. |
158 |
# lto requires that the flags for static libraries be |
159 |
# set specifically, and this causes link errors with CRAN |
160 |
# packages. |
161 |
# |
162 |
# See bug #13528 for where this can fail |
163 |
|
164 |
# the regression tests will fail with an external Lapack |
165 |
# 3.9.0 unless it has this fix is put into the lapack. |
166 |
|
167 |
# https://github.com/Reference-LAPACK/lapack/pull/390 |
168 |
# https://github.com/xianyi/OpenBLAS/pull/2442 |
169 |
|
170 |
%configure \ |
171 |
%if %{with tcltk} |
172 |
--with-tcltk \ |
173 |
--with-tcl-config=%{_libdir}/tclConfig.sh \ |
174 |
--with-tk-config=%{_libdir}/tkConfig.sh \ |
175 |
%else |
176 |
--without-tcltk \ |
177 |
%endif |
178 |
--with-cairo \ |
179 |
--with-libpng \ |
180 |
--with-jpeglib \ |
181 |
--with-pcre2 \ |
182 |
--with-system-tre \ |
183 |
--with-ICU \ |
184 |
--with-readline \ |
185 |
--disable-BLAS-shlib \ |
186 |
--with-lapack \ |
187 |
--with-blas \ |
188 |
--enable-threads=pth \ |
189 |
--enable-R-profiling \ |
190 |
--enable-R-shlib \ |
191 |
--disable-lto |
192 |
|
193 |
%make_build |
194 |
|
195 |
pushd src/nmath/standalone |
196 |
%make_build |
197 |
popd |
198 |
|
199 |
%make_build pdf |
200 |
%make_build info |
201 |
|
202 |
# DON'T comment "make check" below! If R doesn't pass the 'check' test |
203 |
# then it is probably badly compiled, or there are problems with |
204 |
# the compiler. |
205 |
# |
206 |
%check |
207 |
%ifarch armv7hl %{ix86} |
208 |
TZ=UTC LC_ALL=UTF-8 make check || (find -name "*.fail" | xargs cat) |
209 |
%else |
210 |
TZ=UTC LC_ALL=UTF-8 make check || (find -name "*.fail" | xargs cat ; exit 1) |
211 |
%endif |
212 |
|
213 |
%install |
214 |
# N.B. don't use %%makeinstall because it sets prefix= which breaks Rscript |
215 |
# mga#1434 |
216 |
%make_install install-info |
217 |
|
218 |
pushd src/nmath/standalone |
219 |
%makeinstall \ |
220 |
includedir=%{buildroot}%{_includedir} \ |
221 |
libdir=%{buildroot}%{_libdir} |
222 |
popd |
223 |
|
224 |
mv doc/manual/*.pdf %{_builddir}/%{?buildsubdir} || : |
225 |
# Add soft links (useful for TK gui) |
226 |
for i in R-admin R-data refman R-exts R-FAQ R-intro R-lang; do |
227 |
ln -s %{_datadir}/doc/R-base/${i}.pdf %{buildroot}%{_libdir}/R/doc/manual/${i}.pdf |
228 |
done |
229 |
|
230 |
# Remove latex versions of help pages |
231 |
# |
232 |
rm -rf %{buildroot}%{_libdir}/R/library/*/latex/ |
233 |
|
234 |
# Get rid of buildroot in script |
235 |
for i in %{buildroot}%{_libdir}/R/bin/R %{buildroot}%{_bindir}/R %{buildroot}%{_libdir}/pkgconfig/libR*.pc; |
236 |
do |
237 |
sed -i "s|%{buildroot}||g" $i; |
238 |
done |
239 |
|
240 |
# Remove package indices. They are rebuilt by the postinstall script. |
241 |
# |
242 |
rm -f %{buildroot}%{_libdir}/R/doc/html/function.html |
243 |
rm -f %{buildroot}%{_libdir}/R/doc/html/packages.html |
244 |
rm -f %{buildroot}%{_libdir}/R/doc/html/search/index.txt |
245 |
|
246 |
# Fix permissions |
247 |
chmod 644 %{buildroot}%{_libdir}/R/library/MASS/scripts/* |
248 |
chmod 755 %{buildroot}%{_libdir}/R/share/sh/echo.sh |
249 |
|
250 |
%if %{with tcltk} |
251 |
# .desktop |
252 |
mkdir -p %{buildroot}%{_datadir}/applications |
253 |
cat > %{buildroot}%{_datadir}/applications/mageia-%{name}.desktop <<EOF |
254 |
[Desktop Entry] |
255 |
Name=R |
256 |
GenericName=GNU R language |
257 |
GenericName[ru]=Язык GNU R |
258 |
Comment=A language for statistical computing |
259 |
Comment[ar]=لغة للحساب الإحصائي |
260 |
Comment[bg]=Език за статистичеки изчисления |
261 |
Comment[cs]=Jazyk pro statistické výpočty |
262 |
Comment[cy]=Iaith cyfrifiadura ystadegol |
263 |
Comment[da]=Et sprog for statistisk beregning |
264 |
Comment[el]=Μια γλώσσα για στατιστικούς υπολογισμούς |
265 |
Comment[es]=R - un lenguaje para la computación estadística |
266 |
Comment[et]=Statistiliste arvutusmeetodite keel |
267 |
Comment[eu]=Konputazio estatistikoarentzako hizkuntza |
268 |
Comment[fi]=Ohjelmointikieli tilastojen laskentaan |
269 |
Comment[fr]=Un langage pour les calculs statistiques |
270 |
Comment[gl]=Unha linguaxe para o cálculo estatístico |
271 |
Comment[he]=שפה לחישוב סטטיסטי |
272 |
Comment[hu]=Nyelv statisztikai programozáshoz |
273 |
Comment[is]=Forritunarmál til tölfræðireikninga |
274 |
Comment[it]=R, un linguaggio per elaborazioni statistiche |
275 |
Comment[ky]=R - статистикалык эсептөө тили |
276 |
Comment[nb]=Et program for statistisk beregning |
277 |
Comment[nl]=Een taal voor statistische berekeningen |
278 |
Comment[nn]=Statistiske utrekningar og simuleringar |
279 |
Comment[pl]=Język służący do obliczeń statystycznych |
280 |
Comment[pt]=Uma linguagem para computação estatística |
281 |
Comment[pt_BR]=Uma linguagem para cálculos estatísticos |
282 |
Comment[ro]=Un limbaj pentru calcul statistic |
283 |
Comment[ru]=R - язык статистических вычислений |
284 |
Comment[sl]=Jezik za statistično računanje |
285 |
Comment[sv]=Ett språk för statistisk databehandling |
286 |
Comment[tr]=İstatiksel hesaplamalar için dil |
287 |
Comment[uk]=Мова для статистичних розрахунків |
288 |
Comment[zh_CN]=一种统计计算语言 |
289 |
Comment[zh_TW]=一種用於統計學計算的語言 |
290 |
Exec=%{_bindir}/R --gui=tk |
291 |
Terminal=true |
292 |
Type=Application |
293 |
Icon=Rlogo |
294 |
Categories=Science;Math; |
295 |
EOF |
296 |
|
297 |
# icons |
298 |
for S in 16 22 24 32 48 64 96 128 192 256 512; do |
299 |
%__install -d -m755 %{buildroot}%{_iconsdir}/hicolor/$S\x$S/apps |
300 |
convert -scale $S\x$S %{SOURCE1} %{buildroot}%{_iconsdir}/hicolor/$S\x$S/apps/Rlogo.png |
301 |
done |
302 |
%__install -d -m755 %{buildroot}%{_iconsdir}/hicolor/scalable/apps |
303 |
%__install -m644 %{SOURCE2} %{buildroot}%{_iconsdir}/hicolor/scalable/apps/Rlogo.svg |
304 |
%endif |
305 |
|
306 |
# remove unpackaged files |
307 |
rm -f %{buildroot}%{_infodir}/dir{,.old*} |
308 |
|
309 |
# remove private perl libraries |
310 |
rm -rf %{buildroot}%{_libdir}/R/share/perl/File |
311 |
rm -rf %{buildroot}%{_libdir}/R/share/perl/Text |
312 |
|
313 |
# (tpg) add bash completion file |
314 |
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d |
315 |
cp %{SOURCE3} %{buildroot}%{_sysconfdir}/bash_completion.d/R-base |
316 |
|
317 |
|
318 |
%files |
319 |
%doc README VERSION |
320 |
%doc R-admin.pdf R-data.pdf R-exts.pdf R-FAQ.pdf R-intro.pdf R-lang.pdf |
321 |
%{_bindir}/R |
322 |
%{_bindir}/Rscript |
323 |
%{_libdir}/R/bin |
324 |
%{_libdir}/R/doc |
325 |
%{_libdir}/R/etc |
326 |
%{_libdir}/R/include |
327 |
%{_libdir}/R/lib |
328 |
%{_libdir}/R/modules |
329 |
%{_libdir}/R/share |
330 |
%dir %{_libdir}/R/library |
331 |
%{_libdir}/R/library/KernSmooth |
332 |
%{_libdir}/R/library/MASS |
333 |
%{_libdir}/R/library/Matrix |
334 |
%{_libdir}/R/library/base |
335 |
%{_libdir}/R/library/boot |
336 |
%{_libdir}/R/library/class |
337 |
%{_libdir}/R/library/cluster |
338 |
%{_libdir}/R/library/codetools |
339 |
%{_libdir}/R/library/compiler |
340 |
%{_libdir}/R/library/datasets |
341 |
%{_libdir}/R/library/foreign |
342 |
%{_libdir}/R/library/grDevices |
343 |
%{_libdir}/R/library/graphics |
344 |
%{_libdir}/R/library/grid |
345 |
%{_libdir}/R/library/lattice |
346 |
%{_libdir}/R/library/methods |
347 |
%{_libdir}/R/library/mgcv |
348 |
%{_libdir}/R/library/nlme |
349 |
%{_libdir}/R/library/nnet |
350 |
%{_libdir}/R/library/parallel |
351 |
%{_libdir}/R/library/rpart |
352 |
%{_libdir}/R/library/spatial |
353 |
%{_libdir}/R/library/splines |
354 |
%{_libdir}/R/library/stats |
355 |
%{_libdir}/R/library/stats4 |
356 |
%{_libdir}/R/library/survival |
357 |
%{_libdir}/R/library/tcltk |
358 |
%{_libdir}/R/library/tools |
359 |
%{_libdir}/R/library/utils |
360 |
%dir %{_libdir}/R/library/translations/ |
361 |
%{_libdir}/R/library/translations/DESCRIPTION |
362 |
%lang(da) %{_libdir}/R/library/translations/da/ |
363 |
%lang(de) %{_libdir}/R/library/translations/de/ |
364 |
%lang(en) %{_libdir}/R/library/translations/en*/ |
365 |
%lang(es) %{_libdir}/R/library/translations/es/ |
366 |
%lang(fa) %{_libdir}/R/library/translations/fa/ |
367 |
%lang(fr) %{_libdir}/R/library/translations/fr/ |
368 |
%lang(it) %{_libdir}/R/library/translations/it/ |
369 |
%lang(ja) %{_libdir}/R/library/translations/ja/ |
370 |
%lang(ko) %{_libdir}/R/library/translations/ko/ |
371 |
%lang(lt) %{_libdir}/R/library/translations/lt/ |
372 |
%lang(nn) %{_libdir}/R/library/translations/nn/ |
373 |
%lang(pl) %{_libdir}/R/library/translations/pl/ |
374 |
%lang(pt_BR) %{_libdir}/R/library/translations/pt_BR/ |
375 |
%lang(ru) %{_libdir}/R/library/translations/ru/ |
376 |
%lang(tr) %{_libdir}/R/library/translations/tr/ |
377 |
%lang(zh_CN) %{_libdir}/R/library/translations/zh_CN/ |
378 |
%lang(zh_TW) %{_libdir}/R/library/translations/zh_TW/ |
379 |
%{_infodir}/*.info* |
380 |
%{_libdir}/R/COPYING |
381 |
%{_libdir}/R/SVN-REVISION |
382 |
%{_libdir}/pkgconfig/libR.pc |
383 |
%{_mandir}/*/* |
384 |
%{_sysconfdir}/bash_completion.d/* |
385 |
%if %{with tcltk} |
386 |
%{_datadir}/applications/*.desktop |
387 |
%_iconsdir/hicolor/*/apps/Rlogo.png |
388 |
%_iconsdir/hicolor/scalable/apps/Rlogo.svg |
389 |
%endif |
390 |
|
391 |
%files -n %{libname} |
392 |
%{_libdir}/libRmath.so |
393 |
|
394 |
%files -n %{libname}-devel |
395 |
%{_libdir}/libRmath.a |
396 |
%{_includedir}/Rmath.h |
397 |
%{_libdir}/pkgconfig/libRmath.pc |