]> git.pld-linux.org Git - packages/R.git/blob - R.spec
208937cee9c1fddcf9260985263b6f433e511d26
[packages/R.git] / R.spec
1 #
2 # Conditional build
3 %bcond_without  tcl             # disable tcl support
4 %bcond_without  tests   # do not run "make check"
5 %bcond_without  docs    # do not build documentation
6 #
7 # NOTE:
8 # - /etc/localtime must be present for tests to work
9 #
10 # TODO:
11 # - script for rpm to autoprovides/autorequires R internals
12 #
13 %include        /usr/lib/rpm/macros.perl
14 Summary:        A language for data analysis and graphics
15 Summary(pl.UTF-8):      Język do analizy danych oraz grafiki
16 Name:           R
17 Version:        2.15.1
18 Release:        5.1
19 License:        Mixed (distributable), mostly GPL v2+
20 Group:          Development/Languages
21 # CRAN master site: ftp://cran.r-project.org/pub/R/src/
22 Source0:        ftp://stat.ethz.ch/R-CRAN/src/base/R-2/%{name}-%{version}.tar.gz
23 # Source0-md5:  fcdf247e707fdade82b78bcf911a54f1
24 Source1:        %{name}.desktop
25 Source2:        %{name}.xpm
26 URL:            http://www.r-project.org/
27 BuildRequires:  autoconf >= 2.62
28 BuildRequires:  automake
29 BuildRequires:  blas-devel >= 3.2.2-2
30 BuildRequires:  bzip2-devel >= 1.0.6
31 BuildRequires:  cairo-devel >= 1.6
32 BuildRequires:  gcc-fortran
33 BuildRequires:  gettext-devel >= 0.14.5
34 BuildRequires:  lapack-devel >= 3.2.2-2
35 BuildRequires:  libicu-devel
36 BuildRequires:  libjpeg-devel >= 6b
37 BuildRequires:  libpng-devel >= 1.2.7
38 BuildRequires:  libstdc++-devel
39 BuildRequires:  libtiff-devel
40 BuildRequires:  libtool >= 2:2.0
41 BuildRequires:  libxml2-devel >= 2.6.26
42 BuildRequires:  pango-devel
43 BuildRequires:  pcre-devel >= 7.6
44 BuildRequires:  perl-base >= 1:5.6
45 BuildRequires:  pkgconfig
46 BuildRequires:  readline-devel
47 BuildRequires:  rpm-perlprov
48 %{?with_tcl:BuildRequires:      tcl-devel >= 8.4}
49 %if %{with docs}
50 BuildRequires:  tetex-dvips
51 BuildRequires:  tetex-latex
52 BuildRequires:  tetex-pdftex
53 BuildRequires:  texinfo-texi2dvi >= 4.7
54 %endif
55 %{?with_tcl:BuildRequires:      tk-devel >= 8.4}
56 BuildRequires:  xorg-lib-libX11-devel
57 BuildRequires:  xorg-lib-libXmu-devel
58 BuildRequires:  xorg-lib-libXt-devel
59 BuildRequires:  xz-devel >= 4.999
60 BuildRequires:  zip
61 BuildRequires:  zlib-devel >= 1.2.3
62 #Requires:      lpr
63 Requires(post): perl-base
64 Requires(post): textutils
65 Requires:       blas >= 3.2.2-2
66 Suggests:       rkward
67 Obsoletes:      R-base
68 Obsoletes:      R-contrib
69 Obsoletes:      R-recommended
70 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71
72 %description
73 A system for statistical computation and graphics. R consists of a
74 language plus a run-time environment with graphics, a debugger, access
75 to certain system functions, and the ability to run programs stored in
76 script files.
77
78 The design of R has been heavily influenced by two existing languages:
79 Becker, Chambers & Wilks' S and Sussman's Scheme. Whereas the
80 resulting language is very similar in appearance to S, the underlying
81 implementation and semantics are derived from Scheme.
82
83 %description -l pl.UTF-8
84 System do obliczeń statystycznych i grafiki. R składa się z języka
85 oraz środowiska uruchomieniowego z grafiką, debuggerem, dostępem do
86 niektórych funkcji systemowych oraz możliwością uruchamiania programów
87 zapisanych w skryptach.
88
89 Język R był zainspirowany dwoma istniejącymi językami: S (Beckera,
90 Chambersa i Wilksa) oraz Scheme (Sussmana). R jest podobny do S, ale
91 implementacja i semantyka wywodzi się ze Scheme.
92
93 %package java-tools
94 Summary:        R Java tools
95 Group:          Development/Tools
96 Requires:       %{name} = %{version}-%{release}
97
98 %description java-tools
99 R Java classes.
100
101 %prep
102 %setup -q
103
104 %build
105 %{__aclocal} -I m4
106 %{__autoconf}
107 install -d build
108 cd build
109 ../%configure \
110         F77=gfortran \
111         FC=gfortran \
112         --enable-R-shlib \
113         --enable-largefile \
114         --with-ICU \
115         --with-blas \
116         --with-cairo \
117         --with-jpeglib \
118         --with-lapack \
119         --with-libpng \
120         --with-readline \
121         --with-recommended-packages \
122         --with-system-bzlib \
123         --with-system-pcre \
124         --with-system-xz \
125         --with-system-zlib \
126         --with%{!?with_tcl:out}-tcltk \
127         --with-x
128
129 %{__make} -j1
130
131 %if %{with tests}
132 %{__make} check
133 %endif
134
135 %if %{with docs}
136 %{__make} docs pdf info
137 %endif
138
139 %install
140 rm -rf $RPM_BUILD_ROOT
141 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_libdir}/R,%{_includedir},%{_desktopdir},%{_pixmapsdir}}
142
143 %{__make} -C build -j1 install \
144         DESTDIR=$RPM_BUILD_ROOT
145
146 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
147 install %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
148
149 ln -sf %{_libdir}/R/lib/libR.so $RPM_BUILD_ROOT%{_libdir}
150
151 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/include $RPM_BUILD_ROOT%{_includedir}/R
152 ln -sf %{_includedir}/R $RPM_BUILD_ROOT%{_libdir}/R/include
153
154 gen_lang() {
155         dir="$1"
156         for d in $RPM_BUILD_ROOT${dir}/* ; do
157                 bd=$(basename $d)
158                 lang="${bd%@*}"
159                 echo "%lang($lang) ${dir}/${bd}"
160         done
161 }
162
163 gen_lang %{_libdir}/R/share/locale > R.files
164 for moddir in $RPM_BUILD_ROOT%{_libdir}/R/library/* ; do
165         module=$(basename $moddir)
166         echo "%dir %{_libdir}/R/library/${module}"
167         for f in $moddir/* ; do
168                 bf=$(basename $f)
169                 case "$bf" in
170                   po)
171                         echo "%dir %{_libdir}/R/library/${module}/po"
172                         gen_lang %{_libdir}/R/library/${module}/po
173                         ;;
174                   libs)
175                         echo "%dir %{_libdir}/R/library/${module}/libs"
176                         echo "%attr(755,root,root) %{_libdir}/R/library/${module}/libs/*.so"
177                         ;;
178                   *)
179                         echo "%{_libdir}/R/library/${module}/${bf}"
180                         ;;
181                 esac
182         done
183 done >> R.files
184
185 %clean
186 rm -rf $RPM_BUILD_ROOT
187
188 %post   -p /sbin/ldconfig
189 %postun -p /sbin/ldconfig
190
191 %files -f R.files
192 %defattr(644,root,root,755)
193 %doc NEWS README doc/{AUTHORS,COPYRIGHTS,FAQ,RESOURCES,THANKS}
194 %attr(755,root,root) %{_bindir}/R
195 %attr(755,root,root) %{_bindir}/Rscript
196 %dir %{_libdir}/R
197 %dir %{_libdir}/R/lib
198 %attr(755,root,root) %{_libdir}/R/lib/libR.so
199 %attr(755,root,root) %{_libdir}/libR.so
200 %{_libdir}/R/COPYING
201 %{_libdir}/R/NEWS
202 %{_libdir}/R/SVN-REVISION
203 %attr(755,root,root) %{_libdir}/R/bin
204 %exclude %{_libdir}/R/bin/javareconf
205 # %{_libdir}/R/doc %except %{_libdir}/R/doc/html/{packages.html,search/index.txt}
206 %dir %{_libdir}/R/doc
207 %{_libdir}/R/doc/[KRm]*
208 %dir %{_libdir}/R/doc/html
209 %{_libdir}/R/doc/html/*.css
210 %{_libdir}/R/doc/html/[Ra-lr-u]*.html
211 %{_libdir}/R/doc/html/packages-head*.html
212 %{_libdir}/R/doc/html/*.jpg
213 %ghost %{_libdir}/R/doc/html/packages.html
214 %{_libdir}/R/etc
215 %{_libdir}/R/include
216 %dir %{_libdir}/R/library
217 # library files list is autogenerated (see R.files above)
218 %attr(755,root,root) %{_libdir}/R/modules
219 %dir %{_libdir}/R/share
220 %{_libdir}/R/share/R
221 %{_libdir}/R/share/encodings
222 %{_libdir}/R/share/licenses
223 %dir %{_libdir}/R/share/locale
224 # locale files list is autogenerated (see R.files above)
225 %{_libdir}/R/share/make
226 %{_libdir}/R/share/sh
227 %{_libdir}/R/share/texmf
228 %{_desktopdir}/R.desktop
229 %{_pixmapsdir}/R.xpm
230 %{_includedir}/R
231 %{_pkgconfigdir}/libR.pc
232 %{_mandir}/man1/R.1*
233 %{_mandir}/man1/Rscript*
234
235 %files java-tools
236 %defattr(644,root,root,755)
237 %attr(755,root,root) %{_libdir}/R/bin/javareconf
238 %{_libdir}/R/share/java
This page took 0.069744 seconds and 3 git commands to generate.