summaryrefslogtreecommitdiff
path: root/archivers/ruby-lha
diff options
context:
space:
mode:
Diffstat (limited to 'archivers/ruby-lha')
-rw-r--r--archivers/ruby-lha/Makefile42
-rw-r--r--archivers/ruby-lha/distinfo2
-rw-r--r--archivers/ruby-lha/files/patch-math-remainder65
-rw-r--r--archivers/ruby-lha/files/patch-tests11
-rw-r--r--archivers/ruby-lha/files/patch-warnings377
-rw-r--r--archivers/ruby-lha/pkg-descr3
-rw-r--r--archivers/ruby-lha/pkg-plist2
7 files changed, 0 insertions, 502 deletions
diff --git a/archivers/ruby-lha/Makefile b/archivers/ruby-lha/Makefile
deleted file mode 100644
index 176468a90812..000000000000
--- a/archivers/ruby-lha/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# Created by: Stanislav Sedov <stas@FreeBSD.org>
-# $FreeBSD$
-
-PORTNAME= lha
-PORTVERSION= 0.8.1
-PORTREVISION= 2
-CATEGORIES= archivers ruby
-MASTER_SITES= http://arton.no-ip.info/data/lhalib/
-PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX}
-DISTNAME= lhalib-${PORTVERSION}
-DIST_SUBDIR= ruby
-
-MAINTAINER= ruby@FreeBSD.org
-COMMENT= Ruby extension to unpack LHA-compressed files
-
-USES= zip shebangfix
-USE_RUBY= yes
-USE_RUBY_EXTCONF= yes
-RUBY_EXTCONF= ext/extconf.rb
-
-CONFIGURE_ARGS= --rubyprog=${RUBY}
-
-EXAMPLES= test/test.rb
-SHEBANG_FILES= ${EXAMPLES}
-
-OPTIONS_DEFINE= DOCS
-
-DEPRECATED= Upstream no longer active
-EXPIRATION_DATE= 2017-01-28
-
-# We don't have executables in this package, but rake uses
-# INSTALL_PROG for shared libraries:
-MAKE_ARGS= INSTALL_PROG="${INSTALL_LIB}"
-
-post-install:
- @${MKDIR} ${STAGEDIR}${RUBY_MODEXAMPLESDIR}
- ${INSTALL_SCRIPT} ${EXAMPLES:S,^,${WRKSRC}/,} ${STAGEDIR}${RUBY_MODEXAMPLESDIR}
-
-test check regression-test: build
- cd ${WRKSRC}/test && ${RUBY} -I${WRKSRC} test.rb
-
-.include <bsd.port.mk>
diff --git a/archivers/ruby-lha/distinfo b/archivers/ruby-lha/distinfo
deleted file mode 100644
index 243383621b2a..000000000000
--- a/archivers/ruby-lha/distinfo
+++ /dev/null
@@ -1,2 +0,0 @@
-SHA256 (ruby/lhalib-0.8.1.zip) = 98ef5c60e991a471f28ca8f4a7a79458a85f8e418431511d03840bd122783a38
-SIZE (ruby/lhalib-0.8.1.zip) = 77035
diff --git a/archivers/ruby-lha/files/patch-math-remainder b/archivers/ruby-lha/files/patch-math-remainder
deleted file mode 100644
index fbcf5c58d7bc..000000000000
--- a/archivers/ruby-lha/files/patch-math-remainder
+++ /dev/null
@@ -1,65 +0,0 @@
-Ruby 2.x #includes <math.h>, which declares a function named
-remainder(). We must rename our variable to avoid name-conflict
-and allow this code to compile with Ruby-2.x
-
- -mi
-
---- ext/slide.c.orig 2006-09-17 17:45:51 UTC
-+++ ext/slide.c
-@@ -87,7 +87,7 @@ static struct decode_option decode_set;
-
- static unsigned int txtsiz;
- static unsigned long dicsiz;
--static unsigned int remainder;
-+static unsigned int iremainder;
-
- struct matchdata {
- int len;
-@@ -162,7 +162,7 @@ update_dict(pos, crc)
-
- n = fread_crc(crc, &text[txtsiz - dicsiz], dicsiz, infile);
-
-- remainder += n;
-+ iremainder += n;
-
- *pos -= dicsiz;
- for (i = 0; i < HSHSIZ; i++) {
-@@ -270,7 +270,7 @@ search_dict(token, pos, min, m)
- /* re-search */
- search_dict_1(token, pos, 0, off+2, m);
-
-- if (m->len > remainder) m->len = remainder;
-+ if (m->len > iremainder) m->len = iremainder;
- }
-
- /* slide dictionary */
-@@ -280,7 +280,7 @@ next_token(token, pos, crc)
- unsigned int *pos;
- unsigned int *crc;
- {
-- remainder--;
-+ iremainder--;
- if (++*pos >= txtsiz - maxmatch) {
- update_dict(pos, crc);
- #ifdef DEBUG
-@@ -316,17 +316,17 @@ encode(intf)
- encode_set.encode_start();
- memset(text, ' ', TXTSIZ);
-
-- remainder = fread_crc(&crc, &text[dicsiz], txtsiz-dicsiz, infile);
-+ iremainder = fread_crc(&crc, &text[dicsiz], txtsiz-dicsiz, infile);
-
- match.len = THRESHOLD - 1;
- match.off = 0;
-- if (match.len > remainder) match.len = remainder;
-+ if (match.len > iremainder) match.len = iremainder;
-
- pos = dicsiz;
- token = INIT_HASH(pos);
- insert_hash(token, pos); /* associate token and pos */
-
-- while (remainder > 0 && ! unpackable) {
-+ while (iremainder > 0 && ! unpackable) {
- last = match;
-
- next_token(&token, &pos, &crc);
diff --git a/archivers/ruby-lha/files/patch-tests b/archivers/ruby-lha/files/patch-tests
deleted file mode 100644
index 2607ce19a616..000000000000
--- a/archivers/ruby-lha/files/patch-tests
+++ /dev/null
@@ -1,11 +0,0 @@
---- test/test.rb.orig 2006-09-17 18:32:52 UTC
-+++ test/test.rb
-@@ -20,7 +20,7 @@ class TestLhaLib < Test::Unit::TestCase
- assert(File.exist?('test.dat'))
- obuff = ' ' * 256
- (0..255).each do |x|
-- obuff[x] = x
-+ obuff[x] = x.chr
- end
- nbuff = nil
- File.open('test.dat', 'rb') do |f|
diff --git a/archivers/ruby-lha/files/patch-warnings b/archivers/ruby-lha/files/patch-warnings
deleted file mode 100644
index 75da76ac771a..000000000000
--- a/archivers/ruby-lha/files/patch-warnings
+++ /dev/null
@@ -1,377 +0,0 @@
---- ext/crcio.c.orig 2006-09-17 16:38:22 UTC
-+++ ext/crcio.c
-@@ -33,11 +33,13 @@ make_crctable( /* void */ )
-
- /* ------------------------------------------------------------------------ */
- unsigned int
--calccrc(crc, p, n)
-+calccrc(crc, _p, n)
- unsigned int crc;
-- unsigned char *p;
-+ const void *_p;
- unsigned int n;
- {
-+ const unsigned char *p = _p;
-+
- while (n-- > 0)
- crc = UPDATE_CRC(crc, *p++);
- return crc;
-@@ -67,7 +69,7 @@ fread_crc(crcp, p, n, fp)
- void
- fwrite_crc(crcp, p, n, fp)
- unsigned int *crcp;
-- unsigned char *p;
-+ const unsigned char *p;
- int n;
- FILE *fp;
- {
-@@ -138,11 +140,13 @@ putc_euc(c, fd)
-
- /* ------------------------------------------------------------------------ */
- int
--fwrite_txt(p, n, fp)
-- unsigned char *p;
-+fwrite_txt(_p, n, fp)
-+ const void *_p;
- int n;
- FILE *fp;
- {
-+ const unsigned char *p = _p;
-+
- while (--n >= 0) {
- if (*p != '\015' && *p != '\032') {
- #ifdef EUC
-@@ -160,13 +164,14 @@ fwrite_txt(p, n, fp)
-
- /* ------------------------------------------------------------------------ */
- int
--fread_txt(p, n, fp)
-- unsigned char *p;
-+fread_txt(_p, n, fp)
-+ void *_p;
- int n;
- FILE *fp;
- {
- int c;
- int cnt = 0;
-+ unsigned char *p = _p;
-
- while (cnt < n) {
- if (getc_euc_cache != EOF) {
---- ext/extract.c.orig 2006-09-17 17:45:51 UTC
-+++ ext/extract.c
-@@ -14,7 +14,7 @@ decode_lzhuf(infp, outfp, original_size,
- FILE *outfp;
- size_t original_size;
- size_t packed_size;
-- char *name;
-+ const char *name;
- int method;
- size_t *read_sizep;
- {
---- ext/header.c.orig 2006-09-17 16:38:22 UTC
-+++ ext/header.c
-@@ -48,12 +48,13 @@ int default_system_kanji_code = MULTIBYT
- int default_system_kanji_code = NONE;
- #endif
-
--int
--calc_sum(p, len)
-- char *p;
-+static int
-+calc_sum(_p, len)
-+ const void *_p;
- int len;
- {
- int sum = 0;
-+ const char *p = _p;
-
- while (len--) sum += *p++;
-
-@@ -67,7 +68,7 @@ dump_get_byte()
- int c;
-
- if (verbose_listing && verbose > 1)
-- printf("%02d %2d: ", get_ptr - start_ptr, 1);
-+ printf("%02td %2d: ", get_ptr - start_ptr, 1);
- c = GET_BYTE();
- if (verbose_listing && verbose > 1) {
- if (isprint(c))
-@@ -84,7 +85,7 @@ dump_skip_bytes(len)
- {
- if (len == 0) return;
- if (verbose_listing && verbose > 1) {
-- printf("%02d %2d: ", get_ptr - start_ptr, len);
-+ printf("%02td %2d: ", get_ptr - start_ptr, len);
- while (len--)
- printf("0x%02x ", GET_BYTE());
- printf("... ignored\n");
-@@ -102,7 +103,7 @@ get_word()
-
- #if DUMP_HEADER
- if (verbose_listing && verbose > 1)
-- printf("%02d %2d: ", get_ptr - start_ptr, 2);
-+ printf("%02td %2d: ", get_ptr - start_ptr, 2);
- #endif
- b0 = GET_BYTE();
- b1 = GET_BYTE();
-@@ -130,7 +131,7 @@ get_longword()
-
- #if DUMP_HEADER
- if (verbose_listing && verbose > 1)
-- printf("%02d %2d: ", get_ptr - start_ptr, 4);
-+ printf("%02td %2d: ", get_ptr - start_ptr, 4);
- #endif
- b0 = GET_BYTE();
- b1 = GET_BYTE();
-@@ -163,7 +164,7 @@ get_bytes(buf, len, size)
-
- #if DUMP_HEADER
- if (verbose_listing && verbose > 1)
-- printf("%02d %2d: \"", get_ptr - start_ptr, len);
-+ printf("%02td %2d: \"", get_ptr - start_ptr, len);
-
- for (i = 0; i < len; i++) {
- if (i < size) buf[i] = get_ptr[i];
-@@ -1171,11 +1172,11 @@ seek_lha_header(fp)
-
-
- /* remove leading `xxxx/..' */
--static char *
--remove_leading_dots(char *path)
-+static const char *
-+remove_leading_dots(const char *path)
- {
-- char *first = path;
-- char *ptr = 0;
-+ const char *first = path;
-+ const char *ptr = NULL;
-
- if (strcmp(first, "..") == 0) {
- warning("Removing leading `..' from member name.");
-@@ -1200,7 +1201,7 @@ remove_leading_dots(char *path)
- }
-
- if (ptr) {
-- warning("Removing leading `%.*s' from member name.", ptr-first, first);
-+ warning("Removing leading `%.*s' from member name.", (int)(ptr - first), first);
- return ptr;
- }
-
---- ext/huf.c.orig 2006-09-17 16:38:22 UTC
-+++ ext/huf.c
-@@ -234,9 +234,7 @@ send_block( /* void */ )
- /* ------------------------------------------------------------------------ */
- /* lh4, 5, 6, 7 */
- void
--output_st1(c, p)
-- unsigned short c;
-- unsigned short p;
-+output_st1(unsigned short c, unsigned short p)
- {
- static unsigned short cpos;
-
---- ext/lha.h.orig 2006-09-18 08:53:29 UTC
-+++ ext/lha.h
-@@ -211,6 +211,8 @@ int fnmatch(const char *pattern, const c
-
- #include "lha_macro.h"
-
-+unsigned char *alloc_buf(void);
-+
- #define exit(n) lha_exit(n)
-
- struct encode_option {
-@@ -300,41 +302,56 @@ LHALIB_EXTERN void cmd_extract(const cha
- LHALIB_EXTERN FILE * open_old_archive(const char* archive);
- LHALIB_EXTERN boolean need_file(const char*);
- LHALIB_EXTERN boolean archive_is_msdos_sfx1(const char*);
--LHALIB_EXTERN void output_dyn();
--LHALIB_EXTERN void encode_start_fix();
--LHALIB_EXTERN void encode_end_dyn();
--LHALIB_EXTERN void output_st1();
--LHALIB_EXTERN void encode_start_st0();
--LHALIB_EXTERN void encode_end_st0();
--LHALIB_EXTERN void encode_start_st1();
--LHALIB_EXTERN void encode_end_st1();
--LHALIB_EXTERN unsigned short decode_c_dyn();
--LHALIB_EXTERN unsigned short decode_p_dyn();
--LHALIB_EXTERN void decode_start_fix();
--LHALIB_EXTERN void decode_start_dyn();
--LHALIB_EXTERN void decode_start_st0();
--LHALIB_EXTERN void decode_start_st1();
--LHALIB_EXTERN unsigned short decode_c_st0();
--LHALIB_EXTERN unsigned short decode_c_st1();
--LHALIB_EXTERN unsigned short decode_p_st0();
--LHALIB_EXTERN unsigned short decode_p_st1();
--LHALIB_EXTERN unsigned short decode_c_lzs();
--LHALIB_EXTERN unsigned short decode_p_lzs();
--LHALIB_EXTERN void decode_start_lzs();
--LHALIB_EXTERN unsigned short decode_c_lz5();
--LHALIB_EXTERN unsigned short decode_p_lz5();
--LHALIB_EXTERN void decode_start_lz5();
--LHALIB_EXTERN void make_crctable();
-+LHALIB_EXTERN void output_dyn(unsigned int code, unsigned int pos);
-+LHALIB_EXTERN void encode_start_fix(void);
-+LHALIB_EXTERN void encode_end_dyn(void);
-+LHALIB_EXTERN void output_st1(unsigned short c, unsigned short p);
-+LHALIB_EXTERN void encode_start_st0(void);
-+LHALIB_EXTERN void encode_end_st0(void);
-+LHALIB_EXTERN void encode_start_st1(void);
-+LHALIB_EXTERN void encode_end_st1(void);
-+LHALIB_EXTERN void start_c_dyn(void);
-+LHALIB_EXTERN unsigned short decode_c_dyn(void);
-+LHALIB_EXTERN unsigned short decode_p_dyn(void);
-+LHALIB_EXTERN void decode_start_fix(void);
-+LHALIB_EXTERN void decode_start_dyn(void);
-+LHALIB_EXTERN void decode_start_st0(void);
-+LHALIB_EXTERN void decode_start_st1(void);
-+LHALIB_EXTERN unsigned short decode_c_st0(void);
-+LHALIB_EXTERN unsigned short decode_c_st1(void);
-+LHALIB_EXTERN unsigned short decode_p_st0(void);
-+LHALIB_EXTERN unsigned short decode_p_st1(void);
-+LHALIB_EXTERN unsigned short decode_c_lzs(void);
-+LHALIB_EXTERN unsigned short decode_p_lzs(void);
-+LHALIB_EXTERN void decode_start_lzs(void);
-+LHALIB_EXTERN unsigned short decode_c_lz5(void);
-+LHALIB_EXTERN unsigned short decode_p_lz5(void);
-+LHALIB_EXTERN void decode_start_lz5(void);
-+LHALIB_EXTERN void make_crctable(void);
- LHALIB_EXTERN size_t copyfile(FILE* f1, FILE* f2, size_t size, int text_flg, unsigned int* crcp);
--LHALIB_EXTERN void init_getbits();
--LHALIB_EXTERN void init_code_cache();
-+LHALIB_EXTERN void init_getbits(void);
-+LHALIB_EXTERN void init_putbits(void);
-+LHALIB_EXTERN void init_code_cache(void);
- LHALIB_EXTERN void putcode(unsigned char n, unsigned short x);
- LHALIB_EXTERN void putbits(unsigned char n, unsigned short x);
- LHALIB_EXTERN unsigned short getbits(unsigned char n);
- LHALIB_EXTERN void fillbuf(unsigned char n);
- LHALIB_EXTERN void encode_p_st0(unsigned short j);
-
--
-+NORETURN(void lha_exit(int n));
-+unsigned int calccrc(unsigned int crc, const void *p, unsigned int length);
-+int fread_txt(void *p, int n, FILE *fp);
-+int fwrite_txt(const void *p, int n, FILE *fp);
-+int fread_crc(unsigned int *crcp, unsigned char *p, int n, FILE *fp);
-+void fwrite_crc(unsigned int *crcp, const unsigned char *p, int n, FILE *fp);
-+void make_table(short nchar, const unsigned char bitlenp[], short tablebits, unsigned short table[]);
-+unsigned int decode(struct interfacing *intf);
-+short make_tree(int nchar, unsigned short *freqp, unsigned char *bitlenp, unsigned short *codep);
-+int str_safe_copy(char *dst, const char *src, int dstsz);
-+int decode_lzhuf(FILE *in, FILE *out, size_t original, size_t packed, const char *name, int method, size_t *readp);
-+int seek_lha_header(FILE *fp);
-+boolean get_header(FILE *fp, LzHeader *hdr);
-+PRINTF_ARGS(int xsnprintf(char *dst, size_t size, const char *fmt, ...), 3, 4);
-
- #define start_indicator(name, size, ing, len) 0
- #define finish_indicator(name, ed) 0
---- ext/lhalib.c.orig 2006-09-18 09:11:35 UTC
-+++ ext/lhalib.c
-@@ -18,7 +18,7 @@
- #define LHALIB_VERSION "0.8.1"
-
- #include "lha.h"
--#include "st.h"
-+#include <ruby/st.h>
-
- static VALUE lhalib;
-
-@@ -75,7 +75,7 @@ static VALUE s_ex(int argc, VALUE* argv,
- VALUE file;
- proc = Qnil;
- rb_scan_args(argc, argv, "1&", &file, &proc);
-- rb_check_safe_str(file);
-+ SafeStringValue(file);
- rb_secure(4);
-
- file_count = 0;
---- ext/lharc.c.orig 2006-09-17 16:38:22 UTC
-+++ ext/lharc.c
-@@ -52,7 +52,7 @@ static int error_occurred;
- /* ------------------------------------------------------------------------ */
- static boolean
- open_old_archive_1(name, v_fp)
-- char *name;
-+ const char *name;
- FILE **v_fp;
- {
- FILE *fp;
---- ext/lhext.c.orig 2006-09-17 16:38:22 UTC
-+++ ext/lhext.c
-@@ -26,8 +26,9 @@ static char *methods[] =
- NULL
- };
-
--static void add_dirinfo(char* name, LzHeader* hdr);
--static void adjust_dirinfo();
-+static void add_dirinfo(const char* name, LzHeader* hdr);
-+static void adjust_dirinfo(void);
-+static int is_directory_traversal(const char *path);
-
- /* ------------------------------------------------------------------------ */
- static boolean
-@@ -395,8 +396,8 @@ cmd_extract(const char* archive_name, ad
- return;
- }
-
--int
--is_directory_traversal(char *path)
-+static int
-+is_directory_traversal(const char *path)
- {
- int state = 0;
-
-@@ -436,7 +437,7 @@ typedef struct lhdDirectoryInfo_t {
-
- static LzHeaderList *dirinfo;
-
--static void add_dirinfo(char *name, LzHeader *hdr)
-+static void add_dirinfo(const char *name, LzHeader *hdr)
- {
- LzHeaderList *p;
-
---- ext/maketbl.c.orig 2006-09-17 16:38:22 UTC
-+++ ext/maketbl.c
-@@ -9,11 +9,8 @@
- #include "lha.h"
-
- void
--make_table(nchar, bitlen, tablebits, table)
-- short nchar;
-- unsigned char bitlen[];
-- short tablebits;
-- unsigned short table[];
-+make_table(short nchar, const unsigned char bitlen[], short tablebits,
-+ unsigned short table[])
- {
- unsigned short count[17]; /* count of bitlen */
- unsigned short weight[17]; /* 0x10000ul >> bitlen */
---- ext/maketree.c.orig 2006-09-17 17:36:33 UTC
-+++ ext/maketree.c
-@@ -95,7 +95,7 @@ downheap(i, heap, heapsize, freq)
- int i;
- short *heap;
- size_t heapsize;
-- unsigned short *freq;
-+ const unsigned short *freq;
- {
- short j, k;
-
---- ext/util.c.orig 2006-09-18 08:53:29 UTC
-+++ ext/util.c
-@@ -114,10 +114,11 @@ archive_is_msdos_sfx1(const char* name)
-
- int
- #if STDC_HEADERS
--xsnprintf(char *dest, size_t size, char *fmt, ...)
-+xsnprintf(char *dest, size_t size, const char *fmt, ...)
- #else
- xsnprintf(dest, size, fmt, va_alist)
-- char *dest, *fmt;
-+ char *dest;
-+ const char *fmt;
- size_t size;
- va_dcl
- #endif
diff --git a/archivers/ruby-lha/pkg-descr b/archivers/ruby-lha/pkg-descr
deleted file mode 100644
index 6cd75600ea2a..000000000000
--- a/archivers/ruby-lha/pkg-descr
+++ /dev/null
@@ -1,3 +0,0 @@
-ruby-lha is a ruby extension library that unpack files, compressed with lha.
-
-WWW: http://arton.no-ip.info/collabo/backyard/?LhaLibEn
diff --git a/archivers/ruby-lha/pkg-plist b/archivers/ruby-lha/pkg-plist
deleted file mode 100644
index a11fbe0d9b3b..000000000000
--- a/archivers/ruby-lha/pkg-plist
+++ /dev/null
@@ -1,2 +0,0 @@
-%%RUBY_SITELIBDIR%%/%%RUBY_ARCH%%/lhalib.so
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/test.rb