summaryrefslogtreecommitdiffstats
path: root/tests/deckard/contrib/libfaketime/packaging/Linux
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
commit3d0386f27ca66379acf50199e1d1298386eeeeb8 (patch)
treef87bd4a126b3a843858eb447e8fd5893c3ee3882 /tests/deckard/contrib/libfaketime/packaging/Linux
parentInitial commit. (diff)
downloadknot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.tar.xz
knot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.zip
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/deckard/contrib/libfaketime/packaging/Linux')
-rw-r--r--tests/deckard/contrib/libfaketime/packaging/Linux/Arch/PKGBUILD-32bit.txt25
-rw-r--r--tests/deckard/contrib/libfaketime/packaging/Linux/Debian/avoid-spurious-lrt.patch30
-rw-r--r--tests/deckard/contrib/libfaketime/packaging/Linux/Debian/control40
-rw-r--r--tests/deckard/contrib/libfaketime/packaging/Linux/Debian/fix-infinite-recursion-on-real_clock_gettime.patch29
-rwxr-xr-xtests/deckard/contrib/libfaketime/packaging/Linux/Debian/libfaketime.install3
-rwxr-xr-xtests/deckard/contrib/libfaketime/packaging/Linux/Debian/rules17
-rw-r--r--tests/deckard/contrib/libfaketime/packaging/Linux/Redhat/libfaketime-fix-infinite-recursion-on-real_clock_gettime.patch13
-rw-r--r--tests/deckard/contrib/libfaketime/packaging/Linux/Redhat/libfaketime.spec.txt55
8 files changed, 212 insertions, 0 deletions
diff --git a/tests/deckard/contrib/libfaketime/packaging/Linux/Arch/PKGBUILD-32bit.txt b/tests/deckard/contrib/libfaketime/packaging/Linux/Arch/PKGBUILD-32bit.txt
new file mode 100644
index 0000000..a87dc35
--- /dev/null
+++ b/tests/deckard/contrib/libfaketime/packaging/Linux/Arch/PKGBUILD-32bit.txt
@@ -0,0 +1,25 @@
+# Maintainer: Robert Orzanna <orschiro@gmail.com>
+
+_pkgbasename=libfaketime
+pkgname=lib32-$_pkgbasename
+pkgver=0.9.5
+pkgrel=1
+pkgdesc='Report fake dates and times to programs without having to change the system-wide time.'
+arch=('x86_64')
+url='http://www.code-wizards.com/projects/libfaketime/'
+license=('GPL2')
+source=("http://www.code-wizards.com/projects/${_pkgbasename}/${_pkgbasename}-${pkgver}.tar.gz"
+ 'lib32.patch')
+md5sums=('89b5c71e6c6a93b1c6feba374ac37719'
+ '0a01f842df4c8acbd2b081be046e8d67')
+
+build() {
+ cd "${_pkgbasename}-${pkgver}"
+ patch -p1 -i ../lib32.patch
+ make
+}
+
+package() {
+ cd "${_pkgbasename}-${pkgver}"
+ make PREFIX=/usr DESTDIR="${pkgdir}" install
+} \ No newline at end of file
diff --git a/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/avoid-spurious-lrt.patch b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/avoid-spurious-lrt.patch
new file mode 100644
index 0000000..c2f3f3f
--- /dev/null
+++ b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/avoid-spurious-lrt.patch
@@ -0,0 +1,30 @@
+Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+
+On i386 systems, for some reason if i do not clean up this extra -lrt, i get the following error:
+
+ [...]
+make[1]: Entering directory `/home/dkg/src/faketime/faketime/src'
+cc -o libfaketime.o -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -std=gnu99 -Wall -Wextra -Werror -DFAKE_STAT -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'/usr/local'"' -DLIBDIRNAME='"'/lib/faketime'"' -DMULTI_ARCH libfaketime.c
+cc -o libfaketime.so.1 -Wl,-soname,libfaketime.so.1 -Wl,-z,relro -Wl,--version-script=libfaketime.map -lrt -shared libfaketime.o -ldl -lm -lpthread -lrt
+libfaketime.o: In function `ft_cleanup':
+/home/dkg/src/faketime/faketime/src/libfaketime.c:1277: multiple definition of `timer_gettime'
+/home/dkg/src/faketime/faketime/src/libfaketime.c:1277: multiple definition of `timer_settime'
+collect2: error: ld returned 1 exit status
+make[1]: *** [libfaketime.so.1] Error 1
+ [...]
+
+I confess i don't really understand why removing this would fix
+things, but i also don't see the need to have multiple attempts to
+link to librt.
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -69,7 +69,7 @@
+
+ CFLAGS += -std=gnu99 -Wall -Wextra -Werror -DFAKE_STAT -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"'
+ LIB_LDFLAGS += -shared
+-LDFLAGS += -Wl,--version-script=libfaketime.map -lrt
++LDFLAGS += -Wl,--version-script=libfaketime.map
+ LDADD += -ldl -lm -lpthread -lrt
+
+ SRC = libfaketime.c
diff --git a/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/control b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/control
new file mode 100644
index 0000000..e8291a8
--- /dev/null
+++ b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/control
@@ -0,0 +1,40 @@
+Source: faketime
+Section: utils
+Priority: extra
+Maintainer: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+Build-Depends:
+ debhelper (>= 9),
+ dh-exec (>= 0.3)
+Standards-Version: 3.9.4
+Homepage: http://www.code-wizards.com/projects/libfaketime/
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/faketime.git
+Vcs-Git: git://anonscm.debian.org/collab-maint/faketime.git
+
+Package: faketime
+Architecture: any
+Pre-Depends: multiarch-support
+Depends: ${shlibs:Depends}, ${misc:Depends}, libfaketime (= ${binary:Version})
+Multi-Arch: foreign
+Description: report faked system time to programs
+ The Fake Time Preload Library (FTPL, a.k.a. 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. FTPL allows you to specify both absolute dates (e.g.,
+ 2004-01-01) and relative dates (e.g., 10 days ago).
+
+Package: libfaketime
+Architecture: any
+Pre-Depends: multiarch-support
+Multi-Arch: same
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: report faked system time to programs
+ The Fake Time Preload Library (FTPL, a.k.a. 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. FTPL allows you to specify both absolute dates (e.g.,
+ 2004-01-01) and relative dates (e.g., 10 days ago).
+
diff --git a/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/fix-infinite-recursion-on-real_clock_gettime.patch b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/fix-infinite-recursion-on-real_clock_gettime.patch
new file mode 100644
index 0000000..2fd64f5
--- /dev/null
+++ b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/fix-infinite-recursion-on-real_clock_gettime.patch
@@ -0,0 +1,29 @@
+From: Gerardo Malazdrewicz <gerardo@malazdrewicz.com.ar>
+To: 699559@bugs.debian.org
+Subject: Avoiding loop (very dirty patch)
+Date: Tue, 26 Mar 2013 01:18:05 +0100
+
+[Message part 1 (text/plain, inline)]
+
+Attached patch works for me, but it is very very dirty.
+
+Possibly side effects.
+
+Alternative seems to be to protect the call to real_clock_gettime so it is
+executed just once (to validate the parameters). Subsequent calls are not
+needed (parameters have been validated).
+
+Thanks,
+ Gerardo
+
+--- a/src/libfaketime.c
++++ b/src/libfaketime.c
+@@ -1380,7 +1380,7 @@ void __attribute__ ((constructor)) ftpl_init(void)
+ real_clock_get_time = dlsym(RTLD_NEXT, "clock_get_time");
+ real_clock_gettime = apple_clock_gettime;
+ #else
+- real_clock_gettime = dlsym(RTLD_NEXT, "clock_gettime");
++ real_clock_gettime = dlsym(RTLD_NEXT, "__clock_gettime");
+ #ifdef FAKE_TIMERS
+ real_timer_settime_22 = dlvsym(RTLD_NEXT, "timer_settime","GLIBC_2.2");
+ real_timer_settime_233 = dlvsym(RTLD_NEXT, "timer_settime","GLIBC_2.3.3");
diff --git a/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/libfaketime.install b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/libfaketime.install
new file mode 100755
index 0000000..0c2fb6b
--- /dev/null
+++ b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/libfaketime.install
@@ -0,0 +1,3 @@
+#!/usr/bin/dh-exec
+src/libfaketime.so.1 usr/lib/${DEB_HOST_MULTIARCH}/faketime/
+src/libfaketimeMT.so.1 usr/lib/${DEB_HOST_MULTIARCH}/faketime/
diff --git a/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/rules b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/rules
new file mode 100755
index 0000000..cf3813a
--- /dev/null
+++ b/tests/deckard/contrib/libfaketime/packaging/Linux/Debian/rules
@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+
+# Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+# Date: Tue, 26 Aug 2008 14:24:50 -0400
+
+export DEB_CFLAGS_MAINT_APPEND=-DMULTI_ARCH
+
+# make sure dh_makeshlibs does not modify post{inst,rm} scripts:
+# (avoids lintian's postinst-has-useless-call-to-ldconfig)
+override_dh_makeshlibs:
+ dh_makeshlibs --noscripts
+
+override_dh_installchangelogs:
+ dh_installchangelogs NEWS
+
+%:
+ PREFIX=/usr dh $@
diff --git a/tests/deckard/contrib/libfaketime/packaging/Linux/Redhat/libfaketime-fix-infinite-recursion-on-real_clock_gettime.patch b/tests/deckard/contrib/libfaketime/packaging/Linux/Redhat/libfaketime-fix-infinite-recursion-on-real_clock_gettime.patch
new file mode 100644
index 0000000..9d81e5e
--- /dev/null
+++ b/tests/deckard/contrib/libfaketime/packaging/Linux/Redhat/libfaketime-fix-infinite-recursion-on-real_clock_gettime.patch
@@ -0,0 +1,13 @@
+diff --git a/src/libfaketime.c b/src/libfaketime.c
+index 3ec372b..f70283b 100644
+--- a/src/libfaketime.c
++++ b/src/libfaketime.c
+@@ -1380,7 +1380,7 @@ void __attribute__ ((constructor)) ftpl_init(void)
+ real_clock_get_time = dlsym(RTLD_NEXT, "clock_get_time");
+ real_clock_gettime = apple_clock_gettime;
+ #else
+- real_clock_gettime = dlsym(RTLD_NEXT, "clock_gettime");
++ real_clock_gettime = dlsym(RTLD_NEXT, "__clock_gettime");
+ #ifdef FAKE_TIMERS
+ real_timer_settime_22 = dlvsym(RTLD_NEXT, "timer_settime","GLIBC_2.2");
+ real_timer_settime_233 = dlvsym(RTLD_NEXT, "timer_settime","GLIBC_2.3.3");
diff --git a/tests/deckard/contrib/libfaketime/packaging/Linux/Redhat/libfaketime.spec.txt b/tests/deckard/contrib/libfaketime/packaging/Linux/Redhat/libfaketime.spec.txt
new file mode 100644
index 0000000..48f3305
--- /dev/null
+++ b/tests/deckard/contrib/libfaketime/packaging/Linux/Redhat/libfaketime.spec.txt
@@ -0,0 +1,55 @@
+Summary: Manipulate system time per process for testing purposes
+Name: libfaketime
+Version: 0.9.5
+Release: 4%{?dist}
+License: GPLv2+
+Url: http://www.code-wizards.com/projects/%{name}/
+Source: http://www.code-wizards.com/projects/%{name}/%{name}-%{version}.tar.gz
+Group: System Environment/Libraries
+Patch1: libfaketime-0.9.5-fix-infinite-recursion-on-real_clock_gettime.patch
+
+%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
+%patch1 -p1
+# work around from upstream for autodetecting glibc version bug on i686
+sed -i -e 's/__asm__(".symver timer_gettime_22/\/\/__asm__(".symver timer_gettime_22/' src/libfaketime.c
+sed -i -e 's/__asm__(".symver timer_settime_22/\/\/__asm__(".symver timer_settime_22/' src/libfaketime.c
+
+
+%build
+cd src ; CFLAGS="$RPM_OPT_FLAGS -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
+
+%files
+%{_bindir}/faketime
+%{_libdir}/faketime/libfaketime*so.*
+%doc README COPYING NEWS README README.developers
+%{_mandir}/man1/*
+
+%changelog
+* 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