Skip to content
Permalink
Browse files

Initial import of p5-sdf.

SDF (Simple Document Format) is a freely available document development
system which generates high quality outputs in a variety of formats from
a single source. The output formats supported include PostScript, HTML,
POD, plain text, man pages, LaTeX, SGML, Windows help, MIF and RTF. If
the idea of specifying documents in a logical manner via a simple markup
language sounds appealing, SDF may be useful to you.

SDF documents are simple to create and maintain, minimising the time
spent on documentation. In particular, SDF directly supports the
creation and maintenance of large, on-line documentation systems
(including intranets) via centralised hypertext management and
rule-based hypertext generation.
  • Loading branch information...
schmonz committed Sep 10, 2019
1 parent 1d4a922 commit 3442957c1949ae00950b64e32d5dd4336d91d778
@@ -0,0 +1,12 @@
SDF (Simple Document Format) is a freely available document development
system which generates high quality outputs in a variety of formats from
a single source. The output formats supported include PostScript, HTML,
POD, plain text, man pages, LaTeX, SGML, Windows help, MIF and RTF. If
the idea of specifying documents in a logical manner via a simple markup
language sounds appealing, SDF may be useful to you.

SDF documents are simple to create and maintain, minimising the time
spent on documentation. In particular, SDF directly supports the
creation and maintenance of large, on-line documentation systems
(including intranets) via centralised hypertext management and
rule-based hypertext generation.
@@ -0,0 +1,17 @@
# $NetBSD: Makefile,v 1.1 2019/09/10 21:20:35 schmonz Exp $

DISTNAME= sdf-2.001beta1
PKGNAME= p5-${DISTNAME}
CATEGORIES= textproc perl5
MASTER_SITES= ${HOMEPAGE}

MAINTAINER= schmonz@NetBSD.org
HOMEPAGE= https://cpan.metacpan.org/authors/id/I/IA/IANC/
COMMENT= Simple Document Format to generate multiple output formats
LICENSE= 2-clause-bsd

PERL5_PACKLIST= auto/SDF/.packlist
USE_LANGUAGES= # none

.include "../../lang/perl5/module.mk"
.include "../../mk/bsd.pkg.mk"
@@ -0,0 +1,11 @@
$NetBSD: distinfo,v 1.1 2019/09/10 21:20:35 schmonz Exp $

SHA1 (sdf-2.001beta1.tar.gz) = 01bf3f7e36ae139f68018e1561586da451bc5c8e
RMD160 (sdf-2.001beta1.tar.gz) = 013680e244550cdd86c54c8f0eabb420fcd8a885
SHA512 (sdf-2.001beta1.tar.gz) = 8230b90e4c425a18f79305856cea4f7a3f0c1994d93b74a67debe0740f454d7fa81e68c4d818fd4c14d8d690f7af40449c10520c219495b3854ef17747b72ce5
Size (sdf-2.001beta1.tar.gz) = 788018 bytes
SHA1 (patch-perllib_sdf_subs.pl) = 0e975864b1268e816b0a5ef4097eaa0396bed49c
SHA1 (patch-perllib_sdf_tohtml.pl) = 0c0d1baafc75c0780a56d33cd45200dbd322254d
SHA1 (patch-perllib_sdf_tomif.pl) = 649a2b16b1365ddc7fec69799264ab625f80e454
SHA1 (patch-perllib_sdf_topod.pl) = 87aaf3b276cd319d81803edb39b3f4f860538642
SHA1 (patch-perllib_sdf_tosgml.pl) = 4672455c6472be072aa94949d015247d50643c30
@@ -0,0 +1,65 @@
$NetBSD: patch-perllib_sdf_subs.pl,v 1.1 2019/09/10 21:20:35 schmonz Exp $

Use /m instead of $*, no longer available in Perl 5.30.
Patch from Debian: 005_multiline.diff

