]> git.pld-linux.org Git - packages/R.git/blob - R.spec
d43871333fd53c5cb293fb53012280fec5ec05db
[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:        3.6.3
18 Release:        7
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-3/%{name}-%{version}.tar.gz
23 # Source0-md5:  506c9576ba33e1262ad5b5624db9d96a
24 Source1:        %{name}.desktop
25 Source2:        %{name}.xpm
26 Patch0:         %{name}-timezone.patch
27 URL:            http://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 >= 1.2.7
43 BuildRequires:  libstdc++-devel
44 BuildRequires:  libtiff-devel
45 BuildRequires:  libtool >= 2:2.0
46 BuildRequires:  libxml2-devel >= 2.6.26
47 BuildRequires:  pango-devel
48 BuildRequires:  pcre-devel >= 8.32
49 # actually not used
50 #BuildRequires: pcre2-8-devel
51 BuildRequires:  perl-base >= 1:5.6
52 BuildRequires:  pkgconfig
53 BuildRequires:  readline-devel
54 BuildRequires:  rpm-perlprov
55 %if %{with tcl}
56 BuildRequires:  tcl-devel >= 8.4
57 BuildRequires:  tk-devel >= 8.4
58 %endif
59 BuildRequires:  tre-devel
60 %if %{with doc}
61 BuildRequires:  texinfo-texi2dvi >= 4.7
62 BuildRequires:  texlive-dvips
63 BuildRequires:  texlive-latex
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
124 %build
125 %{__aclocal} -I m4
126 %{__autoconf}
127 install -d build
128 cd build
129 ../%configure \
130         F77=gfortran \
131         FC=gfortran \
132         --enable-R-shlib \
133         --enable-largefile \
134         %{!?with_openmp:--disable-openmp} \
135         --with-internal-tzcode \
136         --with-ICU \
137         --with-blas \
138         --with-cairo \
139         --with-jpeglib \
140         --with-lapack \
141         --with-libpng \
142         --with-readline \
143         --with-recommended-packages \
144         --with-system-tre \
145 %if %{with tcl}
146         --with-tcltk \
147         --with-tcl-config=/usr/lib/tclConfig.sh \
148         --with-tk-config=/usr/lib/tkConfig.sh \
149 %else
150         --without-tcltk \
151 %endif
152         --with-x
153
154 %{__make} -j1
155
156 %if %{with tests}
157 %{__make} check
158 %endif
159
160 %if %{with doc}
161 %{__make} docs pdf info
162 %endif
163
164 %install
165 rm -rf $RPM_BUILD_ROOT
166 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_libdir}/R,%{_includedir},%{_desktopdir},%{_pixmapsdir}}
167
168 %{__make} -C build -j1 install \
169         DESTDIR=$RPM_BUILD_ROOT
170
171 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
172 install %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
173
174 ln -sf %{_libdir}/R/lib/libR.so $RPM_BUILD_ROOT%{_libdir}
175
176 %{__mv} $RPM_BUILD_ROOT%{_libdir}/%{name}/include $RPM_BUILD_ROOT%{_includedir}/R
177 ln -sf %{_includedir}/R $RPM_BUILD_ROOT%{_libdir}/R/include
178
179 gen_lang() {
180         dir="$1"
181         for d in $RPM_BUILD_ROOT${dir}/* ; do
182                 bd=$(basename $d)
183                 lang="${bd%@*}"
184                 echo "%lang($lang) ${dir}/${bd}"
185         done
186 }
187
188 for moddir in $RPM_BUILD_ROOT%{_libdir}/R/library/* ; do
189         module=$(basename $moddir)
190         echo "%dir %{_libdir}/R/library/${module}"
191         if [ "$module" = "translations" ]; then
192                 for f in $moddir/* ; do
193                         bf=$(basename $f)
194                         case "$bf" in
195                           DESCRIPTION|en|en@quot)
196                                 echo "%{_libdir}/R/library/${module}/${bf}"
197                                 ;;
198                           *)
199                                 echo "%lang(${bf}) %{_libdir}/R/library/${module}/${bf}"
200                                 ;;
201                         esac
202                 done
203         else
204                 for f in $moddir/* ; do
205                         bf=$(basename $f)
206                         case "$bf" in
207                           po)
208                                 echo "%dir %{_libdir}/R/library/${module}/po"
209                                 gen_lang %{_libdir}/R/library/${module}/po
210                                 ;;
211                           libs)
212                                 echo "%dir %{_libdir}/R/library/${module}/libs"
213                                 echo "%attr(755,root,root) %{_libdir}/R/library/${module}/libs/*.so"
214                                 ;;
215                           *)
216                                 echo "%{_libdir}/R/library/${module}/${bf}"
217                                 ;;
218                         esac
219                 done
220         fi
221 done > R.files
222
223 # just GPL
224 %{__rm} $RPM_BUILD_ROOT%{_libdir}/R/doc/COPYING
225 # packaged as %doc
226 %{__rm} $RPM_BUILD_ROOT%{_libdir}/R/doc/{AUTHORS,COPYRIGHTS,FAQ,NEWS.rds,THANKS}
227 %if %{with doc}
228 # pdf version of NEWS
229 %{__rm} $RPM_BUILD_ROOT%{_libdir}/R/doc/NEWS.pdf
230 %endif
231
232 %clean
233 rm -rf $RPM_BUILD_ROOT
234
235 %post   -p /sbin/ldconfig
236 %postun -p /sbin/ldconfig
237
238 %files -f R.files
239 %defattr(644,root,root,755)
240 %doc README doc/{AUTHORS,COPYRIGHTS,FAQ,NEWS,NEWS.[012],RESOURCES,THANKS}
241 %attr(755,root,root) %{_bindir}/R
242 %attr(755,root,root) %{_bindir}/Rscript
243 %dir %{_libdir}/R
244 %dir %{_libdir}/R/lib
245 %attr(755,root,root) %{_libdir}/R/lib/libR.so
246 %attr(755,root,root) %{_libdir}/libR.so
247 %{_libdir}/R/COPYING
248 %{_libdir}/R/SVN-REVISION
249 %attr(755,root,root) %{_libdir}/R/bin
250 %exclude %{_libdir}/R/bin/javareconf
251 # %{_libdir}/R/doc %except %{_libdir}/R/doc/html/{packages.html,search/index.txt}
252 %dir %{_libdir}/R/doc
253 %{_libdir}/R/doc/[KRm]*
254 %{_libdir}/R/doc/BioC_mirrors.csv
255 %{_libdir}/R/doc/CRAN_mirrors.csv
256 %{_libdir}/R/doc/NEWS*
257 %dir %{_libdir}/R/doc/html
258 %{_libdir}/R/doc/html/Rlogo.svg
259 %{_libdir}/R/doc/html/*.css
260 %{_libdir}/R/doc/html/[NRSa-lr-u]*.html
261 %{_libdir}/R/doc/html/packages-head*.html
262 %{_libdir}/R/doc/html/favicon.ico
263 %{_libdir}/R/doc/html/*.jpg
264 %ghost %{_libdir}/R/doc/html/packages.html
265 %{_libdir}/R/etc
266 %{_libdir}/R/include
267 %dir %{_libdir}/R/library
268 # library files list is autogenerated (see R.files above)
269 %attr(755,root,root) %{_libdir}/R/modules
270 %dir %{_libdir}/R/share
271 %{_libdir}/R/share/R
272 %{_libdir}/R/share/Rd
273 %{_libdir}/R/share/dictionaries
274 %{_libdir}/R/share/encodings
275 %{_libdir}/R/share/licenses
276 %{_libdir}/R/share/make
277 %{_libdir}/R/share/sh
278 %{_libdir}/R/share/texmf
279 %{_libdir}/R/share/zoneinfo
280 %{_desktopdir}/R.desktop
281 %{_pixmapsdir}/R.xpm
282 %{_includedir}/R
283 %{_pkgconfigdir}/libR.pc
284 %{_mandir}/man1/R.1*
285 %{_mandir}/man1/Rscript*
286
287 %files java-tools
288 %defattr(644,root,root,755)
289 %attr(755,root,root) %{_libdir}/R/bin/javareconf
290 %{_libdir}/R/share/java
This page took 0.062586 seconds and 2 git commands to generate.