1 |
%define libname %mklibname Rmath |
2 |
# (tpg) really not needed |
3 |
# for private copy in /usr/lib/R/share/perl/Text/DelimMatch.pm |
4 |
%define _provides_exceptions 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::.*\) |
5 |
%define _requires_exceptions libRblas.so\\|libRlapack.so\\|perl\(R::.*\) |
6 |
|
7 |
%define _disable_ld_no_undefined 1 |
8 |
|
9 |
%ifarch %mips %arm |
10 |
%define use_java 0 |
11 |
%else |
12 |
%define use_java 1 |
13 |
%endif |
14 |
|
15 |
Summary: A language for data analysis and graphics |
16 |
Name: R-base |
17 |
Version: 2.13.1 |
18 |
Release: %mkrel 1 |
19 |
License: GPLv2+ |
20 |
Group: Sciences/Mathematics |
21 |
URL: http://www.r-project.org |
22 |
Source0: http://cran.r-project.org/src/base/R-2/R-%{version}.tar.gz |
23 |
Source1: R-icons-png.tar.bz2 |
24 |
Source2: R.bash_completion.bz2 |
25 |
Patch0: R-2.8.1-menu.patch |
26 |
Patch1: R-2.13.0-disable-optimized-BLAS-test.patch |
27 |
Patch2: R-2.8.1-underlinking.patch |
28 |
Patch3: R-2.7.2-CVE-2008-3931.patch |
29 |
Patch5: R-2.10.1-gfxdemos.patch |
30 |
BuildRequires: pth-devel |
31 |
BuildRequires: glibc-static-devel |
32 |
BuildRequires: gcc-c++ |
33 |
BuildRequires: cups-common |
34 |
BuildRequires: bzip2-devel |
35 |
BuildRequires: gcc-gfortran |
36 |
BuildRequires: gpm-devel |
37 |
BuildRequires: ncurses-devel |
38 |
BuildRequires: readline-devel |
39 |
BuildRequires: tk-devel |
40 |
BuildRequires: tcl |
41 |
BuildRequires: tcl-devel |
42 |
BuildRequires: texinfo |
43 |
BuildRequires: tetex-latex |
44 |
BuildRequires: X11-devel |
45 |
BuildRequires: png-devel |
46 |
BuildRequires: jpeg-devel |
47 |
BuildRequires: bison |
48 |
BuildRequires: xdg-utils |
49 |
%if %{use_java} |
50 |
BuildRequires: java-rpmbuild |
51 |
%endif |
52 |
BuildRequires: paper-utils |
53 |
BuildRequires: cairo-devel |
54 |
BuildRequires: pango-devel |
55 |
BuildRequires: libtiff-devel |
56 |
BuildRequires: zip |
57 |
BuildRequires: lapack-devel |
58 |
BuildRequires: blas-devel |
59 |
BuildRequires: gcc-objc |
60 |
BuildRequires: gcc-objc++ |
61 |
BuildRequires: imake |
62 |
BuildRequires: gettext-devel |
63 |
BuildRequires: glibc-static-devel |
64 |
BuildRequires: pth-devel |
65 |
#BuildRequires: gnustep-make |
66 |
#BuildRequires: libgnustep-base-devel |
67 |
#BuildRequires: gnustep-base |
68 |
BuildRequires: lzma-devel |
69 |
BuildRequires: icu-devel |
70 |
BuildRequires: paper-utils |
71 |
Requires: tcl |
72 |
Requires: tk |
73 |
Requires: perl |
74 |
Requires: sed |
75 |
Requires: x11-font-adobe-100dpi |
76 |
Provides: R |
77 |
Obsoletes: R-recommended <= 1.5.1 |
78 |
Provides: R-recommended |
79 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
80 |
|
81 |
%description |
82 |
`GNU S' - A language and environment for statistical computing and |
83 |
graphics. R is similar to the S system, which was developed at Bell |
84 |
Laboratories by John Chambers et al. It provides a wide variety of |
85 |
statistical and graphical techniques (linear and nonlinear modelling, |
86 |
statistical tests, time series analysis, classification, clustering, ...). |
87 |
|
88 |
R is designed as a true computer language with control-flow |
89 |
constructions for iteration and alternation, and it allows users to |
90 |
add additional functionality by defining new functions. For |
91 |
computationally intensive tasks, C, C++ and Fortran code can be linked |
92 |
and called at run time. |
93 |
|
94 |
%package -n %{libname} |
95 |
Summary: Standalone math library from the R project |
96 |
Group: Development/Other |
97 |
|
98 |
%description -n %{libname} |
99 |
A standalone library of mathematical and statistical functions derived |
100 |
from the R project. This packages provides the shared libRmath library. |
101 |
|
102 |
%package -n %{libname}-devel |
103 |
Summary: Standalone math library from the R project |
104 |
Group: Development/Other |
105 |
Provides: libRmath-devel = %{version}-%{release} |
106 |
Requires: %{libname} = %{version}-%{release} |
107 |
|
108 |
%description -n %{libname}-devel |
109 |
A standalone library of mathematical and statistical functions derived |
110 |
from the R project. This packages provides the static libRmath library |
111 |
and header files. |
112 |
|
113 |
%prep |
114 |
%setup -qn R-%{version} |
115 |
%patch0 -p1 |
116 |
%patch1 -p1 |
117 |
#%patch2 -p1 |
118 |
#%patch3 -p1 -b .cve |
119 |
%patch5 -p1 |
120 |
|
121 |
#perl -pi -e "s/firefox/mozilla-firefox/" m4/R.m4 configure |
122 |
#rm -f acinclude.m4 |
123 |
aclocal -I ./m4 |
124 |
autoconf --force |
125 |
#autoreconf -fiv |
126 |
|
127 |
%build |
128 |
export R_BROWSER="$(type -p xdg-open)" |
129 |
export R_PDFVIEWER="$(type -p xdg-open)" |
130 |
export R_PRINTCMD="lpr" |
131 |
#export R_BROWSER="%{_bindir}/mozilla-firefox" |
132 |
|
133 |
# (tpg) do not set R_LIBS #37781 |
134 |
#echo 'R_LIBS=${R_LIBS-'"'%{_libdir}/R/lib'"'}' >> etc/Renviron.in |
135 |
# (tpg) try to not build with -ffast-math |
136 |
export CFLAGS=$(echo "%{optflags}" | sed -e s/-ffast-math/-fno-fast-math/g ) |
137 |
export CFLAGS="%{optflags}" |
138 |
export FFLAGS=$CFLAGS |
139 |
export CXXFLAGS=$CFLAGS |
140 |
export FCFLAGS=$CFLAGS |
141 |
export OBJCFLAGS=$CFLAGS |
142 |
export F77="gfortran" |
143 |
%if %{use_java} |
144 |
export JAVA_HOME="%{java_home}" |
145 |
%endif |
146 |
export FPICFLAGS=-fPIC |
147 |
unset DISPLAY |
148 |
|
149 |
%configure2_5x \ |
150 |
--with-tcltk \ |
151 |
--with-tcl-config=%{_libdir}/tclConfig.sh \ |
152 |
--with-tk-config=%{_libdir}/tkConfig.sh \ |
153 |
--with-cairo \ |
154 |
--with-libpng \ |
155 |
--with-jpeglib \ |
156 |
--with-system-zlib \ |
157 |
--with-system-bzlib \ |
158 |
--with-system-xz \ |
159 |
--with-ICU \ |
160 |
--with-readline \ |
161 |
--disable-BLAS-shlib \ |
162 |
--with-lapack=%{_libdir} \ |
163 |
--with-blas=%{_libdir} \ |
164 |
--enable-threads=pth \ |
165 |
--enable-R-profiling \ |
166 |
--enable-R-shlib |
167 |
|
168 |
%make |
169 |
|
170 |
pushd src/nmath/standalone |
171 |
make |
172 |
popd |
173 |
|
174 |
%make pdf |
175 |
%make info |
176 |
|
177 |
# DON'T comment "make check" below! If R doesn't pass the 'check' test |
178 |
# then it is probably badly compiled, or there are problems with |
179 |
# the compiler. |
180 |
%check |
181 |
make check |
182 |
|
183 |
|
184 |
%install |
185 |
rm -rf %{buildroot} |
186 |
|
187 |
# N.B. don't use %%makeinstall because it sets prefix= which breaks Rscript |
188 |
# mga#1434 |
189 |
%makeinstall_std install-info |
190 |
|
191 |
pushd src/nmath/standalone |
192 |
%makeinstall \ |
193 |
includedir=%{buildroot}%{_includedir} \ |
194 |
libdir=%{buildroot}%{_libdir} |
195 |
popd |
196 |
|
197 |
mv doc/manual/*.pdf $RPM_BUILD_DIR/R-%{version} || : |
198 |
# Add soft links (useful for TK gui) |
199 |
for i in R-admin R-data refman R-exts R-FAQ R-intro R-lang; do |
200 |
ln -s %{_datadir}/doc/R-base/${i}.pdf %{buildroot}%{_libdir}/R/doc/manual/${i}.pdf |
201 |
done |
202 |
|
203 |
# Remove latex versions of help pages |
204 |
# |
205 |
rm -rf %{buildroot}%{_libdir}/R/library/*/latex/ |
206 |
|
207 |
# Get rid of buildroot in script |
208 |
for i in %{buildroot}%{_libdir}/R/bin/R %{buildroot}%{_bindir}/R %{buildroot}%{_libdir}/pkgconfig/libR*.pc; |
209 |
do |
210 |
sed -i "s|%{buildroot}||g" $i; |
211 |
done |
212 |
|
213 |
# Remove package indices. They are rebuilt by the postinstall script. |
214 |
# |
215 |
rm -f %{buildroot}%{_libdir}/R/doc/html/function.html |
216 |
rm -f %{buildroot}%{_libdir}/R/doc/html/packages.html |
217 |
rm -f %{buildroot}%{_libdir}/R/doc/html/search/index.txt |
218 |
|
219 |
# Fix permissions |
220 |
chmod 644 %{buildroot}%{_libdir}/R/library/MASS/scripts/* |
221 |
chmod 755 %{buildroot}%{_libdir}/R/share/sh/echo.sh |
222 |
|
223 |
mkdir -p %{buildroot}%{_datadir}/applications |
224 |
cat > %{buildroot}%{_datadir}/applications/mageia-%{name}.desktop <<EOF |
225 |
[Desktop Entry] |
226 |
Name=R |
227 |
Comment=A language for statistical computing |
228 |
Exec=%{_bindir}/R --gui=tk |
229 |
Terminal=true |
230 |
Type=Application |
231 |
Icon=Rlogo |
232 |
Categories=Science;Math; |
233 |
EOF |
234 |
|
235 |
# icons |
236 |
mkdir -p %{buildroot}%{_iconsdir} |
237 |
tar xjf %{SOURCE1} -C %{buildroot}%{_iconsdir} |
238 |
|
239 |
# remove unpackaged files |
240 |
rm -f %{buildroot}%{_infodir}/dir{,.old*} |
241 |
|
242 |
# remove private perl libraries |
243 |
rm -rf %{buildroot}%{_libdir}/R/share/perl/File |
244 |
rm -rf %{buildroot}%{_libdir}/R/share/perl/Text |
245 |
|
246 |
# (tpg) add bash completion file |
247 |
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d |
248 |
bzcat %{SOURCE2} > %{buildroot}%{_sysconfdir}/bash_completion.d/R-base |
249 |
|
250 |
%find_lang %{name} |
251 |
|
252 |
%clean |
253 |
rm -rf %{buildroot} |
254 |
|
255 |
%post |
256 |
%_install_info R-admin.info |
257 |
%_install_info R-data.info |
258 |
%_install_info R-exts.info |
259 |
%_install_info R-FAQ.info |
260 |
%_install_info R-intro.info |
261 |
%_install_info R-lang.info |
262 |
|
263 |
%preun |
264 |
if [ $1 = 0 ]; then |
265 |
%_remove_install_info R-admin.info |
266 |
%_remove_install_info R-data.info |
267 |
%_remove_install_info R-exts.info |
268 |
%_remove_install_info R-FAQ.info |
269 |
%_remove_install_info R-intro.info |
270 |
%_remove_install_info R-lang.info |
271 |
fi |
272 |
|
273 |
%files -f %{name}.lang |
274 |
%defattr(-,root,root) |
275 |
%doc README VERSION NEWS |
276 |
%doc R-admin.pdf R-data.pdf R-exts.pdf R-FAQ.pdf R-intro.pdf R-lang.pdf refman.pdf |
277 |
%{_sysconfdir}/bash_completion.d/* |
278 |
%{_bindir}/R |
279 |
%{_bindir}/Rscript |
280 |
%{_mandir}/*/* |
281 |
%{_libdir}/R |
282 |
%{_infodir}/*.info* |
283 |
%{_iconsdir}/*.* |
284 |
%{_liconsdir}/*.* |
285 |
%{_miconsdir}/*.* |
286 |
%{_datadir}/applications/*.desktop |
287 |
%{_libdir}/pkgconfig/libR.pc |
288 |
|
289 |
%files -n %{libname} |
290 |
%defattr(-,root,root) |
291 |
%{_libdir}/libRmath.so |
292 |
|
293 |
%files -n %{libname}-devel |
294 |
%defattr(-,root,root) |
295 |
%{_libdir}/libRmath.a |
296 |
%{_includedir}/Rmath.h |
297 |
%{_libdir}/pkgconfig/libRmath.pc |