--- perllib/sdf/subs.pl.orig 1998-10-26 08:24:46.000000000 +0000
+++ perllib/sdf/subs.pl
@@ -620,10 +620,6 @@ sub ExecEventsStyleMask {
local($event, $action, $mask);
local($old_match_rule);

- # Ensure multi-line matching is enabled
- $old_match_rule = $*;
- $* = 1;
-
for ($event = $#code; $event >= 0; $event--) {

# get the action to execute, if any
@@ -632,7 +628,7 @@ sub ExecEventsStyleMask {

# Mask out events
$mask = $mask[$event];
- next if $mask ne '' && $style !~ /^$mask$/;
+ next if $mask ne '' && $style !~ /^$mask$/m;
return if $attr{'noevents'};

# execute the action
@@ -640,8 +636,6 @@ sub ExecEventsStyleMask {
&'AppMsg("warning", "execution of '$action' failed: $@") if $@;
}
- # Restore the multi-line match flag setting
- $* = $old_match_rule;
}
#
@@ -654,11 +648,6 @@ sub ExecEventsNameMask {
local(*code, *mask) = @_;
# local();
local($event, $action, $mask);
- local($old_match_rule);
-
- # Ensure multi-line matching is enabled
- $old_match_rule = $*;
- $* = 1;
for ($event = $#code; $event >= 0; $event--) {
@@ -668,15 +657,12 @@ sub ExecEventsNameMask {
# Mask out events
$mask = $mask[$event];
- next if $mask ne '' && $name !~ /^$mask$/;
+ next if $mask ne '' && $name !~ /^$mask$/m;
# execute the action
eval $action;
&'AppMsg("warning", "execution of '$action' failed: $@") if $@;
}
-
- # Restore the multi-line match flag setting
- $* = $old_match_rule;
}
#
# >>Description::
@@ -0,0 +1,48 @@
$NetBSD: patch-perllib_sdf_tohtml.pl,v 1.1 2019/09/10 21:20:35 schmonz Exp $

Use /m instead of $*, no longer available in Perl 5.30.
Patch from Debian: 005_multiline.diff

--- perllib/sdf/tohtml.pl.orig 1998-10-23 22:59:44.000000000 +0000
+++ perllib/sdf/tohtml.pl
@@ -759,19 +759,12 @@ sub _HtmlEscape {
# local($result);
local($old_match_flag);

- # Enable multi-line matching
- $old_match_flag = $*;
- $* = 1;
-
# Escape the symbols
$text =~ s/\&/&/g;
$text =~ s/\</&lt;/g;
$text =~ s/\>/&gt;/g;
$text =~ s/\"/&quot;/g;

- # Reset multi-line matching flag
- $* = $old_match_flag;
-
# Return result
$text;
}
@@ -865,10 +858,6 @@ sub _HtmlAddAnchors {
local($user_ext);
local($old_match_flag);

- # Enable multi-line matching
- $old_match_flag = $*;
- $* = 1;
-
# For hypertext jumps, surround the text. If the
# text contains a jump, the existing jump is removed.
if ($attr{'jump'} ne '') {
@@ -904,9 +893,6 @@ sub _HtmlAddAnchors {
$result++;
}

- # Reset multi-line matching flag
- $* = $old_match_flag;
-
# Return result
return $result;
}
@@ -0,0 +1,135 @@
$NetBSD: patch-perllib_sdf_tomif.pl,v 1.1 2019/09/10 21:20:35 schmonz Exp $

Use /m instead of $*, no longer available in Perl 5.30.
Patch from Debian: 005_multiline.diff

--- perllib/sdf/tomif.pl.orig 1998-10-23 22:59:43.000000000 +0000
+++ perllib/sdf/tomif.pl
@@ -660,16 +660,12 @@ sub _MifAddSection {
sub _MifEscape {
local(*text, $escape_space) = @_;
# local();
- local($orig_linematch_flag);

- $orig_linematch_flag = $*;
- $* = 1;
$text =~ s/([\\>])/\\$1/g;
$text =~ s/\t/\\t/g;
$text =~ s/'/\\q/g;
$text =~ s/`/\\Q/g;
$text =~ s/ /\\ /g if $escape_space;
- $* = $orig_linematch_flag;
}

#
@@ -1984,7 +1980,7 @@ sub _MifFinalise {
local(@out_result);
local($pwidth, $pheight);
local($component_prefix);
- local(%offset, $old_match_rule);
+ local(%offset);
local(%merged_ctrls, %merged_vars, %merged_xrefs);
local(%merged_paras, %merged_fonts, %merged_tbls);
local($mainflow);
@@ -2099,12 +2095,9 @@ $igc_start = time;
"<Notes ",
"> # end of Notes",
@text);
- $old_match_rule = $*;
- $* = 1;
$mainflow =~ s/\<ParaLine/$&\n <TextRectID $_MIF_TEXTFLOW_MAIN>/;
$mainflow =~ s/\n/\n /g;
$mainflow .= "\n> # end of TextFlow";
- $* = $old_match_rule;

# Add the text flows to the import table
push(@out_result, join("\n", @_mif_textflows, $mainflow));
@@ -2315,7 +2308,7 @@ sub _MifAddTextFlow {
local(*text, $tag, $mif) = @_;
local($id);
local(@hdr, @flow);
- local($textflow, $old_match_rule);
+ local($textflow);

# Get the next text flow id
$id = $_mif_textflow_cnt++;
@@ -2340,12 +2333,9 @@ sub _MifAddTextFlow {
# Convert to a text flow
if (@flow) {
$textflow = join("\n", @flow);
- $old_match_rule = $*;
- $* = 1;
$textflow =~ s/\<ParaLine/$&\n <TextRectID $id>/;
$textflow =~ s/\n/\n /g;
$textflow .= "\n> # end of TextFlow";
- $* = $old_match_rule;
}

# If nothing was generated, build the text flow with a dummy paragraph
@@ -2805,7 +2795,7 @@ sub _MifAddLists {
local(%attr);
local($layout);
local($i);
- local($old_match_rule, $toc_offset);
+ local($toc_offset);

# Set some flags based on the output ultimately generated
$target = $SDF_USER'var{'OPT_TARGET'};
@@ -2833,8 +2823,6 @@ sub _MifAddLists {
# Insert the generated lists before the first level 1 heading
push(@_mif_toc_list, @_mif_lof_list, @_mif_lot_list);
if (@_mif_toc_list) {
- $old_match_rule = $*;
- $* = 1;
$toc_offset = 0;
para:
for ($i = 0; $i <= $#text; $i++) {
@@ -2843,7 +2831,6 @@ sub _MifAddLists {
last para;
}
}
- $* = $old_match_rule;
splice(@text, $toc_offset, 0, @_mif_toc_list);
}
}
@@ -2901,15 +2888,9 @@ sub _MifMerge {
local(*template, *import, %offset) = @_;
local(@new);
local($record, $obj);
- local($old_match_rule);
local($merged_pages, $merged_textflows, %ref_textflow);
local($side_width);
local($page_type, $page_name, $page_size, $cover_rect);
-
- # To permit multi-line matching, save the old state here and
- # restore it later
- $old_match_rule = $*;
- $* = 1;
#
# Do the merge. We ignore BookComponent objects
@@ -2926,14 +2907,14 @@ sub _MifMerge {
while($record = shift(@template)) {
# Find the object 'name'
- unless ($record =~ /^\<(\w+)/) {
+ unless ($record =~ /^\<(\w+)/m) {
&AppExit("fatal", "MIF template error - expecting object");
}
$obj = $1;
# Patch the comment to claim responsibility
if ($obj eq 'MIFFile') {
- $record =~ s/\>.*$/>/;
+ $record =~ s/\>.*$/>/m;
$record .= " # Generated by $app_product_name $app_product_version";
}
@@ -2993,7 +2974,6 @@ sub _MifMerge {
}
# Return result
- $* = $old_match_rule;
return @new;
}
@@ -0,0 +1,27 @@
$NetBSD: patch-perllib_sdf_topod.pl,v 1.1 2019/09/10 21:20:35 schmonz Exp $

Use /m instead of $*, no longer available in Perl 5.30.
Patch from Debian: 005_multiline.diff

--- perllib/sdf/topod.pl.orig 1998-10-23 22:59:43.000000000 +0000
+++ perllib/sdf/topod.pl
@@ -388,19 +388,11 @@ sub _PodFinalise {
sub _PodEscape {
local($text, $nested) = @_;
# local($result);
- local($old_match_flag);
-
- # Enable multi-line matching
- $old_match_flag = $*;
- $* = 1;

# Escape the symbols
my $gt = $nested ? 'E<gt>' : '>';
$text =~ s/([A-Z])\<|\>/length($&) == 1 ? $gt : "$1E<lt>"/eg;

- # Reset multi-line matching flag
- $* = $old_match_flag;
-
# Return result
$text;
}
@@ -0,0 +1,55 @@
$NetBSD: patch-perllib_sdf_tosgml.pl,v 1.1 2019/09/10 21:20:35 schmonz Exp $

Use /m instead of $*, no longer available in Perl 5.30.
Patch from Debian: 005_multiline.diff

--- perllib/sdf/tosgml.pl.orig 1998-10-23 22:59:43.000000000 +0000
+++ perllib/sdf/tosgml.pl
@@ -415,11 +415,6 @@ sub _SgmlFinalise {
sub _SgmlEscape {
local($text) = @_;
# local($result);
- local($old_match_flag);
-
- # Enable multi-line matching
- $old_match_flag = $*;
- $* = 1;

# Escape the special symbols. Note that it isn't exactly clear
# from the SGML-Tools and/or QWERTZ DTD documentation as to
@@ -437,9 +432,6 @@ sub _SgmlEscape {
$text =~ s/\|/&verbar;/g;
$text =~ s/\[/&ftag;/g;

- # Reset multi-line matching flag
- $* = $old_match_flag;
-
# Return result
$text;
}
@@ -527,15 +519,10 @@ sub _SgmlAddAnchors {
local($result);
local($value);
local($user_ext);
- local($old_match_flag);

# Skip this routine for now
return 0;

- # Enable multi-line matching
- $old_match_flag = $*;
- $* = 1;
-
# For hypertext jumps, surround the text. If the
# text contains a jump, the existing jump is removed.
if ($attr{'jump'} ne '') {
@@ -571,9 +558,6 @@ sub _SgmlAddAnchors {
$result++;
}

- # Reset multi-line matching flag
- $* = $old_match_flag;
-
# Return result
return $result;
}

0 comments on commit 3442957

Please sign in to comment.
You can’t perform that action at this time.