Accepting request 667336 from home:TheBlackCat:branches:devel:languages:R:released

- Add architecture-independent package directory.
  Taken from the Fedora version of R.
- Add RPM macros to ease installation of R packages.
- Fix building on older versions of openSUSE.

OBS-URL: https://build.opensuse.org/request/show/667336
OBS-URL: https://build.opensuse.org/package/show/devel:languages:R:released/R-base?expand=0&rev=79
This commit is contained in:
Detlef Steuer 2019-01-30 21:02:41 +00:00 committed by Git OBS Bridge
parent eedac20746
commit 0df3ad1ea9
3 changed files with 77 additions and 26 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jan 15 20:46:55 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Add architecture-independent package directory.
Taken from the Fedora version of R.
- Add RPM macros to ease installation of R packages.
- Fix building on older versions of openSUSE.
-------------------------------------------------------------------
Wed Dec 19 10:29:07 UTC 2018 - Detlef Steuer <detlef.steuer@gmx.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package R-base
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,13 +16,21 @@
#
%if 0%{?sle_version} < 150000
%define macrosdir %{_sysconfdir}/rpm/
%else
%define macrosdir %{_rpmconfigdir}/macros.d/
%endif
%define release 1
Name: R-base
Version: 3.5.2
Release: %release
%define Rversion %{version}
Source: R-%{version}.tar.bz2
Source0: R-%{version}.tar.bz2
Source10: macros.R
#Source: http://cran.r-project.org/src/base/R-2/R-%%{version}.tar.gz
# PATCH-FIX-UPSTREAM Fix tre when wchar_t is unsigned int
#Patch0: tre.patch
@ -54,13 +62,6 @@ BuildRequires: pkgconfig(xmu)
BuildRequires: pkgconfig(xscrnsaver)
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(zlib)
%if %suse_version < 1230
# nowadays means == 1220
BuildRequires: texlive-bin
BuildRequires: texlive-bin-latex
BuildRequires: texlive-fonts-extra
%else
# else for < 1230, therefore >=1230
BuildRequires: texlive-bibtex
BuildRequires: texlive-cm-super
BuildRequires: texlive-dvips
@ -74,18 +75,13 @@ BuildRequires: unzip
BuildRequires: xdg-utils
BuildRequires: xz-devel
BuildRequires: zip
# No tex(inconsolata.sty) provided in SLE-12, same for 42.1
%if %suse_version != 1315
BuildRequires: tex(inconsolata.sty)
%endif # !=1315
%endif # > 1230
BuildRequires: pango-devel
BuildRequires: tcl-devel
BuildRequires: texlive-latex
%if 0%{?suse_version} != 1315
%if 0%{?suse_version} > 1320
BuildRequires: tex(inconsolata.sty)
BuildRequires: texinfo >= 5.1
%endif # !=1315
%endif # > 1320
BuildRequires: tk-devel
Requires: R-base-devel = %{version}
Requires: R-core = %{version}
@ -112,8 +108,7 @@ R is a language which is not entirely unlike the S language developed at
AT&T Bell Laboratories by Rick Becker, John Chambers and Allan Wilks.
%prep
%prep
%setup -n R-%{version}
#%patch0 -p1
@ -125,7 +120,7 @@ AT&T Bell Laboratories by Rick Becker, John Chambers and Allan Wilks.
make %{?_smp_mflags}
#make
make pdf
%if 0%{?suse_version} != 1315
%if 0%{?suse_version} > 1320
make info
# Convert to UTF-8
for i in doc/manual/R-intro.info doc/manual/R-FAQ.info doc/FAQ doc/manual/R-admin.info doc/manual/R-exts.info-1; do
@ -140,7 +135,7 @@ make DESTDIR=%{buildroot} install-pdf
# Installation of Info-files
%{__install} -m 755 -d %{_infodir}
%if 0%{?suse_version} != 1315
%if 0%{?suse_version} > 1320
make DESTDIR=%{buildroot} INFODIR=%{buildroot}%{_infodir} install-info
%{__rm} -f %{buildroot}%{_infodir}/dir
%{__rm} -f %{buildroot}%{_infodir}/dir.old
@ -150,9 +145,7 @@ chmod +x %{buildroot}%{_libdir}/R/share/sh/echo.sh
chmod -x %{buildroot}%{_libdir}/R/library/mgcv/CITATION
#%if %suse_version > 1020
%fdupes -s $RPM_BUILD_ROOT
#%endif
# Install ld.so.conf.d file to ensure other applications access the shared lib
mkdir -p %{buildroot}/etc/ld.so.conf.d
@ -160,6 +153,14 @@ cat << EOF >%{buildroot}/etc/ld.so.conf.d/R.conf
%{_libdir}/R/lib
EOF
# Install RPM macros
mkdir -p %{buildroot}%{macrosdir}
install -m 644 -t %{buildroot}%{macrosdir} %{SOURCE10}
sed -i 's|@vers@|%{Rversion}|' %{buildroot}%{macrosdir}/macros.R
# Add noarch R library directory
mkdir -p %{buildroot}%{_datadir}/R/library
%files -n R-base
%package -n R-base-devel
@ -201,6 +202,8 @@ This package provides the core of R, i.e. all that is in base.
%{_libdir}/R/library/base/Meta/
%{_libdir}/R/library/base/R/
# noarch
# translations
%doc %{_libdir}/R/library/translations/DESCRIPTION
%dir %{_libdir}/R/library/translations/
@ -307,6 +310,7 @@ This package provides the core of R, i.e. all that is in base.
# R-core main part
%dir %{_libdir}/R
%dir %{_datadir}/R
%{_bindir}/*
%{_libdir}/R/bin/
%{_libdir}/R/etc/
@ -314,6 +318,7 @@ This package provides the core of R, i.e. all that is in base.
%{_libdir}/R/modules/
%dir %{_libdir}/R/share
%dir %{_libdir}/R/library
%dir %{_datadir}/R/library/
%{_libdir}/R/share/encodings/
%{_libdir}/R/share/java/
@ -336,6 +341,7 @@ This package provides the core of R, i.e. all that is in base.
Summary: Libraries and includefiles for developing with R-base
Group: Development/Libraries/Other
Provides: R-devel = %{version}
Provides: R-devel-macros = %{version}
Requires: R-base
%description -n R-core-devel
@ -391,6 +397,7 @@ libraries to allow you to devel with R-base.
%{_libdir}/R/include/R_ext/stats_package.h
%{_libdir}/R/include/R_ext/stats_stubs.h
%{macrosdir}/macros.R
%{_libdir}/pkgconfig/libR.pc
#R-core-libs
@ -422,7 +429,7 @@ Group: Documentation/Other
This packages provides all documentation of R base. PDFs, man pages, info pages
%post -n R-core-doc
%if 0%{?suse_version} != 1315
%if 0%{?suse_version} > 1320
%install_info --info-dir=%{_infodir} %{_infodir}/R-exts.info-1.gz
%install_info --info-dir=%{_infodir} %{_infodir}/R-FAQ.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/R-lang.info.gz
@ -435,7 +442,7 @@ This packages provides all documentation of R base. PDFs, man pages, info pages
%endif
%preun -n R-core-doc
%if 0%{?suse_version} != 1315
%if 0%{?suse_version} > 1320
%install_info_delete --info-dir=%{_infodir} %{_infodir}/R-exts.info-1.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/R-FAQ.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/R-lang.info.gz
@ -454,7 +461,7 @@ This packages provides all documentation of R base. PDFs, man pages, info pages
%{_mandir}/man1/Rscript.1*
%doc %{_libdir}/R/COPYING
%doc %{_libdir}/R/SVN-REVISION
%if 0%{?suse_version} != 1315
%if 0%{?suse_version} > 1320
%{_infodir}/*.gz
%endif
%doc %{_libdir}/R/doc/

36
macros.R Normal file
View File

@ -0,0 +1,36 @@
# R-related variables
%R_archlib %{_libdir}/R/library
%R_noarchlib %{_datadir}/R/library
%R_version @vers@
# Get a version number that is compatible with RPM
# Provide the package version as the argument.
# Only needed if there are dashes or underscores
# in the version number.
%R_rpmver() %( echo %1 | tr - . | tr _ . )
# Setup th build directory the right way.
# By default %{packname} is used.
# Override this with "-p [name]".
%R_unpack(p:) %setup -q -c -n %{-p:%{-p*}}%{!-p:%{packname}}
# Install the package
# By default %{packname} is used.
# Override this with "-p [name]".
# By default, the package is stored in the architecture-dependent
# R library directory. Use the "-n" flag to install in the
# architecture-independent directory.
# Manually specify a directory using "-t [path]".
%R_install(np:t:) \
%define curpack %{-p:%{-p*}}%{!-p:%{packname}} \
%define curlib %{-t:%{-n:%{error:Can't specify both -t and -n}}%{!-n:%{-t*}}}%{!-t:%{-n:%{R_noarchlib}}%{!-n:%{R_archlib}}} \
mkdir -p %{buildroot}%{curlib} \
%{_bindir}/R CMD INSTALL -l %{buildroot}%{curlib} %{curpack} \
test -d %{curpack}/src && (cd %{curpack}/src; rm -f *.o *.so) \
rm -f %{buildroot}%{curlib}/R.css \
%{nil}
# Run standard R tests.
# By default %{packname} is used.
# Override this with "-p [name]".
%R_test(p:) %{_bindir}/R CMD check %{-p:%{-p*}}%{!-p:%{packname}}