summaryrefslogtreecommitdiff
path: root/R.spec
blob: dc122b75bf2f9d88254ce3ac6afc43eec4260d04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
#
# Conditional build
%bcond_without	tcl		# disable tcl support
%bcond_without	tests	# do not run "make check"
%bcond_without	docs	# do not build documentation
#
# NOTE:
# - /etc/localtime must be present for tests to work
#
# TODO:
# - script for rpm to autoprovides/autorequires R internals
#
%include	/usr/lib/rpm/macros.perl
Summary:	A language for data analysis and graphics
Summary(pl.UTF-8):	Język do analizy danych oraz grafiki
Name:		R
Version:	3.0.2
Release:	2
License:	Mixed (distributable), mostly GPL v2+
Group:		Development/Languages
# CRAN master site: ftp://cran.r-project.org/pub/R/src/
Source0:	ftp://stat.ethz.ch/R-CRAN/src/base/R-3/%{name}-%{version}.tar.gz
# Source0-md5:	f9a8374736e7650e4848f33e2e3bbee3
Source1:	%{name}.desktop
Source2:	%{name}.xpm
URL:		http://www.r-project.org/
BuildRequires:	autoconf >= 2.62
BuildRequires:	automake
BuildRequires:	blas-devel >= 3.2.2-2
BuildRequires:	bzip2-devel >= 1.0.6
BuildRequires:	cairo-devel >= 1.6
BuildRequires:	gcc-fortran
BuildRequires:	gettext-devel >= 0.14.5
BuildRequires:	lapack-devel >= 3.2.2-2
BuildRequires:	libicu-devel
BuildRequires:	libjpeg-devel >= 6b
BuildRequires:	libpng-devel >= 1.2.7
BuildRequires:	libstdc++-devel
BuildRequires:	libtiff-devel
BuildRequires:	libtool >= 2:2.0
BuildRequires:	libxml2-devel >= 2.6.26
BuildRequires:	pango-devel
BuildRequires:	pcre-devel >= 7.6
BuildRequires:	perl-base >= 1:5.6
BuildRequires:	pkgconfig
BuildRequires:	readline-devel
BuildRequires:	rpm-perlprov
%if %{with tcl}
BuildRequires:	tcl-devel >= 8.4
BuildRequires:	tk-devel >= 8.4
%endif
%if %{with docs}
BuildRequires:	tetex-dvips
BuildRequires:	tetex-latex
BuildRequires:	tetex-pdftex
BuildRequires:	texinfo-texi2dvi >= 4.7
%endif
BuildRequires:	xorg-lib-libX11-devel
BuildRequires:	xorg-lib-libXmu-devel
BuildRequires:	xorg-lib-libXt-devel
BuildRequires:	xz-devel >= 4.999
BuildRequires:	zip
BuildRequires:	zlib-devel >= 1.2.3
#Requires:	lpr
Requires(post):	perl-base
Requires(post):	textutils
Requires:	blas >= 3.2.2-2
Suggests:	rkward
Obsoletes:	R-base
Obsoletes:	R-contrib
Obsoletes:	R-recommended
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
A system for statistical computation and graphics. R consists of a
language plus a run-time environment with graphics, a debugger, access
to certain system functions, and the ability to run programs stored in
script files.

The design of R has been heavily influenced by two existing languages:
Becker, Chambers & Wilks' S and Sussman's Scheme. Whereas the
resulting language is very similar in appearance to S, the underlying
implementation and semantics are derived from Scheme.

%description -l pl.UTF-8
System do obliczeń statystycznych i grafiki. R składa się z języka
oraz środowiska uruchomieniowego z grafiką, debuggerem, dostępem do
niektórych funkcji systemowych oraz możliwością uruchamiania programów
zapisanych w skryptach.

Język R był zainspirowany dwoma istniejącymi językami: S (Beckera,
Chambersa i Wilksa) oraz Scheme (Sussmana). R jest podobny do S, ale
implementacja i semantyka wywodzi się ze Scheme.

%package java-tools
Summary:	R Java tools
Summary(pl.UTF-8):	Narzędzia R w Javie
Group:		Development/Tools
Requires:	%{name} = %{version}-%{release}

%description java-tools
R Java classes.

%description java-tools -l pl.UTF-8
Narzędzia R w Javie.

%prep
%setup -q

%build
%{__aclocal} -I m4
%{__autoconf}
install -d build
cd build
../%configure \
	F77=gfortran \
	FC=gfortran \
	--enable-R-shlib \
	--enable-largefile \
	--with-ICU \
	--with-blas \
	--with-cairo \
	--with-jpeglib \
	--with-lapack \
	--with-libpng \
	--with-readline \
	--with-recommended-packages \
	--with-system-bzlib \
	--with-system-pcre \
	--with-system-xz \
	--with-system-zlib \
%if %{with tcl}
	--with-tcltk \
	--with-tcl-config=/usr/lib/tclConfig.sh \
	--with-tk-config=/usr/lib/tkConfig.sh \
