summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-mail/mhonarc-gentoo/ChangeLog11
-rw-r--r--net-mail/mhonarc-gentoo/files/mhonarc-gentoo-2.6.18-archives-gentoo.patch197
-rw-r--r--net-mail/mhonarc-gentoo/metadata.xml9
-rw-r--r--net-mail/mhonarc-gentoo/mhonarc-gentoo-2.6.18.ebuild34
4 files changed, 251 insertions, 0 deletions
diff --git a/net-mail/mhonarc-gentoo/ChangeLog b/net-mail/mhonarc-gentoo/ChangeLog
new file mode 100644
index 000000000000..667eb78eeb15
--- /dev/null
+++ b/net-mail/mhonarc-gentoo/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for net-mail/mhonarc-gentoo
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-mail/mhonarc-gentoo/ChangeLog,v 1.1 2011/05/02 22:21:32 tampakrap Exp $
+
+*mhonarc-gentoo-2.6.18 (02 May 2011)
+
+ 02 May 2011; Theo Chatzimichos <tampakrap@gentoo.org>
+ +mhonarc-gentoo-2.6.18.ebuild,
+ +files/mhonarc-gentoo-2.6.18-archives-gentoo.patch, +metadata.xml:
+ Initial commit of the MHonArc's Gentoo fork
+
diff --git a/net-mail/mhonarc-gentoo/files/mhonarc-gentoo-2.6.18-archives-gentoo.patch b/net-mail/mhonarc-gentoo/files/mhonarc-gentoo-2.6.18-archives-gentoo.patch
new file mode 100644
index 000000000000..d67c63e4b95f
--- /dev/null
+++ b/net-mail/mhonarc-gentoo/files/mhonarc-gentoo-2.6.18-archives-gentoo.patch
@@ -0,0 +1,197 @@
+diff -Nuar a/lib/mhamain.pl b/lib/mhamain.pl
+--- a/lib/mhamain.pl 2006-06-10 02:42:58.000000000 +0000
++++ b/lib/mhamain.pl 2008-01-27 14:12:48.000000000 +0000
+@@ -73,6 +73,8 @@
+ TERM TRAP USR1 USR2 VTALRM XCPU XFSZ
+ );
+
++use Carp;
++
+ ###############################################################################
+ ## Public routines
+ ###############################################################################
+@@ -934,6 +936,16 @@
+ } else {
+ $ctype = 'text/plain';
+ }
++
++ ##-----------------------------##
++ ## Get Custom Archives headers ##
++ ##-----------------------------##
++ if (defined($fields->{'x-archives-hash'})) {
++ $msghash = $fields->{'x-archives-hash'}[0];
++ }
++ if(!defined($msghash)) {
++ confess("No X-Archives-Hash header in $handle");
++ }
+
+ ## Insure uniqueness of index
+ $index .= $X . sprintf('%d',(defined($msgnum)?$msgnum:($LastMsgNum+1)));
+@@ -955,6 +967,7 @@
+ $Subject{$index} = $sub;
+ $MsgHead{$index} = htmlize_header($fields);
+ $ContentType{$index} = $ctype;
++ $MsgHash{$index} = $msghash;
+ if ($msgid) {
+ $MsgId{$msgid} = $index;
+ $NewMsgId{$msgid} = $index; # Track new message-ids
+@@ -966,6 +979,7 @@
+ } else {
+ $IndexNum{$index} = getNewMsgNum();
+ }
++ #$MsgHash{$IndexNum{$index}} = $msghash;
+
+ $Refs{$index} = [ @refs ] if (@refs);
+
+@@ -1102,7 +1116,7 @@
+
+ my $adding = ($ADD && !$force && !$SINGLE);
+ my $i_p0 = fmt_msgnum($msgnum);
+- my $filename = msgnum_filename($msgnum);
++ my $filename = msgnum_filename($index);
+ my $filepathname = join($DIRSEP, $OUTDIR, $filename);
+ my $tmppathname;
+
+@@ -1160,7 +1174,9 @@
+ "<!--X-Message-Id: ",
+ commentize($Index2MsgId{$index}), " -->\n",
+ "<!--X-Content-Type: ",
+- commentize($ContentType{$index}), " -->\n";
++ commentize($ContentType{$index}), " -->\n",
++ "<!--X-Archives-Hash: ",
++ commentize($MsgHash{$index}), " -->\n";
+
+ if (defined($Refs{$index})) {
+ foreach (@{$Refs{$index}}) {
+@@ -1456,8 +1472,9 @@
+ #&defineIndex2MsgId();
+ my $msgnum = $IndexNum{$key};
+ return (undef, undef) if ($msgnum eq '');
+- my $filename = join($DIRSEP, $OUTDIR, &msgnum_filename($msgnum));
++ my $filename = join($DIRSEP, $OUTDIR, &msgnum_filename($key));
+
++ delete $MsgHash{$key};
+ delete $ContentType{$key};
+ delete $Date{$key};
+ delete $From{$key};
+diff -Nuar a/lib/mhdb.pl b/lib/mhdb.pl
+--- a/lib/mhdb.pl 2005-12-20 21:28:15.000000000 +0000
++++ b/lib/mhdb.pl 2008-01-27 13:25:52.000000000 +0000
+@@ -61,6 +61,7 @@
+
+ ## Meta-data
+ print_var($db,'ContentType', \%ContentType);
++print_var($db,'MsgHash', \%MsgHash);
+ print_var($db,'Date', \%Date);
+ print_var($db,'Derived', \%Derived);
+ print_var($db,'FollowOld', \%Follow);
+diff -Nuar a/lib/mhinit.pl b/lib/mhinit.pl
+--- a/lib/mhinit.pl 2005-07-08 06:34:03.000000000 +0000
++++ b/lib/mhinit.pl 2008-01-27 13:25:52.000000000 +0000
+@@ -247,6 +247,7 @@
+ %Follow = (); # Index key to follow-ups
+ %FolCnt = (); # Index key to number of follow-ups
+ %ContentType = (); # Index key to base content-type of message
++%MsgHash = (); # Custom hash from header in mail
+ %Icons = (); # Index key to icon URL for content-type
+ %AddIndex = (); # Flags for messages that must be written
+
+diff -Nuar a/lib/mhmsgfile.pl b/lib/mhmsgfile.pl
+--- a/lib/mhmsgfile.pl 2001-09-17 16:10:28.000000000 +0000
++++ b/lib/mhmsgfile.pl 2008-01-27 14:12:16.000000000 +0000
+@@ -123,6 +123,10 @@
+ if (defined($href->{'derived'})) {
+ $Derived{$index} = $href->{'derived'};
+ }
++
++ if (defined($href->{'archives-hash'})) {
++ $MsgHash{$index} = $href->{'archives-hash'};
++ }
+
+ $IndexNum{$index} = int($msgnum);
+
+diff -Nuar a/lib/mhopt.pl b/lib/mhopt.pl
+--- a/lib/mhopt.pl 2005-07-08 06:34:03.000000000 +0000
++++ b/lib/mhopt.pl 2008-01-27 13:25:52.000000000 +0000
+@@ -764,6 +764,7 @@
+ delete($MsgId{''});
+ delete($FollowOld{''});
+ delete($ContentType{''});
++ delete($MsgHash{''});
+ delete($Refs{''});
+
+ # update DOCURL if default old value
+diff -Nuar a/lib/mhrcvars.pl b/lib/mhrcvars.pl
+--- a/lib/mhrcvars.pl 2005-07-08 05:27:52.000000000 +0000
++++ b/lib/mhrcvars.pl 2008-01-27 14:11:19.000000000 +0000
+@@ -195,7 +195,7 @@
+ }
+ if ($var eq 'MSG') { ## Filename of message page
+ ($lref, $key, $pos) = compute_msg_pos($index, $var, $arg);
+- $tmp = defined($key) ? &msgnum_filename($IndexNum{$key}) : "";
++ $tmp = defined($key) ? &msgnum_filename($key) : "";
+ last REPLACESW;
+ }
+ if ($var eq 'MSGHFIELD') { ## Message header field
+@@ -417,7 +417,7 @@
+ if (!defined($key)) { $tmp = ""; last REPLACESW; }
+ $tmp = qq/name="/ . &fmt_msgnum($IndexNum{$key}) .
+ qq/" href="/ .
+- &msgnum_filename($IndexNum{$key}) .
++ &msgnum_filename($key) .
+ qq/"/;
+ last REPLACESW;
+ }
+@@ -432,7 +432,7 @@
+ $isurl = 0;
+ ($lref, $key, $pos) = compute_msg_pos($index, $var, $arg);
+ if (!defined($key)) { $tmp = ""; last REPLACESW; }
+- $tmp = qq/href="/ . &msgnum_filename($IndexNum{$key}) . qq/"/;
++ $tmp = qq/href="/ . &msgnum_filename($key) . qq/"/;
+ last REPLACESW;
+ }
+ if ($var eq 'IDXFNAME') { ## Filename of index page
+@@ -730,7 +730,7 @@
+ $ret = qq|<a name="| .
+ &fmt_msgnum($IndexNum{$index}) .
+ qq|" href="| .
+- &msgnum_filename($IndexNum{$index}) .
++ &msgnum_filename($index) .
+ qq|">$ret</a>|
+ if $var eq 'SUBJECT' && $arg eq "" && !$mailto;
+
+diff -Nuar a/lib/mhutil.pl b/lib/mhutil.pl
+--- a/lib/mhutil.pl 2005-07-08 05:27:53.000000000 +0000
++++ b/lib/mhutil.pl 2008-01-27 14:11:50.000000000 +0000
+@@ -28,6 +28,7 @@
+ package mhonarc;
+
+ use MHonArc::RFC822;
++use Carp;
+
+ ## RFC 2369 header fields to check for URLs
+ %HFieldsList = (
+@@ -304,16 +305,20 @@
+ ## Routine to get filename of a message number.
+ ##
+ sub msgnum_filename {
+- my($fmtstr) = "$MsgPrefix%05d.$HtmlExt";
++ my $msgnum = $_[0];
++ my($fmtstr) = "$MsgPrefix%s.$HtmlExt";
+ $fmtstr .= ".gz" if $GzipLinks;
+- sprintf($fmtstr, $_[0]);
++ if(!defined($MsgHash{$msgnum})) {
++ confess("Could not find X-Archives-Hash for msgnum=$msgnum");
++ }
++ sprintf($fmtstr, $MsgHash{$msgnum});
+ }
+
+ ##---------------------------------------------------------------------------
+ ## Routine to get filename of an index
+ ##
+ sub get_filename_from_index {
+- &msgnum_filename($IndexNum{$_[0]});
++ &msgnum_filename($_[0]);
+ }
+
+ ##---------------------------------------------------------------------------
diff --git a/net-mail/mhonarc-gentoo/metadata.xml b/net-mail/mhonarc-gentoo/metadata.xml
new file mode 100644
index 000000000000..8b5f73e9587b
--- /dev/null
+++ b/net-mail/mhonarc-gentoo/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>tampakrap@gentoo.org</email>
+ <name>Theo Chatzimichos</name>
+ </maintainer>
+</pkgmetadata>
+
diff --git a/net-mail/mhonarc-gentoo/mhonarc-gentoo-2.6.18.ebuild b/net-mail/mhonarc-gentoo/mhonarc-gentoo-2.6.18.ebuild
new file mode 100644
index 000000000000..03e48b596a7c
--- /dev/null
+++ b/net-mail/mhonarc-gentoo/mhonarc-gentoo-2.6.18.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-mail/mhonarc-gentoo/mhonarc-gentoo-2.6.18.ebuild,v 1.1 2011/05/02 22:21:32 tampakrap Exp $
+
+inherit perl-app
+
+IUSE=""
+
+SRC_URI="http://www.mhonarc.org/release/MHonArc/tar/MHonArc-${PV}.tar.bz2"
+RESTRICT="mirror"
+
+DESCRIPTION="Perl Mail-to-HTML Converter, Gentoo fork"
+HOMEPAGE="http://www.mhonarc.org/"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="!net-mail/mhonarc"
+
+S="${WORKDIR}/${P/mhonarc-gentoo/MHonArc}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-archives-gentoo.patch
+}
+
+src_install() {
+ sed -e "s|-prefix |-docpath '${D}/usr/share/doc/${PF}' -prefix '${D}'|g" -i Makefile
+ sed -e "s|installsitelib|installvendorlib|g" -i install.me
+ perl-module_src_install
+ prepalldocs
+}