Initial import (#1551449).

This commit is contained in:
Elliott Sales de Andrade 2018-03-05 21:12:57 -05:00
parent ccc8d3dbd2
commit faab265411
5 changed files with 130 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/lubridate_1.7.3.tar.gz

View File

@ -0,0 +1,31 @@
From 997e5e05d70892222fb07c2d6ad483ad1e9a9607 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sun, 4 Mar 2018 20:13:49 -0500
Subject: [PATCH 1/2] Fix system timezone memoization.
The result of `get_system_tz` comes from a `STRING_ELT`, which seems to
be automatically garbage collected, causing the static character pointer
to point to an invalid location. Duplicating the string is a small leak,
but prevents this invalid access.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
src/update.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/update.cpp b/src/update.cpp
index 4cddbb1..1f4a694 100644
--- a/src/update.cpp
+++ b/src/update.cpp
@@ -95,7 +95,7 @@ const char* get_system_tz() {
const char* local_tz() {
// initialize once per session
- static const char* SYS_TZ = get_system_tz();
+ static const char* SYS_TZ = strdup(get_system_tz());
const char* tz_env = std::getenv("TZ");
if (tz_env == NULL) {
return SYS_TZ;
--
2.14.3

97
R-lubridate.spec Normal file
View File

@ -0,0 +1,97 @@
%global packname lubridate
%global rlibdir %{_libdir}/R/library
# knitr is not yet available.
%global with_doc 0
Name: R-%{packname}
Version: 1.7.3
Release: 1%{?dist}
Summary: Make dealing with dates a little easier
License: GPLv2+ and ASL 2.0
URL: https://cran.r-project.org/web/packages/%{packname}/index.html
Source0: https://cran.r-project.org/src/contrib/%{packname}_%{version}.tar.gz
# https://github.com/tidyverse/lubridate/pull/649
Patch0001: 0001-Fix-system-timezone-memoization.patch
# Here's the R view of the dependencies world:
# Depends: R-methods
# Imports: R-stringr R-Rcpp
# Suggests: R-testthat R-knitr R-covr
# LinkingTo:
# Enhances:
Requires: R-methods
Requires: R-stringr
Requires: tzdata
BuildRequires: tzdata
BuildRequires: R-devel tex(latex) R-methods
BuildRequires: R-stringr R-Rcpp-devel
BuildRequires: R-testthat
%if %{with_doc}
BuildRequires: R-knitr
%endif
%description
Functions to work with date-times and time-spans: fast and user friendly
parsing of date-time data, extraction and updating of components of a
date-time (years, months, days, hours, minutes, and seconds), algebraic
manipulation on date-time and time-span objects. The 'lubridate' package
has a consistent and memorable syntax that makes working with dates easy
and fun. Parts of the 'CCTZ' source code, released under the Apache 2.0
License, are included in this package. See
<https://github.com/google/cctz> for more details.
%prep
%setup -q -c -n %{packname}
pushd %{packname}
%patch0001 -p1
popd
# Don't need coverage; it's not packaged either.
sed -i 's/, covr//g' %{packname}/DESCRIPTION
%build
%install
mkdir -p %{buildroot}%{rlibdir}
%{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname}
test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so)
rm -f %{buildroot}%{rlibdir}/R.css
# Used to update sources; don't need to package it.
rm %{buildroot}%{rlibdir}/%{packname}/cctz.sh
%check
%if %{with_doc}
%{_bindir}/R CMD check %{packname}
%else
_R_CHECK_FORCE_SUGGESTS_=0 %{_bindir}/R CMD check %{packname} --ignore-vignettes
%endif
%files
%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/doc
%doc %{rlibdir}/%{packname}/html
%{rlibdir}/%{packname}/DESCRIPTION
%doc %{rlibdir}/%{packname}/CITATION
%doc %{rlibdir}/%{packname}/NEWS.md
%{rlibdir}/%{packname}/INDEX
%{rlibdir}/%{packname}/NAMESPACE
%{rlibdir}/%{packname}/Meta
%{rlibdir}/%{packname}/R
%{rlibdir}/%{packname}/help
%{rlibdir}/%{packname}/data
%{rlibdir}/%{packname}/libs
%{rlibdir}/%{packname}/pkgdown
%changelog
* Sun Mar 04 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> 1.7.3-1
- initial package for Fedora

View File

@ -1,3 +0,0 @@
# R-lubridate
The R-lubridate package

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (lubridate_1.7.3.tar.gz) = 66d9912ae0fdb61a07acc7ba245918c78a46493f88cc03bf732882908906a30105bc8dd87b59e913488851e1afa66f0d18490647d055202f66f7206320040a87