svn commit: r424827 - in head/devel: . libfaketime libfaketime/files
Kubilay Kocak
koobs at FreeBSD.org
Fri Oct 28 11:42:37 UTC 2016
Author: koobs
Date: Fri Oct 28 11:42:35 2016
New Revision: 424827
URL: https://svnweb.freebsd.org/changeset/ports/424827
Log:
[NEW] devel/libfaketime: Modifies the system time for a single application
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.
libfaketime allows you to specify both absolute dates (e.g., 01/01/2004)
and relative dates (e.g., 10 days ago).
libfaketime might be used for various purposes, for example
- Running legacy software with y2k bugs
- Testing software for year-2038 compliance
- Debugging time-related issues, such as expired SSL certificates
- Running software which ceases to run outside a certain timeframe
- Using different system-wide date and time settings, e.g., on OpenVZ-
based virtual machines running on the same host
- Deterministic build processes.
WWW: https://github.com/wolfcw/libfaketime
Added:
head/devel/libfaketime/
head/devel/libfaketime/Makefile (contents, props changed)
head/devel/libfaketime/distinfo (contents, props changed)
head/devel/libfaketime/files/
head/devel/libfaketime/files/patch-man_Makefile (contents, props changed)
head/devel/libfaketime/files/patch-src_Makefile (contents, props changed)
head/devel/libfaketime/files/patch-src_libfaketime.c (contents, props changed)
head/devel/libfaketime/files/patch-test_Makefile (contents, props changed)
head/devel/libfaketime/files/patch-test_functests_common.inc (contents, props changed)
head/devel/libfaketime/files/patch-test_functests_test__exclude__mono.sh (contents, props changed)
head/devel/libfaketime/pkg-descr (contents, props changed)
Modified:
head/devel/Makefile
Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile Fri Oct 28 11:33:06 2016 (r424826)
+++ head/devel/Makefile Fri Oct 28 11:42:35 2016 (r424827)
@@ -1239,6 +1239,7 @@
SUBDIR += libewf
SUBDIR += libexecinfo
SUBDIR += libexplain
+ SUBDIR += libfaketime
SUBDIR += libfastcommon
SUBDIR += libfastjson
SUBDIR += libffi
Added: head/devel/libfaketime/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libfaketime/Makefile Fri Oct 28 11:42:35 2016 (r424827)
@@ -0,0 +1,41 @@
+# Created by: Kubilay Kocak <koobs at FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= libfaketime
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.9.6-20160627
+CATEGORIES= devel
+
+MAINTAINER= koobs at FreeBSD.org
+COMMENT= Modifies the system time for a single application
+
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+USES= gmake shebangfix
+USE_GITHUB= yes
+USE_LDCONFIG= yes
+
+GH_ACCOUNT= wolfcw
+GH_TAGNAME= da77808
+
+MAKE_ENV+= WARNS="-Wall" \
+ MANIR="${MANDIRS}"
+
+PLIST_FILES= bin/faketime \
+ lib/faketime/libfaketime.so.1 \
+ lib/faketime/libfaketimeMT.so.1 \
+ share/doc/faketime/NEWS \
+ share/doc/faketime/README \
+ share/man/man1/faketime.1.gz
+
+SHEBANG_FILES= test/testframe.sh \
+ test/functests/common.inc
+
+TEST_TARGET= test
+
+post-install:
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/faketime \
+ ${STAGEDIR}${PREFIX}/lib/faketime/*.so.*
+
+.include <bsd.port.mk>
Added: head/devel/libfaketime/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libfaketime/distinfo Fri Oct 28 11:42:35 2016 (r424827)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1477653378
+SHA256 (wolfcw-libfaketime-v0.9.6-20160627-da77808_GH0.tar.gz) = 59d42d762fa1372325486082d9498c0ce6dcb2446ed567bc5f0d85a7c2f1b017
+SIZE (wolfcw-libfaketime-v0.9.6-20160627-da77808_GH0.tar.gz) = 55667
Added: head/devel/libfaketime/files/patch-man_Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libfaketime/files/patch-man_Makefile Fri Oct 28 11:42:35 2016 (r424827)
@@ -0,0 +1,22 @@
+--- man/Makefile.orig 2016-06-27 06:54:00 UTC
++++ man/Makefile
+@@ -1,14 +1,16 @@
+ INSTALL ?= install
+
+ PREFIX ?= /usr/local
++MANDIR ?= /share/man
+
+ all:
+
+ install:
+- $(INSTALL) -Dm0644 faketime.1 "${DESTDIR}${PREFIX}/share/man/man1/faketime.1"
+- gzip -f "${DESTDIR}${PREFIX}/share/man/man1/faketime.1"
++ $(INSTALL) -dm0755 "${DESTDIR}${PREFIX}$(MANDIR)/man1"
++ $(INSTALL) -Dm0644 faketime.1 "$(DESTDIR)$(PREFIX)$(MANDIR)/man1"
++ gzip -f $(DESTDIR)$(PREFIX)$(MANDIR)/man1/faketime.1
+
+ uninstall:
+- rm -f "${DESTDIR}${PREFIX}/share/man/man1/faketime.1.gz"
++ rm -f "$(DESTDIR)$(PREFIX)$(MANDIR)/man1/faketime.1.gz"
+
+ .PHONY: all install uninstall
Added: head/devel/libfaketime/files/patch-src_Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libfaketime/files/patch-src_Makefile Fri Oct 28 11:42:35 2016 (r424827)
@@ -0,0 +1,33 @@
+--- src/Makefile.orig 2016-06-27 06:54:00 UTC
++++ src/Makefile
+@@ -62,11 +62,19 @@ PREFIX ?= /usr/local
+ LIBDIRNAME ?= /lib/faketime
+ PLATFORM ?=$(shell uname)
+
+-CFLAGS += -std=gnu99 -Wall -Wextra -Werror -DFAKE_STAT -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"'
++# Honour/Respect User *FLAGS
++# User variables come LAST. Do NOT append to them.
++
++WARNS ?= -Wall -Wextra -Werror
++FEATS ?= -DFAKE_STAT -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS
++FLAGS ?= -std=gnu99 -fPIC $(WARNS) -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"'
++
+ ifeq ($(PLATFORM),SunOS)
+-CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
++FLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
+ endif
+
++CFLAGS := $(FLAGS) $(CFLAGS)
++
+ LIB_LDFLAGS += -shared
+
+ LDFLAGS += -lpthread
+@@ -74,7 +82,7 @@ ifneq ($(PLATFORM),SunOS)
+ LDFLAGS += -Wl,--version-script=libfaketime.map
+ endif
+
+-LDADD += -ldl -lm -lrt
++LDADD += -lm -lrt
+ BIN_LDFLAGS += -lrt
+
+ SRC = libfaketime.c
Added: head/devel/libfaketime/files/patch-src_libfaketime.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libfaketime/files/patch-src_libfaketime.c Fri Oct 28 11:42:35 2016 (r424827)
@@ -0,0 +1,29 @@
+--- src/libfaketime.c.orig 2016-06-27 06:54:00 UTC
++++ src/libfaketime.c
+@@ -23,6 +23,17 @@
+
+ #define _GNU_SOURCE /* required to get RTLD_NEXT defined */
+
++/*
++ * libfaketime.c:1246:5: error: conflicting types for 'gettimeofday'
++ * int gettimeofday(struct timeval *tv, void *tz)
++ * vs
++ * int gettimeofday(struct timeval *, struct timezone *);
++ */
++
++#define gettimeofday bsd_gettimeofday
++#include <sys/time.h>
++#undef gettimeofday
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdint.h>
+@@ -58,6 +69,8 @@
+ extern char *__progname;
+ #ifdef __sun
+ #include "sunos_endian.h"
++#elif defined(__FreeBSD__)
++#include <sys/endian.h>
+ #else
+ #include <endian.h>
+ #endif
Added: head/devel/libfaketime/files/patch-test_Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libfaketime/files/patch-test_Makefile Fri Oct 28 11:42:35 2016 (r424827)
@@ -0,0 +1,13 @@
+--- test/Makefile.orig 2016-06-27 06:54:00 UTC
++++ test/Makefile
+@@ -1,7 +1,7 @@
+-CC = gcc
++CC ?= gcc
+
+-CFLAGS = -std=gnu99 -Wall -DFAKE_STAT -Werror -Wextra
+-LDFLAGS = -lrt
++CFLAGS ?= -std=gnu99 -Wall -DFAKE_STAT -Werror -Wextra
++LDFLAGS = -lrt -lcompat
+
+ SRC = timetest.c
+ OBJ = ${SRC:.c=.o}
Added: head/devel/libfaketime/files/patch-test_functests_common.inc
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libfaketime/files/patch-test_functests_common.inc Fri Oct 28 11:42:35 2016 (r424827)
@@ -0,0 +1,12 @@
+--- test/functests/common.inc.orig 2016-10-28 11:24:53 UTC
++++ test/functests/common.inc
+@@ -8,7 +8,8 @@ platform()
+ case "$out" in
+ *Darwin*) echo "mac" ;;
+ *Linux*) echo "linuxlike" ;;
+- GNU|GNU/kFreeBSD) echo "linuxlike" ;;
++ GNU|GNU/kFreeBSD) echo "linuxlike" ;;
++ *FreeBSD*) echo "linuxlike" ;;
+ *SunOS*) echo "sunos" ;;
+ *) echo 1>&2 unsupported platform, uname=\"$out\" ;;
+ esac
Added: head/devel/libfaketime/files/patch-test_functests_test__exclude__mono.sh
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libfaketime/files/patch-test_functests_test__exclude__mono.sh Fri Oct 28 11:42:35 2016 (r424827)
@@ -0,0 +1,11 @@
+--- test/functests/test_exclude_mono.sh.orig 2016-06-27 06:54:00 UTC
++++ test/functests/test_exclude_mono.sh
+@@ -65,7 +65,7 @@ get_monotonic_time()
+ dont_fake_mono=$1; shift;
+ clock_id=$1; shift;
+ DONT_FAKE_MONOTONIC=${dont_fake_mono} fakecmd "2014-07-21 09:00:00" \
+- /bin/bash -c "for i in 1 2; do \
++ /usr/bin/env bash -c "for i in 1 2; do \
+ perl -w -MTime::HiRes=clock_gettime,${clock_id} -E \
+ 'say clock_gettime(${clock_id})'; \
+ sleep 1; \
Added: head/devel/libfaketime/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libfaketime/pkg-descr Fri Oct 28 11:42:35 2016 (r424827)
@@ -0,0 +1,20 @@
+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.
+
+libfaketime allows you to specify both absolute dates (e.g., 01/01/2004)
+and relative dates (e.g., 10 days ago).
+
+libfaketime might be used for various purposes, for example
+
+- Running legacy software with y2k bugs
+- Testing software for year-2038 compliance
+- Debugging time-related issues, such as expired SSL certificates
+- Running software which ceases to run outside a certain timeframe
+- Using different system-wide date and time settings, e.g., on OpenVZ-
+ based virtual machines running on the same host
+- Deterministic build processes.
+
+WWW: https://github.com/wolfcw/libfaketime
More information about the svn-ports-head
mailing list