tarruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/README.txt +99 -0
  2. data/ext/extconf.rb +19 -0
  3. data/ext/libtar/COPYRIGHT +35 -0
  4. data/ext/libtar/ChangeLog +243 -0
  5. data/ext/libtar/ChangeLog-1.0.x +141 -0
  6. data/ext/libtar/INSTALL +183 -0
  7. data/ext/libtar/Makefile.in +51 -0
  8. data/ext/libtar/README +121 -0
  9. data/ext/libtar/TODO +10 -0
  10. data/ext/libtar/autoconf/ac_path_generic.m4 +136 -0
  11. data/ext/libtar/autoconf/aclocal.m4 +199 -0
  12. data/ext/libtar/autoconf/encap.m4 +133 -0
  13. data/ext/libtar/autoconf/install-sh +251 -0
  14. data/ext/libtar/autom4te.cache/output.0 +8102 -0
  15. data/ext/libtar/autom4te.cache/requests +112 -0
  16. data/ext/libtar/autom4te.cache/traces.0 +382 -0
  17. data/ext/libtar/compat/ChangeLog +31 -0
  18. data/ext/libtar/compat/README +12 -0
  19. data/ext/libtar/compat/TODO +4 -0
  20. data/ext/libtar/compat/basename.c +91 -0
  21. data/ext/libtar/compat/compat.h +260 -0
  22. data/ext/libtar/compat/dirname.c +96 -0
  23. data/ext/libtar/compat/fnmatch.c +237 -0
  24. data/ext/libtar/compat/gethostbyname_r.c +41 -0
  25. data/ext/libtar/compat/gethostname.c +36 -0
  26. data/ext/libtar/compat/getservbyname_r.c +41 -0
  27. data/ext/libtar/compat/glob.c +898 -0
  28. data/ext/libtar/compat/inet_aton.c +27 -0
  29. data/ext/libtar/compat/module.ac +591 -0
  30. data/ext/libtar/compat/snprintf.c +788 -0
  31. data/ext/libtar/compat/strdup.c +62 -0
  32. data/ext/libtar/compat/strlcat.c +72 -0
  33. data/ext/libtar/compat/strlcpy.c +68 -0
  34. data/ext/libtar/compat/strmode.c +199 -0
  35. data/ext/libtar/compat/strrstr.c +40 -0
  36. data/ext/libtar/compat/strsep.c +87 -0
  37. data/ext/libtar/config.h.in +187 -0
  38. data/ext/libtar/configure +8102 -0
  39. data/ext/libtar/configure.ac +114 -0
  40. data/ext/libtar/doc/Makefile.in +152 -0
  41. data/ext/libtar/doc/tar_append_file.3 +50 -0
  42. data/ext/libtar/doc/tar_block_read.3 +24 -0
  43. data/ext/libtar/doc/tar_extract_all.3 +43 -0
  44. data/ext/libtar/doc/tar_extract_file.3 +84 -0
  45. data/ext/libtar/doc/tar_open.3 +97 -0
  46. data/ext/libtar/doc/th_get_pathname.3 +63 -0
  47. data/ext/libtar/doc/th_print_long_ls.3 +22 -0
  48. data/ext/libtar/doc/th_read.3 +34 -0
  49. data/ext/libtar/doc/th_set_from_stat.3 +45 -0
  50. data/ext/libtar/lib/Makefile.in +92 -0
  51. data/ext/libtar/lib/append.c +272 -0
  52. data/ext/libtar/lib/block.c +384 -0
  53. data/ext/libtar/lib/decode.c +130 -0
  54. data/ext/libtar/lib/encode.c +237 -0
  55. data/ext/libtar/lib/extract.c +656 -0
  56. data/ext/libtar/lib/handle.c +150 -0
  57. data/ext/libtar/lib/internal.h +46 -0
  58. data/ext/libtar/lib/libtar.h +311 -0
  59. data/ext/libtar/lib/output.c +146 -0
  60. data/ext/libtar/lib/util.c +153 -0
  61. data/ext/libtar/lib/wrapper.c +175 -0
  62. data/ext/libtar/libtar/Makefile.in +73 -0
  63. data/ext/libtar/libtar/libtar.c +363 -0
  64. data/ext/libtar/listhash/ChangeLog +15 -0
  65. data/ext/libtar/listhash/TODO +21 -0
  66. data/ext/libtar/listhash/hash.c.in +344 -0
  67. data/ext/libtar/listhash/hash_new.3.in +74 -0
  68. data/ext/libtar/listhash/list.c.in +458 -0
  69. data/ext/libtar/listhash/list_new.3.in +86 -0
  70. data/ext/libtar/listhash/listhash.h.in +196 -0
  71. data/ext/libtar/listhash/module.ac +21 -0
  72. data/ext/libtar/win32/config.h +190 -0
  73. data/ext/libtar/win32/dirent.c +115 -0
  74. data/ext/libtar/win32/dirent.h +24 -0
  75. data/ext/libtar/win32/grp.h +4 -0
  76. data/ext/libtar/win32/listhash/libtar_hash.c +344 -0
  77. data/ext/libtar/win32/listhash/libtar_list.c +458 -0
  78. data/ext/libtar/win32/listhash/libtar_listhash.h +196 -0
  79. data/ext/libtar/win32/pwd.h +4 -0
  80. data/ext/libtar/win32/sys/param.h +8 -0
  81. data/ext/libtar/win32/tar.h +35 -0
  82. data/ext/libtar/win32/utime.h +6 -0
  83. data/ext/libtar/win32/win32/types.h +10 -0
  84. data/ext/tarruby.c +648 -0
  85. metadata +150 -0
