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