/[packages]/cauldron/R-base/current/SPECS/R-base.spec
ViewVC logotype

Contents of /cauldron/R-base/current/SPECS/R-base.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30