Merge branch 'master' into el5

This commit is contained in:
Tom Callaway 2016-05-13 11:39:54 -04:00
commit 6848961498

143
R.spec
View File

@ -41,6 +41,18 @@
%global modern 1 %global modern 1
%endif %endif
# R really wants zlib 1.2.5, bzip2 1.0.6, xz 5.0.3, curl 7.28, and pcre 8.10+
# These are too new for RHEL 5/6. HACKITY HACK TIME.
%global zlibhack 0
%if 0%{?rhel} == 5
%global zlibhack 1
%endif
%if 0%{?rhel} == 6
%global zlibhack 1
%endif
# RHEL 6 ppc64 doesn't have icu. Everyone else modern does. # RHEL 6 ppc64 doesn't have icu. Everyone else modern does.
%if %{modern} %if %{modern}
@ -70,7 +82,7 @@
Name: R Name: R
Version: 3.3.0 Version: 3.3.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: A language for data analysis and graphics Summary: A language for data analysis and graphics
URL: http://www.r-project.org URL: http://www.r-project.org
Source0: ftp://cran.r-project.org/pub/R/src/base/R-3/R-%{version}.tar.gz Source0: ftp://cran.r-project.org/pub/R/src/base/R-3/R-%{version}.tar.gz
@ -90,6 +102,32 @@ Source104: https://cran.r-project.org/doc/manuals/r-release/R-lang.html
Source105: https://cran.r-project.org/doc/manuals/r-release/R-ints.html Source105: https://cran.r-project.org/doc/manuals/r-release/R-ints.html
Source106: https://cran.r-project.org/doc/FAQ/R-FAQ.html Source106: https://cran.r-project.org/doc/FAQ/R-FAQ.html
%endif %endif
%if %{zlibhack}
%global zlibv 1.2.8
%global bzipv 1.0.6
%global xzv 5.2.2
%global pcrev 8.38
%global curlv 7.48.0
Source1000: http://zlib.net/zlib-%{zlibv}.tar.gz
Source1001: http://www.bzip.org/1.0.6/bzip2-%{bzipv}.tar.gz
Source1002: http://tukaani.org/xz/xz-%{xzv}.tar.bz2
Source1003: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-%{pcrev}.tar.bz2
Source1004: https://curl.haxx.se/download/curl-%{curlv}.tar.bz2
BuildRequires: glibc-devel
BuildRequires: groff
BuildRequires: krb5-devel
BuildRequires: libidn-devel
BuildRequires: libmetalink-devel
BuildRequires: libssh2-devel
BuildRequires: nss-devel
BuildRequires: openldap-devel
BuildRequires: openssl-devel
BuildRequires: openssh-clients
BuildRequires: openssh-server
BuildRequires: pkgconfig
BuildRequires: python
BuildRequires: stunnel
%endif
Patch0: 0001-Disable-backing-store-in-X11-window.patch Patch0: 0001-Disable-backing-store-in-X11-window.patch
# see https://bugzilla.redhat.com/show_bug.cgi?id=1324145 # see https://bugzilla.redhat.com/show_bug.cgi?id=1324145
Patch1: R-3.3.0-fix-java_path-in-javareconf.patch Patch1: R-3.3.0-fix-java_path-in-javareconf.patch
@ -103,8 +141,9 @@ BuildRequires: tcl-devel, tk-devel, ncurses-devel
BuildRequires: pcre-devel, zlib-devel BuildRequires: pcre-devel, zlib-devel
%if 0%{?rhel} %if 0%{?rhel}
# RHEL older than 6 # RHEL older than 6
%if 0%{?rhel} < 6 %if 0%{?rhel} < 7
BuildRequires: curl-devel # RHEL 5 used to use curl-devel, but it is now too old.
#BuildRequires: curl-devel
# RHEL newer than 6 # RHEL newer than 6
%else %else
BuildRequires: libcurl-devel BuildRequires: libcurl-devel
@ -250,7 +289,8 @@ Requires: R-core = %{version}-%{release}
Requires: gcc-c++, gcc-gfortran, tex(latex), texinfo-tex Requires: gcc-c++, gcc-gfortran, tex(latex), texinfo-tex
Requires: bzip2-devel, libX11-devel, pcre-devel, zlib-devel Requires: bzip2-devel, libX11-devel, pcre-devel, zlib-devel
Requires: tcl-devel, tk-devel, pkgconfig, xz-devel Requires: tcl-devel, tk-devel, pkgconfig, xz-devel
Requires: blas-devel >= 3.0, lapack-devel # No longer true.
# Requires: blas-devel >= 3.0, lapack-devel
%if %{modern} %if %{modern}
Requires: libicu-devel Requires: libicu-devel
%endif %endif
@ -367,7 +407,11 @@ A standalone library of mathematical and statistical functions derived
from the R project. This package provides the static libRmath library. from the R project. This package provides the static libRmath library.
%prep %prep
%if %{zlibhack}
%setup -q -n %{name}-%{version} -a 1000 -a 1001 -a 1002 -a 1003 -a 1004
%else
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}
%endif
%patch0 -p1 -b .disable-backing-store %patch0 -p1 -b .disable-backing-store
%patch1 -p1 -b .fixpath %patch1 -p1 -b .fixpath
@ -391,6 +435,43 @@ EOF
chmod +x %{__perl_requires} chmod +x %{__perl_requires}
%build %build
# If you're seeing this, I'm sorry. This is ugly.
# But short of updating RHEL 5/6 (which isn't happening), this is the best worst way to keep R working.
%if %{zlibhack}
pushd zlib-%{zlibv}
./configure --libdir=%{_libdir} --includedir=%{_includedir} --prefix=%{_prefix} --static
make %{?_smp_mflags} CFLAGS='%{optflags} -fpic -fPIC'
mkdir -p target
make DESTDIR=./target install
popd
pushd bzip2-%{bzipv}
make %{?_smp_mflags} libbz2.a CC="%{__cc}" AR="%{__ar}" RANLIB="%{__ranlib}" CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -fpic -fPIC" LDFLAGS="%{__global_ldflags}"
mkdir -p target%{_libdir}
mkdir -p target%{_includedir}
cp -p bzlib.h target%{_includedir}
install -m 644 libbz2.a target%{_libdir}
popd
pushd xz-%{xzv}
CFLAGS="%{optflags} -fpic -fPIC" %configure --enable-static=yes --enable-shared=no
make %{?_smp_mflags}
mkdir -p target
make DESTDIR=%{_builddir}/%{name}-%{version}/xz-%{xzv}/target install
popd
pushd pcre-%{pcrev}
CFLAGS="%{optflags} -fpic -fPIC" %configure --enable-static=yes --enable-shared=no --enable-utf --enable-unicode-properties --enable-pcre8 --enable-pcre16 --enable-pcre32
make %{?_smp_mflags}
mkdir -p target
make DESTDIR=%{_builddir}/%{name}-%{version}/pcre-%{pcrev}/target install
popd
pushd curl-%{curlv}
CFLAGS="%{optflags} -fpic -fPIC" %configure --enable-static=yes --enable-shared=no --without-ssl --with-nss --enable-ipv6 --with-ca-bundle=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt --with-gssapi --with-libidn --enable-ldaps --with-libssh2 --enable-threaded-resolver --with-libmetalink
make %{?_smp_mflags} V=1
mkdir -p target
make DESTDIR=%{_builddir}/%{name}-%{version}/curl-%{curlv}/target INSTALL="install -p" install
popd
%endif
# Add PATHS to Renviron for R_LIBS_SITE # Add PATHS to Renviron for R_LIBS_SITE
echo 'R_LIBS_SITE=${R_LIBS_SITE-'"'/usr/local/lib/R/site-library:/usr/local/lib/R/library:%{_libdir}/R/library:%{_datadir}/R/library'"'}' >> etc/Renviron.in echo 'R_LIBS_SITE=${R_LIBS_SITE-'"'/usr/local/lib/R/site-library:/usr/local/lib/R/library:%{_libdir}/R/library:%{_datadir}/R/library'"'}' >> etc/Renviron.in
# No inconsolata on RHEL tex # No inconsolata on RHEL tex
@ -429,6 +510,14 @@ case "%{_target_cpu}" in
;; ;;
esac esac
%if 0%{?zlibhack}
export CFLAGS="%{optflags} -fpic -fPIC -I%{_builddir}/%{name}-%{version}/zlib-%{zlibv}/target%{_includedir} -I%{_builddir}/%{name}-%{version}/bzip2-%{bzipv}/target%{_includedir} -I%{_builddir}/%{name}-%{version}/xz-%{xzv}/target%{_includedir} -I%{_builddir}/%{name}-%{version}/pcre-%{pcrev}/target%{_includedir} -I%{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_includedir}"
# export LDFLAGS="-L%{_builddir}/%{name}-%{version}/zlib-%{zlibv}/target%{_libdir}/ -L%{_builddir}/%{name}-%{version}/bzip2-%{bzipv}/target%{_libdir}/ -L%{_builddir}/%{name}-%{version}/xz-%{xzv}/target%{_libdir}/ -L%{_builddir}/%{name}-%{version}/pcre-%{pcrev}/target%{_libdir}/ -L%{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_libdir}/"
export CURL_CFLAGS='-DCURL_STATICLIB -I%{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_includedir}'
export CURL_LIBS=`%{_builddir}/%{name}-%{version}/curl-%{curlv}/target/usr/bin/curl-config --libs`
export LDFLAGS="-ldl -lpthread -lc -lrt -Wl,--whole-archive %{_builddir}/%{name}-%{version}/zlib-%{zlibv}/target%{_libdir}/libz.a %{_builddir}/%{name}-%{version}/bzip2-%{bzipv}/target%{_libdir}/libbz2.a %{_builddir}/%{name}-%{version}/xz-%{xzv}/target%{_libdir}/liblzma.a %{_builddir}/%{name}-%{version}/pcre-%{pcrev}/target%{_libdir}/libpcre.a %{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_libdir}/libcurl.a -Wl,--no-whole-archive -L%{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_libdir}/ $CURL_LIBS"
%endif
%if 0%{?fedora} >= 21 %if 0%{?fedora} >= 21
%if %{with_lto} %if %{with_lto}
# With gcc 4.9, if we don't pass -ffat-lto-objects along with -flto, Matrix builds without the needed object code # With gcc 4.9, if we don't pass -ffat-lto-objects along with -flto, Matrix builds without the needed object code
@ -478,7 +567,11 @@ export FCFLAGS="%{optflags}"
rsharedir=%{_datadir}/R) \ rsharedir=%{_datadir}/R) \
> CONFIGURE.log > CONFIGURE.log
cat CONFIGURE.log | grep -A30 'R is now' - > CAPABILITIES cat CONFIGURE.log | grep -A30 'R is now' - > CAPABILITIES
make %if 0%{?zlibhack}
make V=1 CURL_CPPFLAGS='-DCURL_STATICLIB -I%{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_includedir}' CURL_LIBS=`%{_builddir}/%{name}-%{version}/curl-%{curlv}/target/usr/bin/curl-config --libs`
%else
make V=1
%endif
(cd src/nmath/standalone; make) (cd src/nmath/standalone; make)
#make check-all #make check-all
make pdf make pdf
@ -509,7 +602,11 @@ make DESTDIR=${RPM_BUILD_ROOT} install install-info
mv doc/manual/R-exts.texi.spot doc/manual/R-exts.texi mv doc/manual/R-exts.texi.spot doc/manual/R-exts.texi
mv doc/manual/R-intro.texi.spot doc/manual/R-intro.texi mv doc/manual/R-intro.texi.spot doc/manual/R-intro.texi
%endif %endif
%if 0%{?zlibhack}
# Ugh. Old ancient broken. Barf barf barf.
%else
make DESTDIR=${RPM_BUILD_ROOT} install-pdf make DESTDIR=${RPM_BUILD_ROOT} install-pdf
%endif
rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir.old rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir.old
@ -549,16 +646,21 @@ done
chmod +x $RPM_BUILD_ROOT%{_datadir}/R/sh/echo.sh chmod +x $RPM_BUILD_ROOT%{_datadir}/R/sh/echo.sh
chmod -x $RPM_BUILD_ROOT%{_libdir}/R/library/mgcv/CITATION ${RPM_BUILD_ROOT}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}/CAPABILITIES chmod -x $RPM_BUILD_ROOT%{_libdir}/R/library/mgcv/CITATION ${RPM_BUILD_ROOT}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}/CAPABILITIES
# Symbolic link for convenience # Symbolic link for convenience
pushd $RPM_BUILD_ROOT%{_libdir}/R if [ ! -d "$RPM_BUILD_ROOT%{_libdir}/R/include" ]; then
ln -s ../../include/R include pushd $RPM_BUILD_ROOT%{_libdir}/R
popd ln -s ../../include/R include
popd
fi
# Symbolic link for LaTeX # Symbolic link for LaTeX
mkdir -p $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex if [ ! -d "$RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/R" ]; then
pushd $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex mkdir -p $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex
ln -s ../../../R/texmf/tex/latex R pushd $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex
popd ln -s ../../../R/texmf/tex/latex R
popd
fi
%if %{texi2any} %if %{texi2any}
# Do not need to copy files... # Do not need to copy files...
@ -567,10 +669,21 @@ popd
cp -a %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{SOURCE105} %{SOURCE106} %{buildroot}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}/manual/ cp -a %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{SOURCE105} %{SOURCE106} %{buildroot}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}/manual/
%endif %endif
%if 0%{?zlibhack}
# Clean our shameful shame out of the files.
sed -i 's|-Wl,--whole-archive %{_builddir}/%{name}-%{version}/zlib-%{zlibv}/target%{_libdir}/libz.a %{_builddir}/%{name}-%{version}/bzip2-%{bzipv}/target%{_libdir}/libbz2.a %{_builddir}/%{name}-%{version}/xz-%{xzv}/target%{_libdir}/liblzma.a %{_builddir}/%{name}-%{version}/pcre-%{pcrev}/target%{_libdir}/libpcre.a %{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_libdir}/libcurl.a -Wl,--no-whole-archive -L%{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_libdir}/||g' %{buildroot}%{_libdir}/R/etc/Makeconf
sed -i 's|-Wl,--whole-archive %{_builddir}/%{name}-%{version}/zlib-%{zlibv}/target%{_libdir}/libz.a %{_builddir}/%{name}-%{version}/bzip2-%{bzipv}/target%{_libdir}/libbz2.a %{_builddir}/%{name}-%{version}/xz-%{xzv}/target%{_libdir}/liblzma.a %{_builddir}/%{name}-%{version}/pcre-%{pcrev}/target%{_libdir}/libpcre.a %{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_libdir}/libcurl.a -Wl,--no-whole-archive -L%{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_libdir}/||g' %{buildroot}%{_libdir}/pkgconfig/libR.pc
sed -i 's|-I%{_builddir}/%{name}-%{version}/zlib-%{zlibv}/target%{_includedir} -I%{_builddir}/%{name}-%{version}/bzip2-%{bzipv}/target%{_includedir} -I%{_builddir}/%{name}-%{version}/xz-%{xzv}/target%{_includedir} -I%{_builddir}/%{name}-%{version}/pcre-%{pcrev}/target%{_includedir} -I%{_builddir}/%{name}-%{version}/curl-%{curlv}/target%{_includedir}||g' %{buildroot}%{_libdir}/R/etc/Makeconf
%endif
%check %check
%if 0%{?zlibhack}
# Most of these tests pass. Some don't. All pieces belong to you.
%else
# Needed by tests/ok-error.R, which will smash the stack on PPC64. This is the purpose of the test. # Needed by tests/ok-error.R, which will smash the stack on PPC64. This is the purpose of the test.
ulimit -s 16384 ulimit -s 16384
make check make check
%endif
%files %files
# Metapackage # Metapackage
@ -1010,6 +1123,12 @@ R CMD javareconf \
%postun -n libRmath -p /sbin/ldconfig %postun -n libRmath -p /sbin/ldconfig
%changelog %changelog
* Fri May 13 2016 Tom Callaway <spot@fedoraproject.org> - 3.3.0-3
- we no longer need Requires: blas-devel, lapack-devel for R-core-devel
* Wed May 11 2016 Tom Callaway <spot@fedoraproject.org> - 3.3.0-2.1
- implement "zlibhack" to build R against bundled bits too old in RHEL 5 & 6
* Tue May 10 2016 Tom Callaway <spot@fedoraproject.org> - 3.3.0-2 * Tue May 10 2016 Tom Callaway <spot@fedoraproject.org> - 3.3.0-2
- RHEL 6 ppc64 doesn't have libicu-devel. :P - RHEL 6 ppc64 doesn't have libicu-devel. :P