]> git.pld-linux.org Git - packages/R.git/blob - R.spec
a866fa71aca06f8e96d6e6b18f12c475866e80b8
[packages/R.git] / R.spec
1 #
2 # Conditional build
3 %bcond_without  openmp  # OpenMP support
4 %bcond_without  tcl     # Tcl/Tk support
5 %bcond_without  tests   # do not run "make check"
6 %bcond_without  doc     # do not build documentation
7 #
8 # NOTE:
9 # - /etc/localtime must be present for tests to work
10 #
11 # TODO:
12 # - script for rpm to autoprovides/autorequires R internals
13 #
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:        4.1.3
18 Release:        1
19 License:        mixed (distributable), mostly GPL v2+
20 Group:          Development/Languages
21 Source0:        https://cran.r-project.org/src/base/R-4/%{name}-%{version}.tar.gz
22 # Source0-md5:  409bc782b1a42c8247712f6446d7d640
23 Source1:        %{name}.desktop
24 Source2:        %{name}.xpm
25 Patch0:         %{name}-timezone.patch
26 Patch1:         curl8.patch
27 URL:            https://www.r-project.org/
28 # yes, it is, or tests will fail
29 BuildRequires:  /etc/localtime
30 BuildRequires:  autoconf >= 2.69
31 BuildRequires:  automake
32 BuildRequires:  blas-devel >= 3.2.2-2
33 BuildRequires:  bzip2-devel >= 1.0.6
34 BuildRequires:  cairo-devel >= 1.6
35 BuildRequires:  curl-devel >= 7.28.0
36 BuildRequires:  gcc-fortran
37 BuildRequires:  gettext-tools >= 0.16.1
38 BuildRequires:  lapack-devel >= 3.2.2-2
39 %{?with_openmp:BuildRequires:   libgomp-devel}
40 BuildRequires:  libicu-devel
41 BuildRequires:  libjpeg-devel >= 6b
42 BuildRequires:  libpng-devel >= 2:1.2.7
43 BuildRequires:  libstdc++-devel
44 BuildRequires:  libtiff-devel
45 BuildRequires:  libtirpc-devel
46 BuildRequires:  libtool >= 2:2.0
47 BuildRequires:  pango-devel
48 BuildRequires:  pcre2-8-devel
49 BuildRequires:  perl-base >= 1:5.6
50 BuildRequires:  pkgconfig
51 BuildRequires:  readline-devel
52 BuildRequires:  rpm-perlprov
53 %if %{with tcl}
54 BuildRequires:  tcl-devel >= 8.4
55 BuildRequires:  tk-devel >= 8.4
56 %endif
57 # 0.8.0 is too old currently (checking for tre_regncompb in -ltre... no)
58 #BuildRequires: tre-devel >= ?
59 %if %{with doc}
60 BuildRequires:  texinfo-texi2dvi >= 4.7
61 BuildRequires:  texlive-dvips
62 BuildRequires:  texlive-latex
63 BuildRequires:  texlive-latex-ae
64 BuildRequires:  texlive-pdftex
65 %endif
66 BuildRequires:  xorg-lib-libX11-devel
67 BuildRequires:  xorg-lib-libXmu-devel
68 BuildRequires:  xorg-lib-libXt-devel
69 BuildRequires:  xz-devel >= 5.0.3
70 BuildRequires:  zip
71 BuildRequires:  zlib-devel >= 1.2.3
72 #Requires:      lpr
73 Requires(post): perl-base
74 Requires(post): textutils
75 Requires:       blas >= 3.2.2-2
76 Requires:       bzip2 >= 1.0.6
77 Requires:       curl-libs >= 7.28.0
78 Requires:       pcre >= 8.32
79 Requires:       xz-libs >= 5.0.3
80 Requires:       zlib >= 1.2.3
81 Suggests:       rkward
82 Obsoletes:      R-base
83 Obsoletes:      R-contrib
84 Obsoletes:      R-recommended
85 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87 %description
88 A system for statistical computation and graphics. R consists of a
89 language plus a run-time environment with graphics, a debugger, access
90 to certain system functions, and the ability to run programs stored in
91 script files.
92
93 The design of R has been heavily influenced by two existing languages:
94 Becker, Chambers & Wilks' S and Sussman's Scheme. Whereas the
95 resulting language is very similar in appearance to S, the underlying
96 implementation and semantics are derived from Scheme.
97
98 %description -l pl.UTF-8
99 System do obliczeń statystycznych i grafiki. R składa się z języka
100 oraz środowiska uruchomieniowego z grafiką, debuggerem, dostępem do
101 niektórych funkcji systemowych oraz możliwością uruchamiania programów
102 zapisanych w skryptach.
103
104 Język R był zainspirowany dwoma istniejącymi językami: S (Beckera,
105 Chambersa i Wilksa) oraz Scheme (Sussmana). R jest podobny do S, ale
106 implementacja i semantyka wywodzi się ze Scheme.
107
108 %package java-tools
109 Summary:        R Java tools
110 Summary(pl.UTF-8):      Narzędzia R w Javie
111 Group:          Development/Tools
112 Requires:       %{name} = %{version}-%{release}
113
114 %description java-tools
115 R Java classes.
116
117 %description java-tools -l pl.UTF-8
118 Narzędzia R w Javie.
119
120 %prep
121 %setup -q
122 %patch0 -p1
123 %patch1 -p0
124
125 %build
126 %{__aclocal} -I m4
127 %{__autoconf}
128 install -d build
129 cd build
130 ../%configure \
131         F77=gfortran \
132         FC=gfortran \
133         --enable-R-shlib \
134         --enable-largefile \
135         %{!?with_openmp:--disable-openmp} \
136         --with-internal-tzcode \
137         --with-ICU \
138         --with-blas \
139         --with-cairo \
140         --with-jpeglib \
141         --with-lapack \
142         --with-libpng \
143         --with-readline \
144         --with-recommended-packages \
145         --with-system-tre \
146 %if %{with tcl}
147         --with-tcltk \
148         --with-tcl-config=/usr/lib/tclConfig.sh \
149         --with-tk-config=/usr/lib/tkConfig.sh \
150 %else
151         --without-tcltk \
152 %endif
153         --with-x
154
155 %{__make} -j1
156
157 %if %{with tests}
158 %{__make} check
159 %endif
160
161 %if %{with doc}
162 %{__make} docs pdf info
163 %endif
164
165 %install
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_libdir}/R,%{_includedir},%{_desktopdir},%{_pixmapsdir}}
168
169 %{__make} -C build -j1 install \
170         DESTDIR=$RPM_BUILD_ROOT
171
172 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
173 install %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
174
175 ln -sf %{_libdir}/R/lib/libR.so $RPM_BUILD_ROOT%{_libdir}
176
177 %{__mv} $RPM_BUILD_ROOT%{_libdir}/%{name}/include $RPM_BUILD_ROOT%{_includedir}/R
178 ln -sf %{_includedir}/R $RPM_BUILD_ROOT%{_libdir}/R/include
179
180 gen_lang() {
181         dir="$1"
182         for d in $RPM_BUILD_ROOT${dir}/* ; do
183                 bd=$(basename $d)
184                 lang="${bd%@*}"
185                 echo "%lang($lang) ${dir}/${bd}"
186         done
187 }
188
189 for moddir in $RPM_BUILD_ROOT%{_libdir}/R/library/* ; do
190         module=$(basename $moddir)
191         echo "%dir %{_libdir}/R/library/${module}"
192         if [ "$module" = "translations" ]; then
193                 for f in $moddir/* ; do
194                         bf=$(basename $f)
195                         case "$bf" in
196                           DESCRIPTION|en|en@quot)
197                                 echo "%{_libdir}/R/library/${module}/${bf}"
198                                 ;;
199                           *)
200                                 echo "%lang(${bf}) %{_libdir}/R/library/${module}/${bf}"
201                                 ;;
202                         esac
203                 done
204         else
205                 for f in $moddir/* ; do
206                         bf=$(basename $f)
207                         case "$bf" in
208                           po)
209                                 echo "%dir %{_libdir}/R/library/${module}/po"
210                                 gen_lang %{_libdir}/R/library/${module}/po
211                                 ;;
212                           libs)
213                                 echo "%dir %{_libdir}/R/library/${module}/libs"
214                                 echo "%attr(755,root,root) %{_libdir}/R/library/${module}/libs/*.so"
215                                 ;;
216                           *)
217                                 echo "%{_libdir}/R/library/${module}/${bf}"
218                                 ;;
219                         esac
220                 done
221         fi
222 done > R.files
223
224 # just GPL
225 %{__rm} $RPM_BUILD_ROOT%{_libdir}/R/doc/COPYING
226 # packaged as %doc
227 %{__rm} $RPM_BUILD_ROOT%{_libdir}/R/doc/{AUTHORS,COPYRIGHTS,FAQ,NEWS.rds,THANKS}
228 %if %{with doc}
229 # pdf version of NEWS
230 %{__rm} $RPM_BUILD_ROOT%{_libdir}/R/doc/NEWS.pdf
231 %endif
232
233 %clean
234 rm -rf $RPM_BUILD_ROOT
235
236 %post   -p /sbin/ldconfig
237 %postun -p /sbin/ldconfig
238
239 %files -f R.files
240 %defattr(644,root,root,755)
241 %doc README doc/{AUTHORS,COPYRIGHTS,FAQ,NEWS,NEWS.[012],RESOURCES,THANKS}
242 %attr(755,root,root) %{_bindir}/R
243 %attr(755,root,root) %{_bindir}/Rscript
244 %dir %{_libdir}/R
245 %dir %{_libdir}/R/lib
246 %attr(755,root,root) %{_libdir}/R/lib/libR.so
247 %attr(755,root,root) %{_libdir}/libR.so
248 %{_libdir}/R/COPYING
249 %{_libdir}/R/SVN-REVISION
250 %attr(755,root,root) %{_libdir}/R/bin
251 %exclude %{_libdir}/R/bin/javareconf
252 # %{_libdir}/R/doc %except %{_libdir}/R/doc/html/{packages.html,search/index.txt}
253 %dir %{_libdir}/R/doc
254 %{_libdir}/R/doc/[KRm]*
255 %{_libdir}/R/doc/BioC_mirrors.csv
256 %{_libdir}/R/doc/CRAN_mirrors.csv
257 %{_libdir}/R/doc/NEWS*
258 %dir %{_libdir}/R/doc/html
259 %{_libdir}/R/doc/html/Rlogo.svg
260 %{_libdir}/R/doc/html/*.css
261 %{_libdir}/R/doc/html/[NRSa-lr-u]*.html
262 %{_libdir}/R/doc/html/packages-head*.html
263 %{_libdir}/R/doc/html/favicon.ico
264 %{_libdir}/R/doc/html/*.jpg
265 %ghost %{_libdir}/R/doc/html/packages.html
266 %{_libdir}/R/etc
267 %{_libdir}/R/include
268 %dir %{_libdir}/R/library
269 # library files list is autogenerated (see R.files above)
270 %attr(755,root,root) %{_libdir}/R/modules
271 %dir %{_libdir}/R/share
272 %{_libdir}/R/share/R
273 %{_libdir}/R/share/Rd
274 %{_libdir}/R/share/dictionaries
275 %{_libdir}/R/share/encodings
276 %{_libdir}/R/share/licenses
277 %{_libdir}/R/share/make
278 %{_libdir}/R/share/sh
279 %{_libdir}/R/share/texmf
280 %{_libdir}/R/share/zoneinfo
281 %{_desktopdir}/R.desktop
282 %{_pixmapsdir}/R.xpm
283 %{_includedir}/R
284 %{_pkgconfigdir}/libR.pc
285 %{_mandir}/man1/R.1*
286 %{_mandir}/man1/Rscript*
287
288 %files java-tools
289 %defattr(644,root,root,755)
290 %attr(755,root,root) %{_libdir}/R/bin/javareconf
291 %{_libdir}/R/share/java
This page took 0.083228 seconds and 2 git commands to generate.