%else
	--without-tcltk \
%endif
	--with-x

%{__make} -j1

%if %{with tests}
%{__make} check
%endif

%if %{with docs}
%{__make} docs pdf info
%endif

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_libdir}/R,%{_includedir},%{_desktopdir},%{_pixmapsdir}}

%{__make} -C build -j1 install \
	DESTDIR=$RPM_BUILD_ROOT

install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
install %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}

ln -sf %{_libdir}/R/lib/libR.so $RPM_BUILD_ROOT%{_libdir}

mv $RPM_BUILD_ROOT%{_libdir}/%{name}/include $RPM_BUILD_ROOT%{_includedir}/R
ln -sf %{_includedir}/R $RPM_BUILD_ROOT%{_libdir}/R/include

gen_lang() {
	dir="$1"
	for d in $RPM_BUILD_ROOT${dir}/* ; do
		bd=$(basename $d)
		lang="${bd%@*}"
		echo "%lang($lang) ${dir}/${bd}"
	done
}

for moddir in $RPM_BUILD_ROOT%{_libdir}/R/library/* ; do
	module=$(basename $moddir)
	echo "%dir %{_libdir}/R/library/${module}"
	if [ "$module" = "translations" ]; then
		for f in $moddir/* ; do
			bf=$(basename $f)
			case "$bf" in
			  DESCRIPTION|en|en@quot)
				echo "%{_libdir}/R/library/${module}/${bf}"
				;;
			  *)
				echo "%lang(${bf}) %{_libdir}/R/library/${module}/${bf}"
				;;
			esac
		done
	else
		for f in $moddir/* ; do
			bf=$(basename $f)
			case "$bf" in
			  po)
				echo "%dir %{_libdir}/R/library/${module}/po"
				gen_lang %{_libdir}/R/library/${module}/po
				;;
			  libs)
				echo "%dir %{_libdir}/R/library/${module}/libs"
				echo "%attr(755,root,root) %{_libdir}/R/library/${module}/libs/*.so"
				;;
			  *)
				echo "%{_libdir}/R/library/${module}/${bf}"
				;;
			esac
		done
	fi
done > R.files

# just GPL
%{__rm} $RPM_BUILD_ROOT%{_libdir}/R/doc/COPYING
# packaged as %doc
%{__rm} $RPM_BUILD_ROOT%{_libdir}/R/doc/{AUTHORS,COPYRIGHTS,FAQ,NEWS.rds,THANKS}
%if %{with docs}
# pdf version of NEWS
%{__rm} $RPM_BUILD_ROOT%{_libdir}/R/NEWS.pdf
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post	-p /sbin/ldconfig
%postun	-p /sbin/ldconfig

%files -f R.files
%defattr(644,root,root,755)
%doc NEWS* README doc/{AUTHORS,COPYRIGHTS,FAQ,RESOURCES,THANKS}
%attr(755,root,root) %{_bindir}/R
%attr(755,root,root) %{_bindir}/Rscript
%dir %{_libdir}/R
%dir %{_libdir}/R/lib
%attr(755,root,root) %{_libdir}/R/lib/libR.so
%attr(755,root,root) %{_libdir}/libR.so
%{_libdir}/R/COPYING
%{_libdir}/R/NEWS*
%{_libdir}/R/SVN-REVISION
%attr(755,root,root) %{_libdir}/R/bin
%exclude %{_libdir}/R/bin/javareconf
# %{_libdir}/R/doc %except %{_libdir}/R/doc/html/{packages.html,search/index.txt}
%dir %{_libdir}/R/doc
%{_libdir}/R/doc/[KRm]*
%{_libdir}/R/doc/CRAN_mirrors.csv
%dir %{_libdir}/R/doc/html
%{_libdir}/R/doc/html/*.css
%{_libdir}/R/doc/html/[NRSa-lr-u]*.html
%{_libdir}/R/doc/html/packages-head*.html
%{_libdir}/R/doc/html/favicon.ico
%{_libdir}/R/doc/html/*.jpg
%ghost %{_libdir}/R/doc/html/packages.html
%{_libdir}/R/etc
%{_libdir}/R/include
%dir %{_libdir}/R/library
# library files list is autogenerated (see R.files above)
%attr(755,root,root) %{_libdir}/R/modules
%dir %{_libdir}/R/share
%{_libdir}/R/share/R
%{_libdir}/R/share/dictionaries
%{_libdir}/R/share/encodings
%{_libdir}/R/share/licenses
%{_libdir}/R/share/make
%{_libdir}/R/share/sh
%{_libdir}/R/share/texmf
%{_desktopdir}/R.desktop
%{_pixmapsdir}/R.xpm
%{_includedir}/R
%{_pkgconfigdir}/libR.pc
%{_mandir}/man1/R.1*
%{_mandir}/man1/Rscript*

%files java-tools
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/R/bin/javareconf
%{_libdir}/R/share/java