Merge remote-tracking branch 'origin/master' into epel8

This commit is contained in:
Warren Togami 2019-09-19 22:15:30 -07:00
commit 7ca9b790eb
4 changed files with 175 additions and 0 deletions

2
.gitignore vendored
View File

@ -0,0 +1,2 @@
/libfaketime-0.9.6.tar.gz
/libfaketime-0.9.8.tar.xz

View File

@ -0,0 +1,26 @@
From 108370f850e5efd18f4989370cdc6ea6a2f74206 Mon Sep 17 00:00:00 2001
From: Wolfgang Hommel <wolfgang.hommel@unibw.de>
Date: Thu, 29 Aug 2019 09:55:04 +0200
Subject: [PATCH] Adds FORCE_PTHREAD_NONVER flag for platforms where pthread
functions are not intercepted
---
src/libfaketime.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libfaketime.c b/src/libfaketime.c
index 5e7ebdf..b70a3d3 100644
--- a/src/libfaketime.c
+++ b/src/libfaketime.c
@@ -3157,7 +3157,7 @@ int pthread_cond_timedwait_232(pthread_cond_t *cond, pthread_mutex_t *mutex, con
}
__asm__(".symver pthread_cond_timedwait_225, pthread_cond_timedwait@GLIBC_2.2.5");
-#ifdef __ARM_ARCH
+#if defined __ARM_ARCH || defined FORCE_PTHREAD_NONVER
__asm__(".symver pthread_cond_timedwait_232, pthread_cond_timedwait@@");
__asm__(".symver pthread_cond_init_232, pthread_cond_init@@");
__asm__(".symver pthread_cond_destroy_232, pthread_cond_destroy@@");
--
2.21.0

146
libfaketime.spec Normal file
View File

