Skip to content

Commit

Permalink
Item8022: Fixed a number of minor niggles in the build contrib, and f…
Browse files Browse the repository at this point in the history
…ixed som extension topics

git-svn-id: http://svn.foswiki.org/trunk@1150 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Dec 3, 2008
1 parent 1751908 commit 73735bc
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 54 deletions.
10 changes: 6 additions & 4 deletions BuildContrib/build.pl
Expand Up @@ -3,8 +3,7 @@
print <<DOC;
Build an extension
When run from the 'trunk' directory of a TWiki trunk checkout
or the twikiplugins dir of 4.2.x and prior checkouts ,
When run from the 'trunk' directory of a Foswiki trunk checkout
this script will build the BuildContrib-enabled extension named in the
first parameter. The second parameter is the build target for the extension.
Expand All @@ -30,9 +29,12 @@
$extdir = "Plugins";
}

my $scriptDir = "$extension/lib/TWiki/$extdir/$extension";
my $scriptDir = "$extension/lib/Foswiki/$extdir/$extension";
unless ( -e "$scriptDir/build.pl" ) {
die "$scriptDir/build.pl not found";
$scriptDir = "$extension/lib/TWiki/$extdir/$extension";
unless ( -e "$scriptDir/build.pl" ) {
die "build.pl not found";
}
}

