/blib
/cover_db
*.gz
+*.1
+*.5
+*.7
+*.html
+*.gz
+++ /dev/null
-*.1
-*.5
-*.7
# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
all::
+RSYNC = rsync
+RSYNC_DEST = ssoma.public-inbox.org:/srv/ssoma/
+docs := README COPYING INSTALL $(shell git ls-files 'Documentation/*.txt')
INSTALL = install
PANDOC = pandoc
PANDOC_OPTS = -f markdown --email-obfuscation=none
man5 := $(addsuffix .5, $(m5))
man7 := $(addsuffix .7, $(m7))
-all:: man
+all:: man html
man: $(man1) $(man5) $(man7)
test -z "$(man1)" || $(INSTALL) -m 644 $(man1) $(DESTDIR)$(man1dir)
test -z "$(man5)" || $(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
test -z "$(man7)" || $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
-%.1 %.5 %.7 : %.txt
+%.1 %.5 %.7 : Documentation/%.txt
$(pandoc) -s -t man < $< > $@+ && mv $@+ $@
-clean::
- $(RM) $(man1) $(man5) $(man7)
+txt2pre = ./Documentation/txt2pre < $< > $@+ && touch -r $< $@+ && mv $@+ $@
+txt = INSTALL README COPYING
+
+INSTALL.html: INSTALL
+ $(txt2pre)
+index.html: README
+ $(txt2pre)
+
+docs_html := index.html INSTALL.html
+html: $(docs_html)
+gz_docs := $(addsuffix .gz, $(docs) $(docs_html))
+rsync_docs := $(gz_docs) $(docs) $(txt) $(docs_html)
+%.gz: %
+ gzip -9 --rsyncable < $< > $@+
+ touch -r $< $@+
+ mv $@+ $@
+
+gz-doc: $(gz_docs)
+rsync-doc:
+ git set-file-times $(docs) $(txt)
+ $(MAKE) gz-doc
+ $(RSYNC) --chmod=Fugo=r -av $(rsync_docs) $(RSYNC_DEST)
+clean-doc:
+ $(RM) $(man1) $(man5) $(man7) $(gz_docs) $(docs_html)
--- /dev/null
+#!/usr/bin/env perl
+# Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors
+# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+#
+# Stupid script to make HTML from preformatted, utf-8 text versions,
+# only generating links for http(s). Markdown does too much
+# and requires indentation to output preformatted text.
+use strict;
+use warnings;
+use CGI qw/escapeHTML/;
+use Encode qw/encode/;
+my $str = eval { local $/; <> };
+$str = escapeHTML($str);
+$str = encode('us-ascii', $str, Encode::HTMLCREF);
+my ($title) = ($str =~ /\A([^\n]+)/);
+
+# temporarily swap > for escape so our s!! to add href works.
+# there's probably a way to do this with only a single s!! ...
+$str =~ s!>!\e!g;
+$str =~ s!\b(https?://[\w+\+\&\?\.\%\;/-]+)!<a\nhref="$1"\n>$1</a>!g;
+$str =~ s!\e!>!g; # swap escapes back to >
+
+print '<html><head>',
+ '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',
+ "<title>$title</title>",
+ "</head><body>\n<pre>", $str , '</pre></body></html>';
.gitignore
COPYING
-Documentation/.gitignore
-Documentation/GNUmakefile
+Documentation/include.mk
Documentation/ssoma-mda.txt
Documentation/ssoma-rm.txt
Documentation/ssoma.txt
Documentation/ssoma_repository.txt
+Documentation/txt2pre
INSTALL
+MANIFEST
Makefile.PL
README
lib/Ssoma/Extractor.pm
sub MY::postamble {
<<'EOF';
-RSYNC_DEST = ssoma.public-inbox.org:/srv/ssoma/
-docs = INSTALL README COPYING $(shell git ls-files Documentation/ '*.txt')
-gz_docs = $(addsuffix .gz, $(docs))
-%.gz: %
- gzip -9 --rsyncable < $< > $@+
- touch -r $< $@+
- mv $@+ $@
-
-gz-docs: $(gz_docs)
-rsync-docs:
- git set-file-times $(docs)
- $(MAKE) gz-docs
- rsync --chmod=Fugo=r -av $(gz_docs) $(docs) $(RSYNC_DEST)
-
+-include Documentation/include.mk
N = $(shell echo $$(( $$(nproc 2>/dev/null || echo 2) + 1)))
check:: pure_all
prove -lv -j$(N)