diff --git a/data/TWiki/NativeSearchContrib.txt b/data/System/NativeSearchContrib.txt similarity index 81% rename from data/TWiki/NativeSearchContrib.txt rename to data/System/NativeSearchContrib.txt index 85ea649..2201108 100644 --- a/data/TWiki/NativeSearchContrib.txt +++ b/data/System/NativeSearchContrib.txt @@ -14,8 +14,6 @@ By default Foswiki searches its database by [[http://en.wikipedia.org/wiki/Fork_ ---++ Installation Instructions -If you are installing on a TWiki version before 4.1.2, please refer to TWiki:Codev.NativeSearch for instructions. Note that an old version of the package was pre-installed with 4.1.2; that pre-installation will be overwritten by this package. - Before you start, there are some prerequisites. 1 you must have =ExtUtils::MakeMaker= installed (available from CPAN) 1 you must have a C compiler (=gcc= has been tested). Most Unix/Linux systems will have this already. On Win32 !MinGW is recommended. @@ -31,18 +29,18 @@ Before you start, there are some prerequisites. $ cd tools/native_search $ perl Makefile.PL $ make install -$ perl test.pl -i -l NativeTWikiSearch test.pl Makefile.PL NativeTWikiSearch.xs +$ perl test.pl -i -l FoswikiNativeSearch test.pl Makefile.PL FoswikiNativeSearch.xs (on Win32 you should use =nmake=) Make sure that =perl test.pl= returns something sane, and _NOT_ a =Segmentation fault=. -(=test.pl= is simply a stub interface to the native search, so it behaves like =grep=. The test above simply greps for the string "NativeSearch" in the files Makefile.PL and !NativeTWikiSearch.xs) +(=test.pl= is simply a stub interface to the native search, so it behaves like =grep=. The test above simply greps for the string "NativeSearch" in the files Makefile.PL and !FoswikiNativeSearch.xs) *If you do not have administrator (root) access to the server*, you can still install. Follow the steps above, but use =perl Makefile.PL INSTALLBASE=/your/dir= to install to a different directory. Exactly where you install depends on your system configuration. -Now, in [[%SCRIPTURL{configure}%][configure]], under "Store Settings", you should be able to select the search algorithm =Foswiki::Store::SearchAlgorithms::Native= (click the button first if you have TWiki 4.2 or later or Foswiki). +Now, in [[%SCRIPTURL{configure}%][configure]], under "Store Settings", you should be able to select the search algorithm =Foswiki::Store::SearchAlgorithms::Native= (click the button first). Run a Foswiki search, and watch the web server error log for any problems. @@ -56,18 +54,14 @@ Many thanks to the following sponsors for supporting this work: * Wind River Systems http://windriver.com | Contrib Author(s): | Crawford Currie http://c-dot.co.uk | -| Copyright: | © !WikiRing 2007 | +| Copyright: | © Crawford Currie 2007-2008 | | License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] | | Contrib Version: | %$VERSION% | | Change History: |   | | Dependencies: | %$DEPENDENCIES% | -| Contrib Home: | http://twiki.org/cgi-bin/view/Plugins/NativeSearchContrib | -| Feedback: | http://twiki.org/cgi-bin/view/Plugins/NativeSearchContribDev | -| Appraisal: | http://twiki.org/cgi-bin/view/Plugins/NativeSearchContribAppraisal | - -__Related Topics:__ [[%SYSTEMWEB%.Contribs][Contribs]], %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences +| Contrib Home: | http://foswiki.org/Extensions/NativeSearchContrib | - + %META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" version="1"}% %META:FILEATTACHMENT{name="logo.gif" attr="h" comment="" version="1"}% diff --git a/lib/TWiki/Contrib/NativeSearchContrib.pm b/lib/Foswiki/Contrib/NativeSearchContrib.pm similarity index 94% rename from lib/TWiki/Contrib/NativeSearchContrib.pm rename to lib/Foswiki/Contrib/NativeSearchContrib.pm index 0885a26..4bbd934 100644 --- a/lib/TWiki/Contrib/NativeSearchContrib.pm +++ b/lib/Foswiki/Contrib/NativeSearchContrib.pm @@ -11,7 +11,7 @@ # GNU General Public License for more details, published at # http://www.gnu.org/copyleft/gpl.html -package TWiki::Contrib::NativeSearchContrib; +package Foswiki::Contrib::NativeSearchContrib; use strict; diff --git a/lib/TWiki/Contrib/NativeSearchContrib/DEPENDENCIES b/lib/Foswiki/Contrib/NativeSearchContrib/DEPENDENCIES similarity index 76% rename from lib/TWiki/Contrib/NativeSearchContrib/DEPENDENCIES rename to lib/Foswiki/Contrib/NativeSearchContrib/DEPENDENCIES index aa62e8f..0d93b0c 100644 --- a/lib/TWiki/Contrib/NativeSearchContrib/DEPENDENCIES +++ b/lib/Foswiki/Contrib/NativeSearchContrib/DEPENDENCIES @@ -1,5 +1,4 @@ # Dependencies for NativeSearchContrib # Example: # Time::ParseDate,>=2003.0211,cpan,Required. -# TWiki::Plugins,>=1.15,perl,TWiki 4.1 release. ExtUtils::MakeMaker,>=0,cpan,Required for building makefiles diff --git a/lib/Foswiki/Contrib/NativeSearchContrib/MANIFEST b/lib/Foswiki/Contrib/NativeSearchContrib/MANIFEST new file mode 100644 index 0000000..795fc3a --- /dev/null +++ b/lib/Foswiki/Contrib/NativeSearchContrib/MANIFEST @@ -0,0 +1,11 @@ +# Release manifest for NativeSearchContrib +data/System/NativeSearchContrib.txt 0644 Documentation +lib/Foswiki/Contrib/NativeSearchContrib.pm 0444 +lib/Foswiki/Store/SearchAlgorithms/Native.pm 0444 +tools/native_search/FoswikiNativeSearch.pm 0555 +tools/native_search/cgrep.c 0555 +tools/native_search/Makefile.PL 0555 +tools/native_search/test.pl 0555 +tools/native_search/FoswikiNativeSearch.xs 0555 +pub/System/NativeSearchContrib/wikiringlogo20x20.png 0660 +pub/System/NativeSearchContrib/logo.gif 0660 diff --git a/lib/Foswiki/Contrib/NativeSearchContrib/build.pl b/lib/Foswiki/Contrib/NativeSearchContrib/build.pl new file mode 100755 index 0000000..aa14b17 --- /dev/null +++ b/lib/Foswiki/Contrib/NativeSearchContrib/build.pl @@ -0,0 +1,12 @@ +#!/usr/bin/perl -w +BEGIN { + unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); +} +use Foswiki::Contrib::Build; + +# Create the build object +$build = new Foswiki::Contrib::Build('NativeSearchContrib'); + +# Build the target on the command line, or the default target +$build->build($build->{target}); + diff --git a/lib/TWiki/Store/SearchAlgorithms/Native.pm b/lib/Foswiki/Store/SearchAlgorithms/Native.pm similarity index 82% rename from lib/TWiki/Store/SearchAlgorithms/Native.pm rename to lib/Foswiki/Store/SearchAlgorithms/Native.pm index 4d2d051..0c71347 100644 --- a/lib/TWiki/Store/SearchAlgorithms/Native.pm +++ b/lib/Foswiki/Store/SearchAlgorithms/Native.pm @@ -1,8 +1,12 @@ # -# Copyright (C) 2007 TWiki Contributors. All Rights Reserved. -# TWiki Contributors are listed in the AUTHORS file in the root +# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved. +# Foswiki Contributors are listed in the AUTHORS file in the root # of this distribution. NOTE: Please extend that file, not this notice. # +# Additional copyrights apply to some or all of the code in this +# module, as follows: +# Copyright (C) 2007 TWiki Contributors. All Rights Reserved. +# # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 @@ -15,14 +19,14 @@ # # As per the GPL, removal of this notice is prohibited. # -package TWiki::Store::SearchAlgorithms::Native; +package Foswiki::Store::SearchAlgorithms::Native; use Assert; -use NativeTWikiSearch; +use FoswikiNativeSearch; =pod ----+ package TWiki::Store::SearchAlgorithms::Native +---+ package Foswiki::Store::SearchAlgorithms::Native Native implementation of the RCS cache search. Requires tools/native_search to be built and installed. @@ -49,7 +53,7 @@ sub search { push(@fs, '-l') if $options->{files_without_match}; push(@fs, $searchString); push(@fs, map { "$sDir/$_.txt" } @$topics); - my $matches = NativeTWikiSearch::cgrep(\@fs); + my $matches = FoswikiNativeSearch::cgrep(\@fs); my %seen; if (defined($matches)) { for (@$matches) { diff --git a/lib/TWiki/Contrib/NativeSearchContrib/MANIFEST b/lib/TWiki/Contrib/NativeSearchContrib/MANIFEST deleted file mode 100644 index e36cf35..0000000 --- a/lib/TWiki/Contrib/NativeSearchContrib/MANIFEST +++ /dev/null @@ -1,11 +0,0 @@ -# Release manifest for NativeSearchContrib -data/TWiki/NativeSearchContrib.txt 0644 Documentation -lib/TWiki/Contrib/NativeSearchContrib.pm 0444 -lib/TWiki/Store/SearchAlgorithms/Native.pm 0444 -tools/native_search/NativeTWikiSearch.pm 0555 -tools/native_search/cgrep.c 0555 -tools/native_search/Makefile.PL 0555 -tools/native_search/test.pl 0555 -tools/native_search/NativeTWikiSearch.xs 0555 -pub/TWiki/NativeSearchContrib/wikiringlogo20x20.png 0660 -pub/TWiki/NativeSearchContrib/logo.gif 0660 diff --git a/lib/TWiki/Contrib/NativeSearchContrib/build.pl b/lib/TWiki/Contrib/NativeSearchContrib/build.pl deleted file mode 100755 index 836e3ad..0000000 --- a/lib/TWiki/Contrib/NativeSearchContrib/build.pl +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/perl -w -BEGIN { - unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); -} -use TWiki::Contrib::Build; - -# Create the build object -$build = new TWiki::Contrib::Build('NativeSearchContrib'); - -# (Optional) Set the details of the repository for uploads. -# This can be any web on any accessible TWiki installation. -# These defaults will be used when expanding tokens in .txt -# files, but be warned, they can be overridden at upload time! - -# name of web to upload to -$build->{UPLOADTARGETWEB} = 'Extensions'; -# Full URL of pub directory -$build->{UPLOADTARGETPUB} = 'http://foswiki.org/pub'; -# Full URL of bin directory -$build->{UPLOADTARGETSCRIPT} = 'http://foswiki.org/bin'; -# Script extension -$build->{UPLOADTARGETSUFFIX} = ''; - -# Build the target on the command line, or the default target -$build->build($build->{target}); - diff --git a/pub/TWiki/NativeSearchContrib/logo.gif b/pub/System/NativeSearchContrib/logo.gif similarity index 100% rename from pub/TWiki/NativeSearchContrib/logo.gif rename to pub/System/NativeSearchContrib/logo.gif diff --git a/pub/TWiki/NativeSearchContrib/wikiringlogo20x20.png b/pub/System/NativeSearchContrib/wikiringlogo20x20.png similarity index 100% rename from pub/TWiki/NativeSearchContrib/wikiringlogo20x20.png rename to pub/System/NativeSearchContrib/wikiringlogo20x20.png diff --git a/tools/native_search/NativeTWikiSearch.pm b/tools/native_search/FoswikiNativeSearch.pm similarity index 63% rename from tools/native_search/NativeTWikiSearch.pm rename to tools/native_search/FoswikiNativeSearch.pm index b23f5b7..b10c749 100644 --- a/tools/native_search/NativeTWikiSearch.pm +++ b/tools/native_search/FoswikiNativeSearch.pm @@ -1,13 +1,13 @@ # Copyright (C) 2007 WikiRing http://wikiring.com All Rights Reserved # Author: Crawford Currie -# Perl interface to NativeTWikiSearch xs module -package NativeTWikiSearch; +# Perl interface to FoswikiNativeSearch xs module +package FoswikiNativeSearch; require Exporter; require DynaLoader; @ISA = qw(Exporter DynaLoader); @EXPORT = qw( cgrep ); -bootstrap NativeTWikiSearch; +bootstrap FoswikiNativeSearch; 1; diff --git a/tools/native_search/NativeTWikiSearch.xs b/tools/native_search/FoswikiNativeSearch.xs similarity index 97% rename from tools/native_search/NativeTWikiSearch.xs rename to tools/native_search/FoswikiNativeSearch.xs index ff0b438..7f02409 100644 --- a/tools/native_search/NativeTWikiSearch.xs +++ b/tools/native_search/FoswikiNativeSearch.xs @@ -81,7 +81,7 @@ void XS_pack_charPtrPtr(SV* st, char **s, int n) { free(s); } -MODULE = NativeTWikiSearch PACKAGE = NativeTWikiSearch +MODULE = FoswikiNativeSearch PACKAGE = FoswikiNativeSearch char** cgrep(argv) diff --git a/tools/native_search/Makefile.PL b/tools/native_search/Makefile.PL index 07dc28e..4dd7eee 100644 --- a/tools/native_search/Makefile.PL +++ b/tools/native_search/Makefile.PL @@ -1,8 +1,8 @@ -# Makefile for NativeTWikiSearch module +# Makefile for FoswikiNativeSearch module use ExtUtils::MakeMaker; WriteMakefile( - NAME => 'NativeTWikiSearch', - OBJECT => 'NativeTWikiSearch.o cgrep.o', + NAME => 'FoswikiNativeSearch', + OBJECT => 'FoswikiNativeSearch.o cgrep.o', LIBS => [ '-lpcre' ], CCFLAGS => "-g", LD => "gcc", diff --git a/tools/native_search/test.pl b/tools/native_search/test.pl index 55a5940..c97bbad 100755 --- a/tools/native_search/test.pl +++ b/tools/native_search/test.pl @@ -1,15 +1,15 @@ #!/usr/bin/perl -# Test program for NativeTWikiSearch +# Test program for FoswikiNativeSearch # If it is correctly installed, this program will accept parameters like grep # e.g. -# perl test.pl -i -l NativeTWikiSearch test.pl Makefile.PL NativeTWikiSearch.xs +# perl test.pl -i -l FoswikiNativeSearch test.pl Makefile.PL FoswikiNativeSearch.xs # -use NativeTWikiSearch; +use FoswikiNativeSearch; die <