my $call = './build.pl '.$arg.' '.$target;
Expand Down
13 changes: 5 additions & 8 deletions BuildContrib/create_new_extension.pl
Expand Up @@ -116,9 +116,6 @@ sub usage {
if (-e "EmptyPlugin/lib/Foswiki/Plugins/EmptyPlugin.pm") {
# probably running in a checkout
$rewrite = getFile("EmptyPlugin/lib/Foswiki/Plugins/EmptyPlugin.pm");
} elsif (-e "twikiplugins/EmptyPlugin/lib/Foswiki/Plugins/EmptyPlugin.pm") {
# Old-style checkout
$rewrite = getFile("twikiplugins/EmptyPlugin/lib/Foswiki/Plugins/EmptyPlugin.pm");
} elsif (-e "../EmptyPlugin/lib/Foswiki/Plugins/EmptyPlugin.pm") {
# core subdir in a new-style checkout
$rewrite = getFile("../EmptyPlugin/lib/Foswiki/Plugins/EmptyPlugin.pm");
Expand Down Expand Up @@ -302,17 +299,17 @@ package Foswiki::%$STUBS%::%$MODULE%;
%$INSTALL_INSTRUCTIONS%
---++ %$TYPE% Info
---++ Info
Many thanks to the following sponsors for supporting this work:
* Acknowledge any sponsors here
| %$TYPE% Author(s): | |
| Author(s): | |
| Copyright: | &copy; |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| %$TYPE% Version: | %$VERSION% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| Dependencies: | %$DEPENDENCIES% |
| %$TYPE% Home: | %$UPLOADTARGETSCRIPT%/view%$UPLOADTARGETSUFFIX%/%$UPLOADTARGETWEB%/%$MODULE% |
| Home page: | %$UPLOADTARGETSCRIPT%/view%$UPLOADTARGETSUFFIX%/%$UPLOADTARGETWEB%/%$MODULE% |
<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the feedback topic on twiki.org instead. -->
<!-- Do _not_ attempt to edit this topic; it is auto-generated. -->
17 changes: 9 additions & 8 deletions BuildContrib/data/System/BuildContrib.txt
Expand Up @@ -95,7 +95,7 @@ installation tree. Every plugin has some _key files_:
* =pub/=
* =System/=
* <code><i>name</i>/</code> - directory where all your images, css, and Javascript files should go
Contribs are held in the =lib/TWiki/Contrib= directory instead of =lib/Foswiki/Plugins= but otherwise in exactly work the same way.
Contribs are held in the =lib/Foswiki/Contrib= directory instead of =lib/Foswiki/Plugins= but otherwise in exactly work the same way.

Other directories normally found in a Foswiki installation may also exist under
a root directory e.g. =bin=, =templates= etc.
Expand Down Expand Up @@ -316,8 +316,8 @@ that are most likely to be useful to anyone writing a script extension.
You are stongly recommended to develop a unit test suite for your extension.
Unit tests are kept in the =test/unit/&lt;name>= directory for each extension.

To run the unit tests you will need to set up the test environment described
in http://twiki.org/cgi-bin/view/Codev/TestCasesTutorial#SettingUpATestEnvironment. That page also includes extensive information on writing testcases.
To run the unit tests you will need to set up the test environment as described
in Foswiki::Development.GettingStarted

The easiest way to generate tests for your extension is to copy the approach taken in another extension. See for example !ActionTrackerPlugin and !CommentPlugin, which both have extensive test suites.

Expand All @@ -327,7 +327,7 @@ Tests are run using
---++ Building a release
When you are almost ready to release, you should
1 Build a release package and installer
* =cd BathPlugin/lib/TWiki/Plugins/BathPlugin=
* =cd BathPlugin/lib/Foswiki/Plugins/BathPlugin=
* =perl build.pl release=
1 Remove the softlinked version from your dev install
* =cd= _dev install_
Expand All @@ -341,7 +341,7 @@ When you are almost ready to release, you should
The =release= target automatically expands certain tokens in =.txt= files
and in the installer script. The following tokens are supported:
* =%$<nop>MANIFEST%= - table of files in MANIFEST
* =%$<nop>FILES%= - hash keyed on file name mapping to permissions i.e. 'data/System/ThsiTopic.txt' => 0664, 'lib/TWiki/Plugins/BlahPlugin.pm' => 0775
* =%$<nop>FILES%= - hash keyed on file name mapping to permissions i.e. 'data/System/ThsiTopic.txt' => 0664, 'lib/Foswiki/Plugins/BlahPlugin.pm' => 0775
* =%$<nop>DEPENDENCIES%= - list of dependencies from DEPENDENCIES
* =%$<nop>VERSION%= value of $VERSION
* =%$<nop>DATE%= - local date
Expand All @@ -360,7 +360,7 @@ TODO: add code sample here?
---++ Upload
When you are happy the release package is built correctly, you can
upload it.
* =cd BathPlugin/lib/TWiki/Plugins/BathPlugin=
* =cd BathPlugin/lib/Foswiki/Plugins/BathPlugin=
* =perl build.pl upload=
By default the =upload= target will upload to Foswiki.org. You will be prompted
to enter an alternate upload target, should you require it (e.g. to upload to
Expand Down Expand Up @@ -395,11 +395,12 @@ Another great Foswiki extension from the <a style="text-decoration:none" href="h

TWiki<sup>&reg;</sup> is a trademark of Peter Thoeny.

| Authors: | Crawford Currie |
| Copyright &copy;: | 2004-2008, Crawford Currie http://c-dot.co.uk |
| Authors: | [[http://c-dot.co.uk][Crawford Currie]] |
| Copyright &copy;: | 2004-2008, Foswiki Contributors |
| License: | [[http://www.gnu.org/copyleft/gpl.html][GPL]] |
| Version: | %$VERSION% |
| Change&nbsp;History: | |
| 03 Dec 2008 | Re-release for Foswiki; copyright assigned to Foswiki Contributors |
| 31 Aug 2008 | TWikibug:Item5971 BuildContrib broken upload on 4.2.2 with template login. Also adding query to optionally skip topic attachment upload. |
| 22 Apr 2008 | TWikibug:Item5556 BuildContrib defaults all unspecified permissions to 664 && TWikibug:Item5455 BuildContrib doesn't cope with larger numbers of files - TWiki:Main.SvenDowideit|
| 31 Jan 2008 | TWikibug:Item4751 support spaces in MANIFEST TWikibug:Item4990 removed dependency on external md5sum program TWikibug:Item5309 added tidy target |
Expand Down
40 changes: 19 additions & 21 deletions BuildContrib/lib/Foswiki/Contrib/Build.pm
Expand Up @@ -61,7 +61,7 @@ my $UPLOADSITEEXTENSIONSWEB = "Extensions";
my $GLACIERMELT = 10; # number of seconds to sleep between uploads,
# to reduce average load on server

my $targetProject = 'Foswiki';# May change to 'TWiki'
my $targetProject = 'Foswiki';# May change to 'TWiki' later

my $collector; # general purpose handle for collecting stuff

Expand Down Expand Up @@ -1388,6 +1388,7 @@ END
my $response = $userAgent->get("$url?raw=debug");

my %newform;
my $formExists = 0;
unless ( $response->is_success ) {
print 'Failed to GET old topic ', $response->request->uri,
' -- ', $response->status_line, "\n";
Expand All @@ -1405,8 +1406,16 @@ END
if ( defined $val && length($val) ) {
$newform{$1} = $val;
}
} elsif ( $line =~ /META:FORM{name=/ ) {
$formExists = 1;
}
}
if (!$formExists) {
$newform{formtemplate} ||= 'PackageForm';
}
if ( $this->{project} =~ /(Plugin|Skin|Contrib|AddOn)$/ ) {
$newform{TopicClassification} ||= $1.'Package';
}
}
local $/ = undef; # set to read to EOF
if ( open( IN_FILE, '<' . $this->{basedir} . '/' . $to . '.txt' ) ) {
Expand All @@ -1425,6 +1434,9 @@ END
}

$this->_uploadTopic( $userAgent, $user, $pass, $topic, \%newform );
my @attachments;
$newform{text} =~ s/%META:FILEATTACHMENT(.*)%/
push(@attachments, $1);''/ge;

# Upload any 'Var*.txt' topics published by the extension
my $dataDir = $this->{basedir} . '/data/System';
Expand All @@ -1444,13 +1456,12 @@ END

# upload any attachments to the developer's version of the topic. Any other
# attachments to the topic on t.o. will still be there.
my @attachments;
my %uploaded; # flag already uploaded

my $doupattachements = ask("Do you want to upload the attachments?", 1);

my $doupattachements = scalar(@attachments) &&
ask("Do you want to upload the attachments?", 1);

if ($doupattachements) {
$newform{text} =~ s/%META:FILEATTACHMENT(.*)%/push(@attachments, $1)/ge;
foreach my $a (@attachments) {
$a =~ /name="([^"]*)"/;
my $name = $1;
Expand Down Expand Up @@ -2077,19 +2088,6 @@ sub _addDep {
__DATA__
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Like many other extensions, this module is shipped with a fully
automatic installer script written using the Build<nop>Contrib.
* If you have TWiki 4.2 or later, you can install from the =configure= interface (Go to Plugins->Find More Extensions)
* See the [[http://foswiki.org/Extensions/BuildContribInstallationSupplement][installation supplement]] on TWiki.org for more information.
* If you have any problems, then you can still install manually from the command-line:
1 Download one of the =.zip= or =.tgz= archives
1 Unpack the archive in the root directory of your installation.
1 Run the installer script ( =perl &lt;module&gt;_installer= )
1 Run =configure= and enable the module, if it is a plugin.
1 Repeat for any missing dependencies.
* If you are *still* having problems, then instead of running the installer script:
1 Make sure that the file permissions allow the webserver user to access all files.
1 Check in any installed files that have existing =,v= files in your existing install (take care *not* to lock the files when you check in)
1 Manually edit !LocalSite.cfg to set any configuration variables.
%IF{"defined 'SYSTEMWEB'" else="<div class='foswikiAlert'>%X% WARNING: SYSTEMWEB is not defined. Please add these definitions to your %USERSWEB%.SitePreferences, if they are not already there:<br><pre> * <nop>Set SYSTEMWEB = %<nop>TWIKIWEB%<br> * <nop>Set USERSWEB = %<nop>MAINWEB%</pre></div>"}%
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in =configure=, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
12 changes: 6 additions & 6 deletions BuildContrib/lib/Foswiki/Contrib/BuildContrib/DEPENDENCIES
Expand Up @@ -4,11 +4,11 @@ File::Copy,>0,cpan,Used to copy files. Available from CPAN:File::Copy
File::Temp,>0,cpan,Used to create temp files. Available from CPAN:File::Temp
FindBin,>0,cpan,Used to find earth. Available from CPAN:FindBin
File::Path,>0,cpan,Used to build paths. Available from CPAN:File::Path
CGI,>=0,cpan,May be required for lib/TWiki/Contrib/Build.pm
Carp,>=0,cpan,May be required for lib/TWiki/Contrib/Build.pm
Error,>=0,cpan,May be required for lib/TWiki/Contrib/Build.pm
Exporter,>=0,cpan,May be required for lib/TWiki/Contrib/BuildContrib/BaseBuild.pm
LWP,>=0,cpan,May be required for lib/TWiki/Contrib/Build.pm
POSIX,>=0,cpan,Required for lib/TWiki/Contrib/Build.pm
CGI,>=0,cpan,May be required
Carp,>=0,cpan,May be required
Error,>=0,cpan,May be required
Exporter,>=0,cpan,May be required
LWP,>=0,cpan,May be required
POSIX,>=0,cpan,Required
JavaScript::Minifier,>=0,cpan,Optional, used to build .js from _src.js
CSS::Minifier,>=0,cpan,Optional, used to build .css from _src.css
5 changes: 2 additions & 3 deletions MailerContrib/data/System/MailerContrib.txt
Expand Up @@ -134,8 +134,7 @@ will generate newsletters from *all* webs every week on midnight Saturday.
%X% Note: Multiple instances of mailnotify script are not allowed to be executed simutaneously. If you need to run the script multiple times with different options, make sure the cron jobs are scheduled so a previous run has finished before the next starts. You can also write a small script that runs mailnotify in sequence as described in Foswiki:Support.DuplicateNotificationsFromMailerCon.

<!--
* Set STUB = Foswiki::Contrib::Mailer
* Set SHORTDESCRIPTION = Supports e-mail notification of changes.
* Set SHORTDESCRIPTION = Supports e-mail notification of changes.
-->
---++ Developer Notes
The changes mails sent to subscribers are based on a Foswiki template called =mailnotify=. This template must contain the following definitions.
Expand All @@ -158,7 +157,7 @@ Many thanks to the following sponsors for supporting this work:
* [[http://www.windriver.com][Wind River]]
* [[http://wikigardens.com][WikiGardens]]

| Author: | Foswiki:Main/CrawfordCurrie (http://c-dot.co.uk) |
| Author: | [[http://c-dot.co.uk][Crawford Currie]] |
| Copyright &copy;: | 2004, Wind River Systems; 2008, http://WikiRing.com |
| License: | GPL |
| Version: | %$VERSION% |
Expand Down
4 changes: 2 additions & 2 deletions SubscribePlugin/data/System/SubscribePlugin.txt
Expand Up @@ -25,8 +25,8 @@ You don't need =VIEW= access to the WebNotify topic in order to subscribe to cha

Another great Foswiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - working together to improve your wiki experience!

| Plugin Author: | Foswiki:Main.CrawfordCurrie |
| Copyright: | &copy; 2008, Crawford Currie http://c-dot.co.uk |
| Author: | [[http://c-dot.co.uk][Crawford Currie]] |
| Copyright: | &copy; 2008, Crawford Currie |
| License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
| Plugin Version: | %$VERSION% |
| Dependencies: | %$DEPENDENCIES% |
Expand Down
2 changes: 1 addition & 1 deletion TinyMCEPlugin/data/System/TinyMCEPlugin.txt
Expand Up @@ -113,7 +113,7 @@ The topic TinyMCEFrequentlyAskedQuestions contains more help with things like: "

Another great Foswiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - working together to improve your wiki experience!

| Plugin Author(s): | Foswiki:Main.CrawfordCurrie |
| Author: | [[http://c-dot.co.uk][Crawford Currie]] |
| Plugin Version: | %$VERSION% |
| Copyright: | &copy; 2007-2008 Crawford Currie http://c-dot.co.uk |
| | This package also includes the complete sources for version 2.1.1.1 of the !TinyMCE editor |
Expand Down
2 changes: 1 addition & 1 deletion WysiwygPlugin/data/System/WysiwygPlugin.txt
Expand Up @@ -160,7 +160,7 @@ Many thanks to the following sponsors for supporting this work:
* [[http://www.carrier.com][Carrier Corporation]]
* [[http://twiki.net][TWIKI.NET]]

| Plugin Author(s): | Foswiki:Main.CrawfordCurrie http://www.c-dot.co.uk |
| Author: | [[http://c-dot.co.uk][Crawford Currie]] |
| Copyright | &copy; ILOG 2005 http://www.ilog.fr |
| License | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Plugin Version: | %$VERSION% |
Expand Down

0 comments on commit 73735bc

Please sign in to comment.