Codebase list datefudge / de3490f
Multi-arch support, bump Standards-Version, and debian/compat * Introduce multi-arch support which allows one to use datefudge with 32-bit commands on 64-bit system (providing that both 32-bit and 64-bit versions of this package are installed on system) (LP: #1103281): + install datefudge.so library into /usr/lib/datefudge/<arch-tripplet>; + add each /u/l/d/<arch-tripplet> to LD_LIBRARY_PATH in datefudge scipt; + mark binary package as `Multi-Arch: same'. * Use debhelper v9. * debian/control: + Standards-Version: 3.9.4 (no changes). Robert Luberda 11 years ago
6 changed file(s) with 94 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
88 INSTALL_PROGRAM := "install"
99 endif
1010
11 compile all: datefudge datefudge.so
11 prefix = /usr
12 libdir = $(prefix)/lib/datefudge
13 libarch =
14 marchpt = $(shell echo '$(libarch)' | sed -e 's|[^-]|*|g; s|\*\**|*|g; s|^.|/&|')
15 bindir = $(prefix)/bin
16 mandir = $(prefix)/share/man
17
18 all compile: datefudge datefudge.so datefudge.1
1219
1320 install: datefudge datefudge.so datefudge.1
14 install -d $(DESTDIR)/usr/lib/datefudge/
15 $(INSTALL_PROGRAM) -o root -g root -m 644 datefudge.so $(DESTDIR)/usr/lib/datefudge/datefudge.so
16 install -d $(DESTDIR)/usr/bin/
17 $(INSTALL_PROGRAM) -o root -g root -m 755 datefudge $(DESTDIR)/usr/bin
18 install -d $(DESTDIR)/usr/share/man/man1
19 install -o root -g root -m 644 datefudge.1 $(DESTDIR)/usr/share/man/man1
21 install -d $(DESTDIR)$(libdir)/$(libarch)
22 $(INSTALL_PROGRAM) -o root -g root -m 644 datefudge.so $(DESTDIR)$(libdir)/$(libarch)/datefudge.so
23 install -d $(DESTDIR)$(bindir)
24 $(INSTALL_PROGRAM) -o root -g root -m 755 datefudge $(DESTDIR)$(bindir)
25 install -d $(DESTDIR)$(mandir)/man1
26 install -o root -g root -m 644 datefudge.1 $(DESTDIR)$(mandir)/man1
2027
2128 datefudge: datefudge.sh
22 sed -e 's,@VERSION@,$(VERSION),g' < $< > $@
29 datefudge.1: datefudge.man
30
31 datefudge datefudge.1:
32 sed -e 's,@VERSION@,$(VERSION),g; s,@MULTIARCH_PATTERN@,$(marchpt),g; s,@LIBDIR@,$(libdir),g;' \
33 < $< > $@
2334
2435 datefudge.so: datefudge.o
2536 $(CC) $(LDFLAGS) -o $@ -shared $< -ldl -lc
2637
2738 datefudge.o: datefudge.c
2839 $(CC) $(CFLAGS) -c -o $@ $<
29
30 datefudge.1: datefudge.man
31 sed -e 's,@VERSION@,$(VERSION),g' < $< > $@
3240
3341 clean:
3442 rm -f datefudge.o datefudge.so datefudge datefudge.1
00 #!/bin/sh
1
1 # vim:noet:ts=2
22 # Fake the system time
3
43
54 dat="$1"
65 static=0
7
86
97 if [ "$dat" = "-s" -o "$dat" = "--static" ] ; then
108 static=1
2927
3028 # Assume that 'date' already printed an error message
3129 sec1=$(date -d "$dat" '+%s')
32 if [ $? -ne 0 ] ; then exit 1 ; fi
30 [ $? -eq 0 ] || exit 1
3331
3432 sec2=$(expr $(date '+%s') - $sec1)
35 if [ $? -ne 0 ] ; then exit 1 ; fi
33 [ $? -eq 0 ] || exit 1
3634
37 export LD_PRELOAD="${LD_PRELOAD}${LD_PRELOAD:+:}/usr/lib/datefudge/datefudge.so"
38 if [ "$static" = "1" ]; then
39 export DATEFUDGE=$sec1
40 export DATEFUDGE_DOSTATIC="1"
41 else
42 export DATEFUDGE=$sec2
43 unset DATEFUDGE_DOSTATIC
44 fi
35 add_ld_preload()
36 {
37 export LD_PRELOAD="${1}${LD_PRELOAD:+:}${LD_PRELOAD}"
38 }
39
40 add_ld_library_path()
41 {
42 export LD_LIBRARY_PATH="${1}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"
43 }
44
45 set_ld_environment()
46 {
47 lib="datefudge.so"
48 libpath="@LIBDIR@"
49 set -- "$libpath"@MULTIARCH_PATTERN@/"$lib"
50 if [ ! -e "$1" ]; then
51 echo "Cannot find $lib in $libpath" >&2
52 [ -z "$POSH_VERSION" ] || echo "You might have just encountered posh bug#636601, please try using another shell." >&2
53 exit 1;
54 fi
55 for path in "$@"; do
56 add_ld_library_path "${path%/*}"
57 done
58 add_ld_preload "$lib"
59 }
60
61 set_datefudge_vars()
62 {
63 if [ "$static" = "1" ]; then
64 export DATEFUDGE=$sec1
65 export DATEFUDGE_DOSTATIC="1"
66 else
67 export DATEFUDGE=$sec2
68 unset DATEFUDGE_DOSTATIC
69 fi
70 }
71
72
73 set_ld_environment
74 set_datefudge_vars
4575
4676 exec "$@"
0 datefudge (1.18) unstable; urgency=low
1
2 * Introduce multi-arch support which allows one to use datefudge with 32-bit
3 commands on 64-bit system (providing that both 32-bit and 64-bit versions
4 of this package are installed on system) (LP: #1103281):
5 + install datefudge.so library into /usr/lib/datefudge/<arch-tripplet>;
6 + add each /u/l/d/<arch-tripplet> to LD_LIBRARY_PATH in datefudge scipt;
7 + mark binary package as `Multi-Arch: same'.
8 * Use debhelper v9.
9 * debian/control:
10 + fix Vcs-Browser field;
11 + Standards-Version: 3.9.4 (no changes).
12
13 -- Robert Luberda <robert@debian.org> Sat, 11 May 2013 19:02:11 +0200
14
015 datefudge (1.17) unstable; urgency=low
116
217 * datefudge.{c,man}: Add the `--static' option for static dates.
11 Section: devel
22 Priority: optional
33 Maintainer: Robert Luberda <robert@debian.org>
4 Standards-Version: 3.9.2
5 Build-Depends: debhelper (>= 8)
4 Standards-Version: 3.9.4
5 Build-Depends: debhelper (>= 9)
66 Vcs-Git: git://anonscm.debian.org/users/robert/datefudge.git
77 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=users/robert/datefudge.git;a=summary
88
99 Package: datefudge
1010 Architecture: any
1111 Depends: ${shlibs:Depends}, ${misc:Depends}
12 Pre-Depends: ${misc:Pre-Depends}
13 Multi-Arch: same
1214 Description: Fake the system date
1315 This program (and preload library) fakes the system date so that
1416 programs think the wall clock is ... different.
00 #!/usr/bin/make -f
1 # $Id: rules 17 2011-02-13 12:29:49Z robert $
21
32 export CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
43 export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
54
5 export libarch := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
6
67 binary binary-arch build build-arch clean:
78 dh $@
89
10
911 binary-indep build-indep: # Nothing to do
12
13 override_dh_auto_build:
14 dh_auto_build -- libarch="$(libarch)"
15
16 override_dh_auto_install:
17 dh_auto_install -- libarch="$(libarch)"
18
1019
1120 .PHONY: clean \
1221 build-indep build-arch build \
13 binary-indep binary-arch binary
22 binary-indep binary-arch binary \
23 override_dh_auto_build override_dh_auto_install