summaryrefslogtreecommitdiff
path: root/package/pam/patches/patch-modules_pam_timestamp_hmacfile
blob: 5cc35d24eccbe1c6170a81ebffb0100281434bd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
--- Linux-PAM-1.1.4.orig/modules/pam_timestamp/hmacfile	2011-06-21 11:37:55.000000000 +0200
+++ Linux-PAM-1.1.4/modules/pam_timestamp/hmacfile	2012-07-31 12:03:27.000000000 +0200
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 
 # hmacfile - temporary wrapper script for .libs/hmacfile
 # Generated by ltmain.sh (GNU libtool) 2.2.6
@@ -11,7 +11,7 @@
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='/bin/sed -e 1s/^X//'
+Xsed='/Volumes/adk/openadk/scripts/sed -e 1s/^X//'
 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
 
 # Be Bourne compatible
@@ -32,13 +32,13 @@ DUALCASE=1; export DUALCASE # for MKS sh
 # if CDPATH is set.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-relink_command=""
+relink_command="(cd /Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/modules/pam_timestamp; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/Volumes/adk/openadk/scripts:/Volumes/adk/openadk/bin/tools:/Volumes/adk/openadk/host_i686_eglibc/bin:/Volumes/adk/openadk/host_i686_eglibc/usr/bin:/Volumes/adk/openadk/target_i686_eglibc/scripts:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MacGPG2/bin:/usr/X11/bin; export PATH; /Volumes/adk/openadk/host_i686_eglibc/bin/i686-openadk-linux-gnu-gcc -I../../libpam/include -I../../libpamc/include -march=i686 -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wwrite-strings -Winline -Wshadow -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_i686_eglibc/usr/lib -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -o \$progdir/\$file hmacfile.o hmacsha1.o sha1.o  -L/Volumes/adk/openadk/target_i686_eglibc/lib -L/Volumes/adk/openadk/target_i686_eglibc/usr/lib -L/Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/libpam /Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/libpam/.libs/libpam.so -ldl -Wl,-rpath -Wl,/Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/libpam/.libs)"
 
 # This environment variable determines our operation mode.
 if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
   # install mode needs the following variables:
   generated_by_libtool_version='2.2.6'
-  notinst_deplibs=' /data/git/Linux-PAM/libpam/libpam.la'
+  notinst_deplibs=' /Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/libpam/libpam.la'
 else
   # When we are sourced in execute mode, $file and $ECHO are already set.
   if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
@@ -53,7 +53,7 @@ else
       :
     else
       # Restart under the correct shell, and then maybe $ECHO will work.
-      exec /bin/sh "$0" --no-reexec ${1+"$@"}
+      exec /bin/bash "$0" --no-reexec ${1+"$@"}
     fi
   fi
 
@@ -62,7 +62,7 @@ else
   test "x$thisdir" = "x$file" && thisdir=.
 
   # Follow symbolic links until we get to the real thisdir.
-  file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
+  file=`ls -ld "$file" | /Volumes/adk/openadk/scripts/sed -n 's/.*-> //p'`
   while test -n "$file"; do
     destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
 
@@ -75,7 +75,7 @@ else
     fi
 
     file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
-    file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
+    file=`ls -ld "$thisdir/$file" | /Volumes/adk/openadk/scripts/sed -n 's/.*-> //p'`
   done
 
 
@@ -98,20 +98,38 @@ else
   absdir=`cd "$thisdir" && pwd`
   test -n "$absdir" && thisdir="$absdir"
 
-  program='hmacfile'
+  program=lt-'hmacfile'
   progdir="$thisdir/.libs"
 
+  if test ! -f "$progdir/$program" ||
+     { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /Volumes/adk/openadk/scripts/sed 1q`; \
+       test "X$file" != "X$progdir/$program"; }; then
 
-  if test -f "$progdir/$program"; then
-    # Add our own library path to LD_LIBRARY_PATH
-    LD_LIBRARY_PATH="/data/git/Linux-PAM/libpam/.libs:$LD_LIBRARY_PATH"
+    file="$$-$program"
 
-    # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    LD_LIBRARY_PATH=`$ECHO "X$LD_LIBRARY_PATH" | $Xsed -e 's/::*$//'`
+    if test ! -d "$progdir"; then
+      mkdir "$progdir"
+    else
+      rm -f "$progdir/$file"
+    fi
 
-    export LD_LIBRARY_PATH
+    # relink executable if necessary
+    if test -n "$relink_command"; then
+      if relink_command_output=`eval $relink_command 2>&1`; then :
+      else
+	echo "$relink_command_output" >&2
+	rm -f "$progdir/$file"
+	exit 1
+      fi
+    fi
+
+    mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
+    { rm -f "$progdir/$program";
+      mv -f "$progdir/$file" "$progdir/$program"; }
+    rm -f "$progdir/$file"
+  fi
 
+  if test -f "$progdir/$program"; then
     if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
       # Run the actual program with our arguments.