- 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
37 lines
1.4 KiB
R
37 lines
1.4 KiB
R
# 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}}
|