diff options
author | Karl Berry <karl@freefriends.org> | 2017-11-15 23:03:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-11-15 23:03:35 +0000 |
commit | 9dc9700e2d9d17be02168dcc90bd4b9a9feceb8f (patch) | |
tree | 516152d9e531f21510208dfa4c377e6eabe434db /Master/texmf-dist/doc/support/ctan-o-mat | |
parent | 2eedf2145f5d63cdf259fc408f8c896dcf453d09 (diff) |
ctan-o-mat (15nov17)
git-svn-id: svn://tug.org/texlive/trunk@45824 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/ctan-o-mat')
-rw-r--r-- | Master/texmf-dist/doc/support/ctan-o-mat/LICENSE | 27 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/ctan-o-mat/README.md | 136 | ||||
-rwxr-xr-x | Master/texmf-dist/doc/support/ctan-o-mat/ctan-o-mat | 21 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/ctan-o-mat/ctan-o-mat.pkg | 131 | ||||
-rwxr-xr-x | Master/texmf-dist/doc/support/ctan-o-mat/lib/md2ltx.pl | 146 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/ctan-o-mat/makefile | 32 |
6 files changed, 493 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/support/ctan-o-mat/LICENSE b/Master/texmf-dist/doc/support/ctan-o-mat/LICENSE new file mode 100644 index 00000000000..f2b8136dbec --- /dev/null +++ b/Master/texmf-dist/doc/support/ctan-o-mat/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2016-2017, Gerd Neugebauer +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of ctan-o-mat nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Master/texmf-dist/doc/support/ctan-o-mat/README.md b/Master/texmf-dist/doc/support/ctan-o-mat/README.md new file mode 100644 index 00000000000..964d1690ac2 --- /dev/null +++ b/Master/texmf-dist/doc/support/ctan-o-mat/README.md @@ -0,0 +1,136 @@ +# ctan-o-mat - Upload or validate a package for CTAN + +## SYNOPSIS + +``` +ctan-o-mat [options] [<package configuration>] +``` + +## DESCRIPTION + +This program can be used to automate the upload of a package to CTAN +(https://www.ctan.org). The description of the package is contained in +a configuration file. Thus it can be updated easily without the need +to fill a Web form with the same old information. + +The provided information is validated in any case. If the validation +succeeds and not only the validation is requested then the provided +archive file is placed in the incoming area of the CTAN for further +processing by the CTAN team. + +In any case any finding during the validation is reported at the end +of the processing. Note that the validation is the default and a +official submission has to be requested by the an appropriate command +line option. + +*ctan-o-mat* requires an Internet connection to the CTAN server. Even the +validation retrieves the known attributes and the basic constraints +from the server. + + +## CONFIGURATION + +The default configuration is read from a file with the same name as +the current directory an the extension `.pkg`. This file name can be +overwritten on the command line. + +The configuration depends on the features supported by the CTAN server. +Since these features can change over time the configuration is not +hard-coded in *ctan-o-mat*. You can request a template of the +configuration via the command line parameter `-init`. + + +## OPTIONS + +<dl> + <dt><code>-h</code></dt> + <dt><code>--help</code></dt> + <dd> + Print this short summary about the usage and exit the program. + </dd> + + <dt><code>--validate</code></dt> + <dt><code>-n</code></dt> + <dt><code>--noaction</code></dt> + <dd> + Do not perform the final upload. The package is validated and the + resulting messages are printed. + </dd> + + <dt><code>-i</code></dt> + <dt><code>--init</code></dt> + <dd> + Create an empty template for a configuration. + </dd> + + <dt><code>-s</code></dt> + <dt><code>--submit</code></dt> + <dd> + Upload the submission, validate it and officially submit it to + CTAN it the validation succeeds. + </dd> + + <dt><code>-v</code></dt> + <dt><code>--verbose</code></dt> + <dd> + Print some more information during the processing (verbose mode). + </dd> + + <dt><code>--version</code></dt> + <dd> + Print the version number of this program and exit. + </dd> + + <dt><code>--validate</code></dt> + <dd> + Print some additional debugging information. + </dd> + + <dt><package></dt> + <dd> + This parameter is the name of a package configuration + (see section CONFIGURATION) contained in a file. + </dd> +</dl> + +## CONNECTING VIA PROXIES + +If you need to connect to the Internet via a proxy then this can be achieved +by setting some environment variables before running *ctan-o-mat*. +To redirect the request via the proxy simply define an environment variable +`http_proxy` to point to the proxy host -- including protocol and port as +required. Note that the name of the environment variable is supposed to be in *lower* case. + + +## INSTALLATION + +### PREREQUISITE: PERL + +*ctan-o-mat* is written in Perl. Thus a Perl interpreter has to be installed, +at least in version 5. It is assumed that the Perl interpreter is reachable +under the name `perl` on the program path. + + +### PREREQUISITE: LWP + +*ctan-o-mat* uses the LWP bundle to connect to the remote server and such. +Thus it has to be installed. With the help of Perl you can install it with +the following command line: + +``` +perl -MCPAN -e 'install Bundle::LWP' +``` + +You might want to check whether LWP can be installed with your package manager. In this case this is the preferred way. + +### INSTALLATION STEPS + +The installation is straight forward. Just put the file `ctan-o-mat.pl` and one of `ctan-o-mat` or `ctan-o-mat.bat` on your path. + +Make sure that these files are executable (if required). Now you are done. + + +## AUTHOR + +[Gerd Neugebauer](mailto:gene@gerd-neugebauer.de) + diff --git a/Master/texmf-dist/doc/support/ctan-o-mat/ctan-o-mat b/Master/texmf-dist/doc/support/ctan-o-mat/ctan-o-mat new file mode 100755 index 00000000000..664abc2d647 --- /dev/null +++ b/Master/texmf-dist/doc/support/ctan-o-mat/ctan-o-mat @@ -0,0 +1,21 @@ +#/bin/sh +##----------------------------------------------------------------------------- +## This file is part of ctan-o-mat. +## This program is distributed under BSD-like license. See file LICENSE +## +## (c) 2016-2017 Gerd Neugebauer +## +## Net: gene@gerd-neugebauer.de +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of a 3-clause BSD-like license as stated in the +## file LICENSE contained in this distribution. +## +## You should have received a copy of the LICENSE along with this +## program; if not, see the repository under http://***. +## +##----------------------------------------------------------------------------- + +exec perl $0.pl $* + +#
\ No newline at end of file diff --git a/Master/texmf-dist/doc/support/ctan-o-mat/ctan-o-mat.pkg b/Master/texmf-dist/doc/support/ctan-o-mat/ctan-o-mat.pkg new file mode 100644 index 00000000000..16353d467e0 --- /dev/null +++ b/Master/texmf-dist/doc/support/ctan-o-mat/ctan-o-mat.pkg @@ -0,0 +1,131 @@ +% This is a description file for ctan-o-mat. +% It manages uploads of a package to +% CTAN -- the Comprehensive TeX Archive Network. +% +% The syntax is roughly oriented towards (La)TeX. +% Two form of the macros are used. The simple macros take one argument +% in braces. Here the argument may not contain embedded macros. +% +% The second form uses an environment enclosed in \begin{}/\end{}. +% In the long text fields logo macros can be used. +% +% You should enter your values between the begin and the end of the +% named type. +% ------------------------------------------------------------------------- +% This field contains the CTAN id of the package. +% The value is optional. +% The value is restricted to 32 characters. +\pkg{ctan-o-mat} +% ------------------------------------------------------------------------- +% This field contains the version of the package. +% The value is optional. +% The value is restricted to 32 characters. +\version{1.0} +% ------------------------------------------------------------------------- +% This field contains the name of the author(s). +% The value is optional. +% The value is restricted to 128 characters. +\author{Gerd Neugebauer} +% ------------------------------------------------------------------------- +% This field contains the email address of the uploader. +% The value is an email address. +% The value is restricted to 255 characters. +\email{gene@gerd-neugebauer.de} +% ------------------------------------------------------------------------- +% This field contains the name of the uploader. +% The value is restricted to 255 characters. +\uploader{Gerd Neugebauer} +% ------------------------------------------------------------------------- +% This field contains the directory on CTAN. +% The value is optional. +% The value is restricted to 255 characters. +\ctanPath{/support/ctan-o-mat} +% ------------------------------------------------------------------------- +% This field contains the license. +% The value is optional. +% The value is restricted to 2048 characters. +% Multiple values are allowed. +\license{bsd3} +% ------------------------------------------------------------------------- +% This field contains the URL of the home page. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\home{https://github.com/ge-ne/ctan-o-mat} +% ------------------------------------------------------------------------- +% This field contains the URL of the bug tracker. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\bugtracker{https://github.com/ge-ne/ctan-o-mat/issues} +% ------------------------------------------------------------------------- +% This field contains the support channel. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\support{} +% ------------------------------------------------------------------------- +% This field contains the version management. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\repository{https://github.com/ge-ne/ctan-o-mat} +% ------------------------------------------------------------------------- +% This field contains the developer's channel. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\development{} +% ------------------------------------------------------------------------- +% This field contains the update indicator; true for update. +% The value is optional. +% The value is restricted to 8 characters. +\update{false} +% ------------------------------------------------------------------------- +% This field contains the topics id. +% The value is optional. +% The value is restricted to 1024 characters. +% Multiple values are allowed. +\topic{ctan} +% ------------------------------------------------------------------------- +% This field contains the text for the mail announcement. +% The value is optional. +% The value is restricted to 8192 characters. +\begin{announcement} +This program can be used to automate the upload of a package to CTAN. +The description of the package is contained in a configuration file. + +The provided information is validated in any case. If the validation +succeeds and not only the validation is requested then the provided +archive file is placed in the incoming area of the CTAN for further +processing by the CTAN team. + +In any case any finding during the validation is reported at the end +of the processing. Note that the validation is the default and a +official submission has to be requested by the an appropriate command +line option. + +ctan-o-mat requires an Internet connection to the CTAN server. Even the +validation retrieves the known attributes and the basic constraints +from the server. +\end{announcement} +% ------------------------------------------------------------------------- +% This field contains the one-liner for the package. +% The value is optional. +% The value is restricted to 4096 characters. +\begin{description}Upload or validate a package for CTAN\end{description} +% ------------------------------------------------------------------------- +% This field contains the note to the CTAN upload managers. +% The value is optional. +% The value is restricted to 2048 characters. +\begin{note}\end{note} +% ------------------------------------------------------------------------- +% This field contains the archive file. +% The value is the file name of the archive to be uploaded. +% It may have a relative or absolute directory. +\file{ctan-o-mat.zip} diff --git a/Master/texmf-dist/doc/support/ctan-o-mat/lib/md2ltx.pl b/Master/texmf-dist/doc/support/ctan-o-mat/lib/md2ltx.pl new file mode 100755 index 00000000000..53b4cffa17b --- /dev/null +++ b/Master/texmf-dist/doc/support/ctan-o-mat/lib/md2ltx.pl @@ -0,0 +1,146 @@ +#!/usr/bin/perl -w +##----------------------------------------------------------------------------- +## This file is part of ctan-o-mat. +## This program is distributed under BSD-like license. See file LICENSE +## +## (c) 2016-2017 Gerd Neugebauer +## +## Net: gene@gerd-neugebauer.de +## +## This program is free software; you can redistribute it and/or modify it +## under the terms of a 3-clause BSD-like license as stated in the file +## LICENSE contained in this distribution. +## +## You should have received a copy of the LICENSE along with this program; if +## not, see the repository under https://github.com/ge-ne/ctan-o-mat. +## +##----------------------------------------------------------------------------- + +use strict; + +use constant MODE_NORMAL => 0; +use constant MODE_PRE => 1; +use constant MODE_AUTHOR => 10; + +#------------------------------------------------------------------------------ +# Function: usage +# Arguments: none +# Returns: nothing +# Description: Print the POD to stderr and exit +# +sub usage { + use Pod::Text; + Pod::Text->new() + ->parse_from_filehandle( new FileHandle( $0, 'r' ), \*STDERR ); + exit(0); +} + +#------------------------------------------------------------------------------ +# Variable: $verbose +# Description: The verbosity indicator. +# +my $verbose = 0; + +my $version = ''; + +use Getopt::Long; +GetOptions( + "h|help" => \&usage, + "version=s" => \$version, + "v|verbose" => \$verbose, +); + +my $mode = MODE_NORMAL; +my $body = ''; +my $author = ''; +my $title = ''; + + +while(<>) { + if (m/## AUTHOR/) { + $mode = MODE_AUTHOR; + next; + } + if ($mode == MODE_AUTHOR) { + + if (m/^##/) { + $mode = MODE_NORMAL; + } else { + $author .= $_; + next; + } + } + next if m|</dd>|; + if (m/^```/) { + if ($mode == MODE_NORMAL) { + $mode = MODE_PRE; + $body .= "\\begin{verbatim}\n"; + } else { + $mode = MODE_NORMAL; + $body .= "\\end{verbatim}\n"; + } + next + } + $_ = "\\subsection*{".ucfirst(lc($1))."}\\label{$1}" if m/^### (.*)/; + $_ = "\\section*{".ucfirst(lc($1))."}\\label{$1}" if m/^## (.*)/; + if (m/^# (.*)/) { + $title = $1; + $title =~ s/--/\\\\/; + next; + } + $_ = "$`see section~\\ref{$1}$'" if m/see section ([a-z0-9]*)/i; + while (m/`([^`]+)`/) { + $_ = "$`\\texttt{$1}$'"; + } + while (m/\*([^*]+)\*/) { + $_ = "$`\\textbf{$1}$'"; + } + s/<dl>/\\begin{description}/; + s/<\/dl>/\\end{description}/; + s/<code>(.*)<\/code>/\\texttt{$1}/; + s/<dt>(.*)<\/dt>/\\item[$1]/; + s/<dd>/\\ \\\\/; + s/ - / -- /; + s/>/\\(>\\)/; + s/</\\(<\\)/; + s/_/\\_/g; + s|https?://[.a-z\/]*|\\url{$&}|; + $body .= $_; +} + +my $author_long = ''; +my $subject = ''; +if ($title =~ m/ +-+ +/) { + $title = $`; + $subject = $'; +} +if ($author =~ m/\[([a-z0-9.,:; ]*)\]\(([^()]*)\)/i) { + $author = $1; + $author_long = "$1 ($2)"; +} + +print <<__EOF__; +\\documentclass[a4paper,12pt]{scrartcl} +\\usepackage[urlcolor=blue,urlbordercolor={.85 .85 1}]{hyperref} +\\date{} +\\hypersetup{ + pdfinfo={ + Title={$title}, + Subject={$subject}, + Author={$author} + } +} + +\\author{$author_long} +\\title{$title\\thanks{This document describes \textbf{$title} version $version}\\\\$subject} +\\begin{document} +\\maketitle + +$body +\\end{document} +__EOF__ + +#------------------------------------------------------------------------------ +# Local Variables: +# mode: perl +# End: diff --git a/Master/texmf-dist/doc/support/ctan-o-mat/makefile b/Master/texmf-dist/doc/support/ctan-o-mat/makefile new file mode 100644 index 00000000000..cabe9d8d145 --- /dev/null +++ b/Master/texmf-dist/doc/support/ctan-o-mat/makefile @@ -0,0 +1,32 @@ +#****************************************************************************** +#* (c) 2017 Gerd Neugebauer +#*============================================================================= + +FILES = ctan-o-mat \ + ctan-o-mat.bat \ + ctan-o-mat.pl \ + ctan-o-mat.pkg \ + LICENSE \ + README.md \ + makefile \ + ctan-o-mat.pdf \ + lib/md2ltx.pl + +VERSION = `ctan-o-mat --version` + +all: + +clean: + $(RM) -f *~ *.out *.log *.aux ctan-o-mat.ltx + +ctan-o-mat.pdf: README.md makefile lib/md2ltx.pl + @perl lib/md2ltx.pl --version "$(VERSION)" README.md > ctan-o-mat.ltx + @xelatex -interaction=batchmode ctan-o-mat.ltx > /dev/null + @xelatex -interaction=batchmode ctan-o-mat.ltx + @$(RM) ctan-o-mat.out ctan-o-mat.aux ctan-o-mat.log + +dist ctan-o-mat.zip: $(FILES) + $(RM) ctan-o-mat.zip + (cd ..; zip ctan-o-mat/ctan-o-mat.zip $(addprefix ctan-o-mat/,$(FILES))) + +# |