From 8493dea1f467f64025a9b8b5b6f7efbdbc5c1560 Mon Sep 17 00:00:00 2001 From: DPorts Builder Date: Sat, 3 Oct 2015 06:42:14 -0700 Subject: [PATCH] Import textproc/p5-Senna version 0.51_1 --- textproc/p5-Senna/Makefile | 24 ++++ textproc/p5-Senna/distinfo | 2 + textproc/p5-Senna/files/patch-Build.PL | 17 +++ textproc/p5-Senna/files/patch-Index.pm | 20 +++ textproc/p5-Senna/files/patch-Records.pm | 32 +++++ textproc/p5-Senna/files/patch-Select.pm | 24 ++++ textproc/p5-Senna/files/patch-Senna.xs | 168 +++++++++++++++++++++++ textproc/p5-Senna/files/patch-Sort.pm | 14 ++ textproc/p5-Senna/files/patch-Symbol.pm | 18 +++ textproc/p5-Senna/files/patch-prompt.pl | 11 ++ textproc/p5-Senna/pkg-descr | 3 + textproc/p5-Senna/pkg-plist | 27 ++++ 12 files changed, 360 insertions(+) create mode 100644 textproc/p5-Senna/Makefile create mode 100644 textproc/p5-Senna/distinfo create mode 100644 textproc/p5-Senna/files/patch-Build.PL create mode 100644 textproc/p5-Senna/files/patch-Index.pm create mode 100644 textproc/p5-Senna/files/patch-Records.pm create mode 100644 textproc/p5-Senna/files/patch-Select.pm create mode 100644 textproc/p5-Senna/files/patch-Senna.xs create mode 100644 textproc/p5-Senna/files/patch-Sort.pm create mode 100644 textproc/p5-Senna/files/patch-Symbol.pm create mode 100644 textproc/p5-Senna/files/patch-prompt.pl create mode 100644 textproc/p5-Senna/pkg-descr create mode 100644 textproc/p5-Senna/pkg-plist diff --git a/textproc/p5-Senna/Makefile b/textproc/p5-Senna/Makefile new file mode 100644 index 00000000000..12ae10d2736 --- /dev/null +++ b/textproc/p5-Senna/Makefile @@ -0,0 +1,24 @@ +# $FreeBSD$ + +PORTNAME= Senna +PORTVERSION= 0.51 +PORTREVISION= 1 +CATEGORIES= textproc perl5 +MASTER_SITES= CPAN +MASTER_SITE_SUBDIR= CPAN:DMAKI +PKGNAMEPREFIX= p5- + +MAINTAINER= kuriyama@FreeBSD.org +COMMENT= Perl module for Embeddable Fulltext Search Engine + +LICENSE= LGPL21 + +BUILD_DEPENDS= senna-cfg:${PORTSDIR}/textproc/senna +RUN_DEPENDS:= ${BUILD_DEPENDS} + +USES= perl5 +USE_PERL5= modbuild +CONFIGURE_ARGS+= diff --git a/textproc/p5-Senna/distinfo b/textproc/p5-Senna/distinfo new file mode 100644 index 00000000000..dd4cc632faf --- /dev/null +++ b/textproc/p5-Senna/distinfo @@ -0,0 +1,2 @@ +SHA256 (Senna-0.51.tar.gz) = b431b9035ac65c951aec34bd0c5b160fa88351015ea6eefb8d8cc05db93fe324 +SIZE (Senna-0.51.tar.gz) = 57879 diff --git a/textproc/p5-Senna/files/patch-Build.PL b/textproc/p5-Senna/files/patch-Build.PL new file mode 100644 index 00000000000..41202a41019 --- /dev/null +++ b/textproc/p5-Senna/files/patch-Build.PL @@ -0,0 +1,17 @@ +--- Build.PL.orig Wed Aug 30 14:19:10 2006 ++++ Build.PL Wed Aug 30 14:19:44 2006 +@@ -23,6 +23,7 @@ + dist_version_from => 'lib/Senna.pm', + license => 'lgpl', + c_source => 'src', ++ create_packlist => undef, + extra_compiler_flags => [ + split(/\s+/, $config->{cflags}), + "-DSENNA_MAJOR_VERSION=$major", +@@ -69,4 +70,4 @@ + EOSUB + + my $build = $class->new(%args); +-$build->create_build_script; +\ No newline at end of file ++$build->create_build_script; diff --git a/textproc/p5-Senna/files/patch-Index.pm b/textproc/p5-Senna/files/patch-Index.pm new file mode 100644 index 00000000000..1f68a396a38 --- /dev/null +++ b/textproc/p5-Senna/files/patch-Index.pm @@ -0,0 +1,20 @@ +--- lib/Senna/Index.pm.orig Sat Mar 17 01:45:57 2007 ++++ lib/Senna/Index.pm Tue May 1 20:38:32 2007 +@@ -126,8 +126,8 @@ + + use Senna::Index; + +- my $index = Senna::Index->new(path => '/path/to/index'); +- # $index = Senna::Index->open(pth => '/path/to/index'); ++ my $index = Senna::Index->create(path => '/path/to/index'); ++ # $index = Senna::Index->open(path => '/path/to/index'); + + $rc = $index->insert(key => $key, value => $new); + $rc = $index->delete(key => $key, value => $old_value); +@@ -218,4 +218,4 @@ + + http://qwik.jp/senna - Senna Development Homepage + +-=cut +\ No newline at end of file ++=cut diff --git a/textproc/p5-Senna/files/patch-Records.pm b/textproc/p5-Senna/files/patch-Records.pm new file mode 100644 index 00000000000..490f9458425 --- /dev/null +++ b/textproc/p5-Senna/files/patch-Records.pm @@ -0,0 +1,32 @@ +--- lib/Senna/Records.pm.orig Wed Oct 18 15:16:06 2006 ++++ lib/Senna/Records.pm Wed Oct 18 15:16:26 2006 +@@ -37,17 +37,29 @@ + =head1 METHODS + + =head2 new ++ + =head2 open ++ + =head2 next ++ + =head2 close ++ + =head2 curr_key ++ + =head2 curr_score ++ + =head2 nhits ++ + =head2 find ++ + =head2 difference ++ + =head2 intersect ++ + =head2 subtract ++ + =head2 union ++ + =head2 rewind + + =head1 AUTHOR diff --git a/textproc/p5-Senna/files/patch-Select.pm b/textproc/p5-Senna/files/patch-Select.pm new file mode 100644 index 00000000000..f9fc6f8d7fe --- /dev/null +++ b/textproc/p5-Senna/files/patch-Select.pm @@ -0,0 +1,24 @@ +--- lib/Senna/OptArg/Select.pm.orig Wed Oct 18 18:59:04 2006 ++++ lib/Senna/OptArg/Select.pm Wed Oct 18 18:59:15 2006 +@@ -35,12 +35,19 @@ + =head1 METHODS + + =head2 new ++ + =head2 mode ++ + =head2 similarity_threshold ++ + =head2 max_interval ++ + =head2 weight_vector ++ + =head2 vector_size ++ + =head2 func ++ + =head2 func_arg + +-=cut +\ No newline at end of file ++=cut diff --git a/textproc/p5-Senna/files/patch-Senna.xs b/textproc/p5-Senna/files/patch-Senna.xs new file mode 100644 index 00000000000..5f488dc5728 --- /dev/null +++ b/textproc/p5-Senna/files/patch-Senna.xs @@ -0,0 +1,168 @@ +--- lib/Senna.xs.orig 2007-03-17 01:45:57.000000000 +0900 ++++ lib/Senna.xs 2009-04-29 23:58:36.000000000 +0900 +@@ -24,6 +24,108 @@ + #define SEN_SYM_MAX_KEY_LENGTH 0xffff + #endif + ++typedef uint8_t byte; ++ ++#ifndef SEN_SYM_MAX_SEGMENT ++#define SEN_SYM_MAX_SEGMENT 0x400 ++#endif ++ ++typedef enum { ++ sen_io_auto, ++ sen_io_manual ++} sen_io_mode; ++ ++typedef struct { ++ void *map; ++ uint32_t nref; ++ uint32_t count; ++#if defined(WIN32) && defined(WIN32_FMO_EACH) ++ HANDLE fmo; ++#endif /* defined(WIN32) && defined(WIN32_FMO_EACH) */ ++} sen_io_mapinfo; ++ ++typedef struct _sen_io sen_io; ++ ++struct _sen_io { ++ char path[PATH_MAX]; ++ struct _sen_io_header *header; ++ byte *user_header; ++ sen_io_mapinfo *maps; ++ uint32_t *nrefs; ++ uint32_t base; ++ uint32_t base_seg; ++ sen_io_mode mode; ++ uint32_t cache_size; ++ struct _sen_io_fileinfo *fis; ++ uint32_t nmaps; ++ uint32_t count; ++ uint8_t flags; ++}; ++ ++struct _sen_sym { ++ uint8_t v08p; ++ sen_io *io; ++ struct sen_sym_header *header; ++ uint32_t flags; ++ sen_encoding encoding; ++ uint32_t key_size; ++ uint32_t nref; ++ uint32_t *lock; ++ void *keyaddrs[SEN_SYM_MAX_SEGMENT]; ++ void *pataddrs[SEN_SYM_MAX_SEGMENT]; ++ void *sisaddrs[SEN_SYM_MAX_SEGMENT]; ++}; ++ ++#define SEN_SET_MAX_CHUNK 22 ++ ++typedef pthread_mutex_t sen_mutex; ++ ++typedef struct _sen_array sen_array; ++// #define SEN_ARRAY_W 2 ++#define SEN_ARRAY_W 0 ++#define SEN_ARRAY_R(i) (1<<((i)<>SEN_ARRAY_W) ++ ++struct _sen_array { ++ sen_ctx *ctx; ++ sen_id max; ++ uint16_t element_size; ++ uint16_t flags; ++ sen_mutex lock; ++ void *elements[SEN_ARRAY_N]; ++}; ++ ++struct _sen_set { ++ uint32_t key_size; ++ uint32_t value_size; ++ uint32_t entry_size; ++ uint32_t max_offset; ++ int32_t n_entries; ++ uint32_t n_garbages; ++ // uint32_t curr_entry; ++ // uint32_t curr_chunk; ++ unsigned int max_n_subrecs; ++ unsigned int record_size; ++ unsigned int subrec_size; ++ sen_rec_unit record_unit; ++ sen_rec_unit subrec_unit; ++ uint8_t arrayp; ++ sen_set_eh garbages; ++ sen_set_eh *index; ++ sen_ctx *ctx; ++ sen_sym *keys; ++ sen_recordh *curr_rec; ++ sen_set_cursor *cursor; ++ int limit; ++ sen_recordh *sorted; ++ void *userdata; ++ sen_id subrec_id; ++ // byte *chunks[SEN_SET_MAX_CHUNK + 1]; ++ ++ sen_array a; ++}; ++ + /* This is defined in senna's snip.h. */ + #ifndef MAX_SNIP_RESULT_COUNT + #define MAX_SNIP_RESULT_COUNT 8U +@@ -212,6 +314,9 @@ + } + } + ++struct _sen_set; ++/* typedef struct _sen_set sen_set; */ ++ + static int + sen_sort_optarg_cb(sen_records *r1, const sen_recordh *a, + sen_records *r2, const sen_recordh *b, void *args) +@@ -231,6 +336,11 @@ + + cb_args = (AV *) compar_args[1]; + ++/* sen_rc sen_sym_info(sen_sym *sym, int *key_size, unsigned *flags, ++ sen_encoding *encoding, unsigned *nrecords, unsigned *file_size); */ ++/* typedef struct _sen_sym sen_sym; */ ++/* typedef sen_set sen_records; */ ++/* sen_set.sen_sym* keys */ + sen_sym_info(r1->keys, &key_size, NULL, NULL, NULL, NULL); + if (key_size == SEN_VARCHAR_KEY) { + char key[SEN_MAX_KEY_SIZE]; +@@ -519,10 +629,18 @@ + sen_rc rc; + PPCODE: + index = XS_STATE(sen_index *, self); ++/* ++sen_rc sen_index_info(sen_index *i, int *key_size, int *flags, ++ int *initial_n_segments, sen_encoding *encoding, ++ unsigned *nrecords_keys, unsigned *file_size_keys, ++ unsigned *nrecords_lexicon, unsigned *file_size_lexicon, ++ unsigned long long *inv_seg_size, ++ unsigned long long *inv_chunk_size); ++ */ + rc = sen_index_info(index, + &key_size, &flags, &initial_n_segments, &encoding, + &nrecords_keys, &file_size_keys, &nrecords_lexicon, +- &file_size_lexicon, &inv_seg_size, &inv_chunk_size ++ &file_size_lexicon, (unsigned long long*)&inv_seg_size, (unsigned long long*)&inv_chunk_size + ); + + if (rc != sen_success) +@@ -910,10 +1028,12 @@ + sen_records_rewind(r); + sen_record_info(r, sen_records_curr_rec(r), NULL, 0, &key_size, + NULL, NULL, NULL, NULL); ++/* int sen_records_find(sen_records *r, const void *key); ++ */ + if (key_size == SEN_INT_KEY) { +- RETVAL = sen_records_find(r, (void *) SvIV(key)); ++ RETVAL = sen_records_find(r, (const void *) SvIV(key)); + } else { +- RETVAL = sen_records_find(r, (void *) SvPV(key, len)); ++ RETVAL = sen_records_find(r, (const void *) SvPV(key, len)); + } + sen_records_rewind(r); + OUTPUT: diff --git a/textproc/p5-Senna/files/patch-Sort.pm b/textproc/p5-Senna/files/patch-Sort.pm new file mode 100644 index 00000000000..5daad2029a1 --- /dev/null +++ b/textproc/p5-Senna/files/patch-Sort.pm @@ -0,0 +1,14 @@ +--- lib/Senna/OptArg/Sort.pm.orig Wed Oct 18 18:58:06 2006 ++++ lib/Senna/OptArg/Sort.pm Wed Oct 18 18:58:22 2006 +@@ -26,8 +26,11 @@ + =head1 METHODS + + =head2 new ++ + =head2 compar ++ + =head2 compar_arg ++ + =head2 mode + + =cut diff --git a/textproc/p5-Senna/files/patch-Symbol.pm b/textproc/p5-Senna/files/patch-Symbol.pm new file mode 100644 index 00000000000..06758904878 --- /dev/null +++ b/textproc/p5-Senna/files/patch-Symbol.pm @@ -0,0 +1,18 @@ +--- lib/Senna/Symbol.pm.orig Wed Oct 18 14:04:47 2006 ++++ lib/Senna/Symbol.pm Wed Oct 18 14:05:03 2006 +@@ -59,7 +59,7 @@ + sub %s + { + my $self = shift; +- my %args = @_; ++ my %%args = @_; + $self->xs_%s(@args{qw(key)}); + } + EOSUB +@@ -117,4 +117,4 @@ + + Development funded by Brazil Ltd. Ehttp://dev.razil.jp/project/senna/E + +-=cut +\ No newline at end of file ++=cut diff --git a/textproc/p5-Senna/files/patch-prompt.pl b/textproc/p5-Senna/files/patch-prompt.pl new file mode 100644 index 00000000000..e21ee9109e5 --- /dev/null +++ b/textproc/p5-Senna/files/patch-prompt.pl @@ -0,0 +1,11 @@ +--- tools/prompt.pl.orig Sat Mar 17 01:47:32 2007 ++++ tools/prompt.pl Tue May 1 20:41:18 2007 +@@ -17,7 +17,7 @@ + "\n", + "Proceed ? [n] "; + +-$tmp = ; ++$tmp = $interactive ? : "yes"; + chomp $tmp; + if ($tmp !~ /^y(?:es)?$/) { + exit 1; diff --git a/textproc/p5-Senna/pkg-descr b/textproc/p5-Senna/pkg-descr new file mode 100644 index 00000000000..c940cc776e0 --- /dev/null +++ b/textproc/p5-Senna/pkg-descr @@ -0,0 +1,3 @@ +Perl module for Embeddable Fulltext Search Engine. + +WWW: http://search.cpan.org/dist/Senna/ diff --git a/textproc/p5-Senna/pkg-plist b/textproc/p5-Senna/pkg-plist new file mode 100644 index 00000000000..e9b78a41137 --- /dev/null +++ b/textproc/p5-Senna/pkg-plist @@ -0,0 +1,27 @@ +%%PERL5_MAN3%%/Senna.3.gz +%%PERL5_MAN3%%/Senna::Constants.3.gz +%%PERL5_MAN3%%/Senna::Index.3.gz +%%PERL5_MAN3%%/Senna::OptArg::Select.3.gz +%%PERL5_MAN3%%/Senna::OptArg::Sort.3.gz +%%PERL5_MAN3%%/Senna::Query.3.gz +%%PERL5_MAN3%%/Senna::RC.3.gz +%%PERL5_MAN3%%/Senna::Record.3.gz +%%PERL5_MAN3%%/Senna::Records.3.gz +%%PERL5_MAN3%%/Senna::Set.3.gz +%%PERL5_MAN3%%/Senna::Snippet.3.gz +%%PERL5_MAN3%%/Senna::Symbol.3.gz +%%PERL5_MAN3%%/Senna::Values.3.gz +%%SITE_ARCH%%/Senna.pm +%%SITE_ARCH%%/Senna/Constants.pm +%%SITE_ARCH%%/Senna/Index.pm +%%SITE_ARCH%%/Senna/Query.pm +%%SITE_ARCH%%/Senna/RC.pm +%%SITE_ARCH%%/Senna/Record.pm +%%SITE_ARCH%%/Senna/Records.pm +%%SITE_ARCH%%/Senna/Set.pm +%%SITE_ARCH%%/Senna/Snippet.pm +%%SITE_ARCH%%/Senna/Symbol.pm +%%SITE_ARCH%%/Senna/Values.pm +%%SITE_ARCH%%/Senna/OptArg/Select.pm +%%SITE_ARCH%%/Senna/OptArg/Sort.pm +%%SITE_ARCH%%/auto/Senna/Senna.so -- 2.41.0