@@ -0,0 +1,133 @@
1
+ # ENCAP_PKG([mkencap-options], [install target if enabled],
2
+ # [install target if disabled])
3
+ # ---------------------------------------------------------
4
+ # Check for Encap tools.
5
+ AC_DEFUN([ENCAP_PKG], [
6
+ MKENCAP_OPTS=$1;
7
+
8
+ # allow user to disable Encap support
9
+ AC_ARG_ENABLE([encap],
10
+ [ --disable-encap Do not configure as an Encap package],
11
+ [],
12
+ [enable_encap=default])
13
+
14
+ if test "$enable_encap" != "no"; then
15
+ # look for epkg and mkencap
16
+ AC_PATH_PROG([EPKG], [epkg])
17
+ AC_PATH_PROG([MKENCAP], [mkencap])
18
+
19
+ # enable by default if epkg or mkencap are found
20
+ if test "${EPKG:+set}" = "set" || test "${MKENCAP:+set}" = "set" && test "$enable_encap" = "default"; then
21
+ enable_encap=yes;
22
+ fi
23
+ fi
24
+
25
+ if test "$enable_encap" = "yes"; then
26
+ # generate fallback values for ${ENCAP_SOURCE} and ${ENCAP_TARGET}
27
+ # from the environment or the default prefix
28
+ if test -z "${ENCAP_SOURCE}" && test -z "${ENCAP_TARGET}"; then
29
+ ENCAP_SOURCE="${ac_default_prefix}/encap";
30
+ ENCAP_TARGET="${ac_default_prefix}";
31
+ elif test -z "${ENCAP_TARGET}"; then
32
+ ENCAP_TARGET="`dirname ${ENCAP_SOURCE}`";
33
+ elif test -z "${ENCAP_SOURCE}"; then
34
+ ENCAP_SOURCE="${ENCAP_TARGET}/encap";
35
+ fi
36
+
37
+ # if --prefix is specified:
38
+ # 1) if its next-to-last component is "encap", assume that it
39
+ # points to the package directory
40
+ # 2) otherwise, assume it points to the target directory
41
+ if test "${prefix}" != "NONE"; then
42
+ prefixdir="`dirname ${prefix}`";
43
+ prefixbase="`basename ${prefix}`";
44
+ if test "`basename ${prefixdir}`" = "encap"; then
45
+ ENCAP_SOURCE="${prefixdir}";
46
+ ENCAP_TARGET="`dirname ${ENCAP_SOURCE}`";
47
+ elif test "${prefixdir}" != "${ENCAP_SOURCE}"; then
48
+ ENCAP_SOURCE="${prefix}/encap";
49
+ ENCAP_TARGET="${prefix}";
50
+ fi
51
+ if ( test "`basename ${prefixdir}`" = "encap" || \
52
+ test "${prefixdir}" = "${ENCAP_SOURCE}" ) && \
53
+ test "${prefixbase}" != "${PACKAGE_NAME}-${PACKAGE_VERSION}"; then
54
+ ENCAP_PKGSPEC="${prefixbase}";
55
+ fi
56
+ fi
57
+
58
+ # display results
59
+ AC_MSG_CHECKING([for Encap source directory])
60
+ AC_MSG_RESULT([${ENCAP_SOURCE}])
61
+ AC_MSG_CHECKING([for Encap target directory])
62
+ AC_MSG_RESULT([${ENCAP_TARGET}])
63
+ AC_MSG_CHECKING([for Encap package directory])
64
+ if test "${ENCAP_PKGSPEC:-unset}" = "unset"; then
65
+ ENCAP_PKGSPEC='${PACKAGE_NAME}-${PACKAGE_VERSION}';
66
+ AC_MSG_RESULT([${ENCAP_SOURCE}/${PACKAGE_NAME}-${PACKAGE_VERSION}])
67
+ else
68
+ AC_MSG_RESULT([${ENCAP_SOURCE}/${ENCAP_PKGSPEC}])
69
+ fi
70
+ prefix='${ENCAP_SOURCE}/${ENCAP_PKGSPEC}';
71
+
72
+ # override default sysconfdir and localstatedir
73
+ if test "$sysconfdir" = '${prefix}/etc'; then
74
+ sysconfdir='${ENCAP_TARGET}/etc';
75
+ fi
76
+ if test "$localstatedir" = '${prefix}/var'; then
77
+ localstatedir='/var/lib/${PACKAGE_NAME}';
78
+ fi
79
+
80
+ # check for --disable-epkg-install
81
+ AC_ARG_ENABLE([epkg-install],
82
+ [ --disable-epkg-install Do not run epkg during make install],
83
+ [],
84
+ [enable_epkg_install=yes])
85
+ if test "$enable_epkg_install" = "no"; then
86
+ EPKG=":";
87
+ fi
88
+
89
+ # generate Makefile variables
90
+ dnl AC_SUBST([ENCAP_SOURCE])
91
+ dnl AC_SUBST([ENCAP_TARGET])
92
+ dnl AC_SUBST([ENCAP_PKGSPEC])
93
+ dnl AC_SUBST([EPKG])
94
+ dnl AC_SUBST([MKENCAP])
95
+ dnl AC_SUBST([MKENCAP_OPTS])
96
+ dnl
97
+ dnl m4_ifdef([EM_MAKEFILE_END], [
98
+ dnl # generate rules for make install target
99
+ dnl EM_MAKEFILE_END([[
100
+ dnl target modify <install>:
101
+ dnl command \\\${MKENCAP} \\\`test -f \\\${srcdir}/COPYRIGHT && echo -I \\\${srcdir}/COPYRIGHT\\\` \\\${MKENCAP_OPTS} -s \\\${DESTDIR}\\\${ENCAP_SOURCE} -e \\\${ENCAP_PKGSPEC}
102
+ dnl command if test -z \\\\\"\\\${DESTDIR}\\\\\"; then \
103
+ dnl \\\${EPKG} -s \\\${ENCAP_SOURCE} -t \\\${ENCAP_TARGET} \\\${ENCAP_PKGSPEC}; \
104
+ dnl fi
105
+ dnl ]])])
106
+
107
+ ENCAP_DEFS="ENCAP_SOURCE = ${ENCAP_SOURCE}\\
108
+ ENCAP_TARGET = ${ENCAP_TARGET}\\
109
+ ENCAP_PKGSPEC = ${ENCAP_PKGSPEC}\\
110
+ EPKG = ${EPKG:-:}\\
111
+ MKENCAP = ${MKENCAP:-:}\\
112
+ MKENCAP_OPTS = ${MKENCAP_OPTS}";
113
+ AC_SUBST([ENCAP_DEFS])
114
+
115
+ dnl ### generate rules for make install target
116
+ ENCAP_INSTALL_RULES='if test -f ${top_srcdir}/COPYRIGHT; then \\\
117
+ ${INSTALL_DATA} ${top_srcdir}/COPYRIGHT ${ENCAP_SOURCE}/${ENCAP_PKGSPEC}; \\\
118
+ fi\
119
+ ${MKENCAP} ${MKENCAP_OPTS} -s ${DESTDIR}${ENCAP_SOURCE} -e ${ENCAP_PKGSPEC};\
120
+ if test -z \"${DESTDIR}\"; then \\\
121
+ ${EPKG} -s ${ENCAP_SOURCE} -t ${ENCAP_TARGET} ${ENCAP_PKGSPEC}; \\\
122
+ fi';
123
+ AC_SUBST([ENCAP_INSTALL_RULES])
124
+
125
+ ENCAP_INSTALL_TARGET=$2
126
+ else
127
+ ENCAP_INSTALL_TARGET=$3
128
+ fi
129
+
130
+ AC_SUBST([ENCAP_INSTALL_TARGET])
131
+ ])
132
+
133
+
@@ -0,0 +1,251 @@
1
+ #!/bin/sh
2
+ #
3
+ # install - install a program, script, or datafile
4
+ # This comes from X11R5 (mit/util/scripts/install.sh).
5
+ #
6
+ # Copyright 1991 by the Massachusetts Institute of Technology
7
+ #
8
+ # Permission to use, copy, modify, distribute, and sell this software and its
9
+ # documentation for any purpose is hereby granted without fee, provided that
10
+ # the above copyright notice appear in all copies and that both that
11
+ # copyright notice and this permission notice appear in supporting
12
+ # documentation, and that the name of M.I.T. not be used in advertising or
13
+ # publicity pertaining to distribution of the software without specific,
14
+ # written prior permission. M.I.T. makes no representations about the
15
+ # suitability of this software for any purpose. It is provided "as is"
16
+ # without express or implied warranty.
17
+ #
18
+ # Calling this script install-sh is preferred over install.sh, to prevent
19
+ # `make' implicit rules from creating a file called install from it
20
+ # when there is no Makefile.
21
+ #
22
+ # This script is compatible with the BSD install script, but was written
23
+ # from scratch. It can only install one file at a time, a restriction
24
+ # shared with many OS's install programs.
25
+
26
+
27
+ # set DOITPROG to echo to test this script
28
+
29
+ # Don't use :- since 4.3BSD and earlier shells don't like it.
30
+ doit="${DOITPROG-}"
31
+
32
+
33
+ # put in absolute paths if you don't have them in your path; or use env. vars.
34
+
35
+ mvprog="${MVPROG-mv}"
36
+ cpprog="${CPPROG-cp}"
37
+ chmodprog="${CHMODPROG-chmod}"
38
+ chownprog="${CHOWNPROG-chown}"
39
+ chgrpprog="${CHGRPPROG-chgrp}"
40
+ stripprog="${STRIPPROG-strip}"
41
+ rmprog="${RMPROG-rm}"
42
+ mkdirprog="${MKDIRPROG-mkdir}"
43
+
44
+ transformbasename=""
45
+ transform_arg=""
46
+ instcmd="$mvprog"
47
+ chmodcmd="$chmodprog 0755"
48
+ chowncmd=""
49
+ chgrpcmd=""
50
+ stripcmd=""
51
+ rmcmd="$rmprog -f"
52
+ mvcmd="$mvprog"
53
+ src=""
54
+ dst=""
55
+ dir_arg=""
56
+
57
+ while [ x"$1" != x ]; do
58
+ case $1 in
59
+ -c) instcmd="$cpprog"
60
+ shift
61
+ continue;;
62
+
63
+ -d) dir_arg=true
64
+ shift
65
+ continue;;
66
+
67
+ -m) chmodcmd="$chmodprog $2"
68
+ shift
69
+ shift
70
+ continue;;
71
+
72
+ -o) chowncmd="$chownprog $2"
73
+ shift
74
+ shift
75
+ continue;;
76
+
77
+ -g) chgrpcmd="$chgrpprog $2"
78
+ shift
79
+ shift
80
+ continue;;
81
+
82
+ -s) stripcmd="$stripprog"
83
+ shift
84
+ continue;;
85
+
86
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
87
+ shift
88
+ continue;;
89
+
90
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
91
+ shift
92
+ continue;;
93
+
94
+ *) if [ x"$src" = x ]
95
+ then
96
+ src=$1
97
+ else
98
+ # this colon is to work around a 386BSD /bin/sh bug
99
+ :
100
+ dst=$1
101
+ fi
102
+ shift
103
+ continue;;
104
+ esac
105
+ done
106
+
107
+ if [ x"$src" = x ]
108
+ then
109
+ echo "install: no input file specified"
110
+ exit 1
111
+ else
112
+ true
113
+ fi
114
+
115
+ if [ x"$dir_arg" != x ]; then
116
+ dst=$src
117
+ src=""
118
+
119
+ if [ -d $dst ]; then
120
+ instcmd=:
121
+ chmodcmd=""
122
+ else
123
+ instcmd=mkdir
124
+ fi
125
+ else
126
+
127
+ # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
128
+ # might cause directories to be created, which would be especially bad
129
+ # if $src (and thus $dsttmp) contains '*'.
130
+
131
+ if [ -f $src -o -d $src ]
132
+ then
133
+ true
134
+ else
135
+ echo "install: $src does not exist"
136
+ exit 1
137
+ fi
138
+
139
+ if [ x"$dst" = x ]
140
+ then
141
+ echo "install: no destination specified"
142
+ exit 1
143
+ else
144
+ true
145
+ fi
146
+
147
+ # If destination is a directory, append the input filename; if your system
148
+ # does not like double slashes in filenames, you may need to add some logic
149
+
150
+ if [ -d $dst ]
151
+ then
152
+ dst="$dst"/`basename $src`
153
+ else
154
+ true
155
+ fi
156
+ fi
157
+
158
+ ## this sed command emulates the dirname command
159
+ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
160
+
161
+ # Make sure that the destination directory exists.
162
+ # this part is taken from Noah Friedman's mkinstalldirs script
163
+
164
+ # Skip lots of stat calls in the usual case.
165
+ if [ ! -d "$dstdir" ]; then
166
+ defaultIFS='
167
+ '
168
+ IFS="${IFS-${defaultIFS}}"
169
+
170
+ oIFS="${IFS}"
171
+ # Some sh's can't handle IFS=/ for some reason.
172
+ IFS='%'
173
+ set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
174
+ IFS="${oIFS}"
175
+
176
+ pathcomp=''
177
+
178
+ while [ $# -ne 0 ] ; do
179
+ pathcomp="${pathcomp}${1}"
180
+ shift
181
+
182
+ if [ ! -d "${pathcomp}" ] ;
183
+ then
184
+ $mkdirprog "${pathcomp}"
185
+ else
186
+ true
187
+ fi
188
+
189
+ pathcomp="${pathcomp}/"
190
+ done
191
+ fi
192
+
193
+ if [ x"$dir_arg" != x ]
194
+ then
195
+ $doit $instcmd $dst &&
196
+
197
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
198
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
199
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
200
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
201
+ else
202
+
203
+ # If we're going to rename the final executable, determine the name now.
204
+
205
+ if [ x"$transformarg" = x ]
206
+ then
207
+ dstfile=`basename $dst`
208
+ else
209
+ dstfile=`basename $dst $transformbasename |
210
+ sed $transformarg`$transformbasename
211
+ fi
212
+
213
+ # don't allow the sed command to completely eliminate the filename
214
+
215
+ if [ x"$dstfile" = x ]
216
+ then
217
+ dstfile=`basename $dst`
218
+ else
219
+ true
220
+ fi
221
+
222
+ # Make a temp file name in the proper directory.
223
+
224
+ dsttmp=$dstdir/#inst.$$#
225
+
226
+ # Move or copy the file name to the temp name
227
+
228
+ $doit $instcmd $src $dsttmp &&
229
+
230
+ trap "rm -f ${dsttmp}" 0 &&
231
+
232
+ # and set any options; do chmod last to preserve setuid bits
233
+
234
+ # If any of these fail, we abort the whole thing. If we want to
235
+ # ignore errors from any of these, just make sure not to ignore
236
+ # errors from the above "$doit $instcmd $src $dsttmp" command.
237
+
238
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
239
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
240
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
241
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
242
+
243
+ # Now rename the file to the real destination.
244
+
245
+ $doit $rmcmd -f $dstdir/$dstfile &&
246
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
247
+
248
+ fi &&
249
+
250
+
251
+ exit 0