wok rev 6809
Added libtar. A C library for manipulating POSIX tar files. Needed for hydrogen.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Tue Oct 19 13:04:09 2010 +0000 (2010-10-19) |
parents | e198ea52ecc9 |
children | fef452e472a3 |
files | libtar-dev/receipt libtar/receipt libtar/stuff/libtar-1.2.11.patch |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libtar-dev/receipt Tue Oct 19 13:04:09 2010 +0000 1.3 @@ -0,0 +1,20 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="libtar-dev" 1.7 +VERSION="1.2.11" 1.8 +CATEGORY="development" 1.9 +SHORT_DESC="devel files for libtar" 1.10 +MAINTAINER="slaxemulator@gmail.com" 1.11 +DEPENDS="libtar" 1.12 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.13 +WEB_SITE="http://www.feep.net/libtar/" 1.14 +WANTED="libtar" 1.15 + 1.16 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.17 +genpkg_rules() 1.18 +{ 1.19 + mkdir -p $fs/usr 1.20 + cp -a $_pkg/usr/include $fs/usr 1.21 + cp -a $_pkg/usr/lib $fs/usr 1.22 +} 1.23 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/libtar/receipt Tue Oct 19 13:04:09 2010 +0000 2.3 @@ -0,0 +1,32 @@ 2.4 +# SliTaz package receipt. 2.5 + 2.6 +PACKAGE="libtar" 2.7 +VERSION="1.2.11" 2.8 +CATEGORY="development" 2.9 +SHORT_DESC="C library for manipulating POSIX tar files." 2.10 +MAINTAINER="slaxemulator@gmail.com" 2.11 +DEPENDS="zlib" 2.12 +BUILD_DEPENDS="zlib-dev" 2.13 +TARBALL="$PACKAGE-$VERSION.tar.gz" 2.14 +WEB_SITE="http://www.feep.net/libtar/" 2.15 +WGET_URL="ftp://ftp.feep.net/pub/software/$PACKAGE/$TARBALL" 2.16 + 2.17 +# Rules to configure and make the package. 2.18 +compile_rules() 2.19 +{ 2.20 + cd $src 2.21 + ./configure \ 2.22 + --prefix=/usr \ 2.23 + --infodir=/usr/share/info \ 2.24 + --mandir=/usr/share/man \ 2.25 + $CONFIGURE_ARGS && 2.26 + make && make DESTDIR=$PWD/_pkg install 2.27 +} 2.28 + 2.29 +# Rules to gen a SliTaz package suitable for Tazpkg. 2.30 +genpkg_rules() 2.31 +{ 2.32 + mkdir -p $fs/usr 2.33 + cp -a $_pkg/usr/bin $fs/usr 2.34 +} 2.35 +
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/libtar/stuff/libtar-1.2.11.patch Tue Oct 19 13:04:09 2010 +0000 3.3 @@ -0,0 +1,108 @@ 3.4 +diff -Naur libtar-1.2.11-orig/lib/decode.c libtar-1.2.11/lib/decode.c 3.5 +--- libtar-1.2.11-orig/lib/decode.c 2003-01-06 17:40:59.000000000 -0800 3.6 ++++ libtar-1.2.11/lib/decode.c 2004-08-13 12:26:34.000000000 -0700 3.7 +@@ -26,7 +26,7 @@ 3.8 + char * 3.9 + th_get_pathname(TAR *t) 3.10 + { 3.11 +- char filename[MAXPATHLEN]; 3.12 ++ static char filename[MAXPATHLEN]; 3.13 + 3.14 + if (t->th_buf.gnu_longname) 3.15 + return t->th_buf.gnu_longname; 3.16 +@@ -35,11 +35,11 @@ 3.17 + { 3.18 + snprintf(filename, sizeof(filename), "%.155s/%.100s", 3.19 + t->th_buf.prefix, t->th_buf.name); 3.20 +- return strdup(filename); 3.21 ++ return filename; 3.22 + } 3.23 + 3.24 + snprintf(filename, sizeof(filename), "%.100s", t->th_buf.name); 3.25 +- return strdup(filename); 3.26 ++ return filename; 3.27 + } 3.28 + 3.29 + 3.30 +diff -Naur libtar-1.2.11-orig/lib/extract.c libtar-1.2.11/lib/extract.c 3.31 +--- libtar-1.2.11-orig/lib/extract.c 2003-03-02 15:58:07.000000000 -0800 3.32 ++++ libtar-1.2.11/lib/extract.c 2004-08-13 12:26:34.000000000 -0700 3.33 +@@ -28,14 +28,6 @@ 3.34 + #endif 3.35 + 3.36 + 3.37 +-struct linkname 3.38 +-{ 3.39 +- char ln_save[MAXPATHLEN]; 3.40 +- char ln_real[MAXPATHLEN]; 3.41 +-}; 3.42 +-typedef struct linkname linkname_t; 3.43 +- 3.44 +- 3.45 + static int 3.46 + tar_set_file_perms(TAR *t, char *realname) 3.47 + { 3.48 +@@ -98,7 +90,9 @@ 3.49 + tar_extract_file(TAR *t, char *realname) 3.50 + { 3.51 + int i; 3.52 +- linkname_t *lnp; 3.53 ++ char *lnp; 3.54 ++ int pathname_len; 3.55 ++ int realname_len; 3.56 + 3.57 + if (t->options & TAR_NOOVERWRITE) 3.58 + { 3.59 +@@ -137,11 +131,13 @@ 3.60 + if (i != 0) 3.61 + return i; 3.62 + 3.63 +- lnp = (linkname_t *)calloc(1, sizeof(linkname_t)); 3.64 ++ pathname_len = strlen(th_get_pathname(t)) + 1; 3.65 ++ realname_len = strlen(realname) + 1; 3.66 ++ lnp = (char *)calloc(1, pathname_len + realname_len); 3.67 + if (lnp == NULL) 3.68 + return -1; 3.69 +- strlcpy(lnp->ln_save, th_get_pathname(t), sizeof(lnp->ln_save)); 3.70 +- strlcpy(lnp->ln_real, realname, sizeof(lnp->ln_real)); 3.71 ++ strcpy(&lnp[0], th_get_pathname(t)); 3.72 ++ strcpy(&lnp[pathname_len], realname); 3.73 + #ifdef DEBUG 3.74 + printf("tar_extract_file(): calling libtar_hash_add(): key=\"%s\", " 3.75 + "value=\"%s\"\n", th_get_pathname(t), realname); 3.76 +@@ -288,7 +284,7 @@ 3.77 + { 3.78 + char *filename; 3.79 + char *linktgt = NULL; 3.80 +- linkname_t *lnp; 3.81 ++ char *lnp; 3.82 + libtar_hashptr_t hp; 3.83 + 3.84 + if (!TH_ISLNK(t)) 3.85 +@@ -304,8 +300,8 @@ 3.86 + if (libtar_hash_getkey(t->h, &hp, th_get_linkname(t), 3.87 + (libtar_matchfunc_t)libtar_str_match) != 0) 3.88 + { 3.89 +- lnp = (linkname_t *)libtar_hashptr_data(&hp); 3.90 +- linktgt = lnp->ln_real; 3.91 ++ lnp = (char *)libtar_hashptr_data(&hp); 3.92 ++ linktgt = &lnp[strlen(lnp) + 1]; 3.93 + } 3.94 + else 3.95 + linktgt = th_get_linkname(t); 3.96 +diff -Naur libtar-1.2.11-orig/lib/libtar.h libtar-1.2.11/lib/libtar.h 3.97 +--- libtar-1.2.11-orig/lib/libtar.h 2003-01-06 17:40:59.000000000 -0800 3.98 ++++ libtar-1.2.11/lib/libtar.h 2004-08-13 12:26:52.000000000 -0700 3.99 +@@ -63,9 +63,9 @@ 3.100 + /***** handle.c ************************************************************/ 3.101 + 3.102 + typedef int (*openfunc_t)(const char *, int, ...); 3.103 +-typedef int (*closefunc_t)(int); 3.104 +-typedef ssize_t (*readfunc_t)(int, void *, size_t); 3.105 +-typedef ssize_t (*writefunc_t)(int, const void *, size_t); 3.106 ++typedef int (*closefunc_t)(long); 3.107 ++typedef ssize_t (*readfunc_t)(long, void *, size_t); 3.108 ++typedef ssize_t (*writefunc_t)(long, const void *, size_t); 3.109 + 3.110 + typedef struct 3.111 + {