@ -0,0 +1,146 @@
Summary: Manipulate system time per process for testing purposes
Name: libfaketime
Version: 0.9.8
Release: 4%{?dist}
License: GPLv2+
Url: https://github.com/wolfcw/libfaketime
Source: libfaketime-0.9.8.tar.xz
Patch0: libfaketime-0.9.8-FORCE_PTHREAD_NONVER.patch
BuildRequires: gcc
BuildRequires: perl-interpreter
BuildRequires: perl-Time-HiRes
%description
libfaketime intercepts various system calls which programs use to
retrieve the current date and time. It can then report faked dates and
times (as specified by you, the user) to these programs. This means you
can modify the system time a program sees without having to change the
time system- wide.
%prep
%setup -q
%patch0 -p1
%build
cd src
# https://github.com/wolfcw/libfaketime/blob/master/README.packagers
# Upstream libfaketime requires a mess of different compile time flags for different glibc versions and architectures.
# https://github.com/wolfcw/libfaketime/pull/178
# Goal is to build time autodetect these with autotools in the next release ...
FAKETIME_COMPILE_CFLAGS="BOGUS"
%if 0%{?el7}
%ifarch x86_64
echo "force_monotonic https://github.com/wolfcw/libfaketime/issues/202"
export FAKETIME_COMPILE_CFLAGS="-DFORCE_MONOTONIC_FIX"
%endif
%ifarch aarch64 ppc64le
echo "force_monotonic and pthread_nonver https://github.com/wolfcw/libfaketime/issues/205"
export FAKETIME_COMPILE_CFLAGS="-DFORCE_MONOTONIC_FIX -DFORCE_PTHREAD_NONVER"
%endif
%endif
%if 0%{?fedora} == 30 || 0%{?el8}
# only ppc64le needs a workaround
%ifarch ppc64le
echo "pthread_nonver https://github.com/wolfcw/libfaketime/issues/204"
export FAKETIME_COMPILE_CFLAGS="-DFORCE_PTHREAD_NONVER"
%else
unset FAKETIME_COMPILE_CFLAGS
%endif
%endif
%if 0%{?fedora} >= 31
# for reasons we don't know the old glibc workaround is required here but not on archv7hl and aarch64 ...
%ifarch i686 x86_64 s390x
echo "force_monotonic"
export FAKETIME_COMPILE_CFLAGS="-DFORCE_MONOTONIC_FIX"
%endif
%ifarch ppc64le
echo "force_monotonic and pthread_nonver"
export FAKETIME_COMPILE_CFLAGS="-DFORCE_MONOTONIC_FIX -DFORCE_PTHREAD_NONVER"
%endif
%ifarch armv7hl aarch64
unset FAKETIME_COMPILE_CFLAGS
%endif
%endif
if [ "$FAKETIME_COMPILE_CFLAGS" == "BOGUS" ]; then
echo "SHOULD NEVER REACH HERE ... YOU HAVE AN UNTESTED VERSION+ARCH, see rpm spec for details ... ABORT"
exit 1
fi
CFLAGS="%{optflags} -Wno-nonnull-compare -Wno-strict-aliasing" make %{?_smp_mflags} \
PREFIX="%{_prefix}" LIBDIRNAME="/%{_lib}/faketime" all
%check
make %{?_smp_mflags} -C test all
%install
make PREFIX="%{_prefix}" DESTDIR=%{buildroot} LIBDIRNAME="/%{_lib}/faketime" install
rm -r %{buildroot}/%{_docdir}/faketime
# needed for stripping/debug package
chmod a+rx %{buildroot}/%{_libdir}/faketime/*.so.*
%files
%{_bindir}/faketime
%dir %attr(0755, root, root) %{_libdir}/faketime/
%attr(0755, root, root) %{_libdir}/faketime/libfaketime*so.*
%doc README COPYING NEWS README README.developers
%{_mandir}/man1/*
%changelog
* Tue Sep 03 2019 Warren Togami <warren@blockstream.com> - 0.9.8-4
- upstream says to use FORCE_PTHREAD_NONVER on any glibc+arch that gets stuck
For Fedora 31+ "make test" gets stuck on i686 x86_64 ppc64le s390x
* Wed Aug 28 2019 Warren Togami <warren@blockstream.com> - 0.9.8-3
- 0.9.8
- x86_64 EL7: DFORCE_MONOTONIC_FIX
aarch64 EL7: DFORCE_MONOTONIC_FIX and FORCE_PTHREAD_NONVER
ppc64le EL7: DFORCE_MONOTONIC_FIX and FORCE_PTHREAD_NONVER
ppc64le F30+ FORCE_PTHREAD_NONVER
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Oct 12 2016 Paul Wouters <pwouters@redhat.com> - 0.9.6-4
- Add support for CLOCK_BOOTTIME (patch by Mario Pareja <pareja.mario@gmail.com>)
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Oct 28 2014 Paul Wouters <pwouters@redhat.com> - 0.9.6-1
- Upgraded to 0.9.6 which adds option to disable monotonic time faking
- fix permissions for symbol stripping for debug package
* Tue Oct 15 2013 Paul Wouters <pwouters@redhat.com> - 0.9.5-4
- Infinite recursion patch is still needed, make test causes
segfaults otherwise.
* Mon Oct 14 2013 Paul Wouters <pwouters@redhat.com> - 0.9.5-3
- Work around from upstream for autodetecting glibc version bug on i686
* Mon Oct 14 2013 Paul Wouters <pwouters@redhat.com> - 0.9.5-2
- Remove use of ifarch for _lib macro for multilib
* Sun Oct 13 2013 Paul Wouters <pwouters@redhat.com> - 0.9.5-1
- Initial package

View File

@ -0,0 +1 @@
SHA512 (libfaketime-0.9.8.tar.xz) = 6b0deab7aea6b68c3a1e77c022d7a907b7337f75cfce510044c239c7f789e73ed5f1ee3b23ea5b6c8b0cb723c41ed95c1dd9738cca49b9c9840b9022fbfb57b1