/[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 33474 - (show annotations) (download)
Sun Jan 23 00:36:02 2011 UTC (13 years, 2 months ago) by ahmad
File size: 8638 byte(s)
- drop old/unneeded scriptlets
- rename .desktop file

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 4
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 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 #%patch2 -p1
117 #%patch3 -p1 -b .cve
118 %patch5 -p1
119
120 #perl -pi -e "s/firefox/mozilla-firefox/" m4/R.m4 configure
121 #rm -f acinclude.m4
122 aclocal -I ./m4
123 autoconf --force
124 #autoreconf -fiv
125
126 %build
127 export R_BROWSER="$(type -p xdg-open)"
128 export R_PDFVIEWER="$(type -p xdg-open)"
129 export R_PRINTCMD="lpr"
130 #export R_BROWSER="%{_bindir}/mozilla-firefox"
131
132 # (tpg) do not set R_LIBS #37781
133 #echo 'R_LIBS=${R_LIBS-'"'%{_libdir}/R/lib'"'}' >> etc/Renviron.in
134 # (tpg) try to not build with -ffast-math
135 export CFLAGS=$(echo "%{optflags}" | sed -e s/-ffast-math/-fno-fast-math/g )
136 export CFLAGS="%{optflags}"
137 export FFLAGS=$CFLAGS
138 export CXXFLAGS=$CFLAGS
139 export FCFLAGS=$CFLAGS
140 export OBJCFLAGS=$CFLAGS
141 export F77="gfortran"
142 %if %{use_java}
143 export JAVA_HOME="%{java_home}"
144 %endif
145 export FPICFLAGS=-fPIC
146 unset DISPLAY
147
148 %configure2_5x \
149 --with-tcltk \
150 --with-tcl-config=%{_libdir}/tclConfig.sh \
151 --with-tk-config=%{_libdir}/tkConfig.sh \
152 --with-cairo \
153 --with-libpng \
154 --with-jpeglib \
155 --with-system-zlib \
156 --with-system-bzlib \
157 --with-system-pcre \
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 # (tpg) somehow --prefix is not honored
169 sed -i -e 's#/usr/local#%{_prefix}#g' Makeconf
170
171 %make
172
173 pushd src/nmath/standalone
174 make
175 popd
176
177 %make pdf
178 %make info
179
180 # DON'T comment "make check" below! If R doesn't pass the 'check' test
181 # then it is probably badly compiled, or there are problems with
182 # the compiler.
183
184 # (tpg) disable for now checks for ix86, because they fails only in iurt!
185 #%ifarch %{ix86}
186 #%check
187 #make check
188 #%endif
189
190 %install
191 rm -rf %{buildroot}
192
193 # (tpg) makeinstall_std is broken here
194 %makeinstall install-info rhome=%{buildroot}%{_libdir}/R
195
196 pushd src/nmath/standalone
197 %makeinstall \
198 includedir=%{buildroot}%{_includedir} \
199 libdir=%{buildroot}%{_libdir}
200 popd
201
202 mv doc/manual/*.pdf $RPM_BUILD_DIR/R-%{version} || :
203 # Add soft links (useful for TK gui)
204 for i in R-admin R-data refman R-exts R-FAQ R-intro R-lang; do
205 ln -s %{_datadir}/doc/R-base/${i}.pdf %{buildroot}%{_libdir}/R/doc/manual/${i}.pdf
206 done
207
208 # Remove latex versions of help pages
209 #
210 rm -rf %{buildroot}%{_libdir}/R/library/*/latex/
211
212 # Get rid of buildroot in script
213 for i in %{buildroot}%{_libdir}/R/bin/R %{buildroot}%{_bindir}/R %{buildroot}%{_libdir}/pkgconfig/libR*.pc;
214 do
215 sed -i "s|%{buildroot}||g" $i;
216 done
217
218 # Remove package indices. They are rebuilt by the postinstall script.
219 #
220 rm -f %{buildroot}%{_libdir}/R/doc/html/function.html
221 rm -f %{buildroot}%{_libdir}/R/doc/html/packages.html
222 rm -f %{buildroot}%{_libdir}/R/doc/html/search/index.txt
223
224 # Fix permissions
225 chmod 644 %{buildroot}%{_libdir}/R/library/MASS/scripts/*
226 chmod 755 %{buildroot}%{_libdir}/R/share/sh/echo.sh
227
228 mkdir -p %{buildroot}%{_datadir}/applications
229 cat > %{buildroot}%{_datadir}/applications/mageia-%{name}.desktop <<EOF
230 [Desktop Entry]
231 Name=R
232 Comment=A language for statistical computing
233 Exec=%{_bindir}/R --gui=tk
234 Terminal=true
235 Type=Application
236 Icon=Rlogo
237 Categories=Science;Math;
238 EOF
239
240 # icons
241 mkdir -p %{buildroot}%{_iconsdir}
242 tar xjf %{SOURCE1} -C %{buildroot}%{_iconsdir}
243
244 # remove unpackaged files
245 rm -f %{buildroot}%{_infodir}/dir{,.old*}
246
247 # remove private perl libraries
248 rm -rf %{buildroot}%{_libdir}/R/share/perl/File
249 rm -rf %{buildroot}%{_libdir}/R/share/perl/Text
250
251 # (tpg) add bash completion file
252 mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
253 bzcat %{SOURCE2} > %{buildroot}%{_sysconfdir}/bash_completion.d/R-base
254
255 %find_lang %{name}
256
257 %clean
258 rm -rf %{buildroot}
259
260 %post
261 %_install_info R-admin.info
262 %_install_info R-data.info
263 %_install_info R-exts.info
264 %_install_info R-FAQ.info
265 %_install_info R-intro.info
266 %_install_info R-lang.info
267 %{_bindir}/R CMD perl %{_libdir}/R/share/perl/build-help.pl --htmllist > /dev/null 2>&1
268 cat %{_libdir}/R/library/*/CONTENTS > %{_libdir}/R/doc/html/search/index.txt 2>/dev/null || :
269
270 %preun
271 if [ $1 = 0 ]; then
272 rm -f %{_libdir}/R/doc/html/function.html \
273 %{_libdir}/R/doc/html/packages.html \
274 %{_libdir}/R/doc/html/search/index.txt
275 %_remove_install_info R-admin.info
276 %_remove_install_info R-data.info
277 %_remove_install_info R-exts.info
278 %_remove_install_info R-FAQ.info
279 %_remove_install_info R-intro.info
280 %_remove_install_info R-lang.info
281 fi
282
283 %files -f %{name}.lang
284 %defattr(-,root,root)
285 %doc README VERSION NEWS
286 %doc R-admin.pdf R-data.pdf R-exts.pdf R-FAQ.pdf R-intro.pdf R-lang.pdf refman.pdf
287 %{_sysconfdir}/bash_completion.d/*
288 %{_bindir}/R
289 %{_bindir}/Rscript
290 %{_mandir}/*/*
291 %{_libdir}/R
292 %{_infodir}/*.info*
293 %{_iconsdir}/*.*
294 %{_liconsdir}/*.*
295 %{_miconsdir}/*.*
296 %{_datadir}/applications/*.desktop
297 %{_libdir}/pkgconfig/libR.pc
298
299 %files -n %{libname}
300 %defattr(-,root,root)
301 %{_libdir}/libRmath.so
302
303 %files -n %{libname}-devel
304 %defattr(-,root,root)
305 %{_libdir}/libRmath.a
306 %{_includedir}/Rmath.h
307 %{_libdir}/pkgconfig/libRmath.pc
308
309

  ViewVC Help
Powered by ViewVC 1.1.30