summaryrefslogtreecommitdiff
path: root/net-nntp/newspost
diff options
context:
space:
mode:
Diffstat (limited to 'net-nntp/newspost')
-rw-r--r--net-nntp/newspost/Manifest8
-rw-r--r--net-nntp/newspost/files/CAN-2005-0101.patch11
-rw-r--r--net-nntp/newspost/files/newspost-2.1.1-glibc-2.10.patch57
-rw-r--r--net-nntp/newspost/files/newspost-2.1.1-nntp.patch69
-rw-r--r--net-nntp/newspost/metadata.xml5
-rw-r--r--net-nntp/newspost/newspost-2.1.1-r3.ebuild34
6 files changed, 184 insertions, 0 deletions
diff --git a/net-nntp/newspost/Manifest b/net-nntp/newspost/Manifest
new file mode 100644
index 000000000000..9a112b1aa7ee
--- /dev/null
+++ b/net-nntp/newspost/Manifest
@@ -0,0 +1,8 @@
+AUX CAN-2005-0101.patch 284 SHA256 cfa2276d82c991d8a45a12652a8b17963121ba4e7f42354fd54e9f9f23934377 SHA512 fca2c27d94310c786ffa6b3b376c5dc04752f9c41688ac335bbbf440e972dcc06f8495090fd52bdb4f33c34009fc0536bf411809f93310f474f703d28c199dc5 WHIRLPOOL 03eb8e8df73b4ab899b45c5502064872bb26d5248fc3d224ca82a2f304d67bb81bfcfb7a983c1b340c9772eb10ed569850461d4f7e76e16e21a1aea96f4bc89f
+AUX newspost-2.1.1-glibc-2.10.patch 2038 SHA256 a0be86639a3fc953e40a56a348cfe48da2fb3e4e46c4e055b3ee9ddac6018437 SHA512 6e1c9a30d282dd2e3e133571bb747d5c7b133dab54f9f464e32e23655d8534e4e1cfb388291116c8c28ef3ad7515cde5c9d7ce053407928df38bdcf014f14a2f WHIRLPOOL f09b67f1335dd5f4889f3fc9f861b2b6d67db67cb87e1635ee0b7dab26ff3b0b971c237868a3f712667b5969f8ead535b324ad023680ebe72f2180e4a7a2060a
+AUX newspost-2.1.1-nntp.patch 1845 SHA256 7fae7a480aeeb55eb6c9579040d26a1de71fd60ac10736635a836f61ccf326de SHA512 c636657d1e33ba6861c1625f5798e5b98e546719331a91b455156e3af45be71873feee357d72a778da81058457299476d39a1c3674a2572185fd355f96b4f77d WHIRLPOOL 43298de8da16bfe568319de6aa0f7ba5afd64534d93e6c4bc0b1d992ff361a063edacc890ecc169a4013631d11525f0520a04f71ad477493c2c9322b948e614f
+DIST newspost-2.1.1.tar.gz 61412 SHA256 bdd1ae83d7459d2cdd726115c028405fce33f9b60e71b88969f82fbc02672be7 SHA512 d7f5b583ef5619a65e87f2ce2edbad307d60da7f29e5c6bef8eaa7c757f97f82f08654409a75ea7b28e5575fd267af57cbc170f467f6737f701bfbd6bd4b2f66 WHIRLPOOL 7ab7e3a39b300ab262293be4933105b2796d85ae8af919a22adf164754bcc598abe9c75974aa99670e3037d211189b78385771128c2d4b871700f52f7bba9ad8
+EBUILD newspost-2.1.1-r3.ebuild 809 SHA256 4f979db7e103303e97a7f5dded080ec464d03a2563124f609c5ec5ef77024cda SHA512 d99701db03b744ba233177012a2be5b786bba69a4983b16820c88d16d657b46a598c27b139dd534b879acedf4b403a877df6c01176eec71e39446d7084b975b1 WHIRLPOOL 15dd27bbe66fb2d2e934cae2e08483dc79f9ab1e23cb3ae19bd9af24f8363641941f3123ba1ca601be3bbdfaf9069e66805d34fc129ba019744d20e17cd6d7ba
+MISC ChangeLog 2569 SHA256 7412c9cf2675cf50286e5e22edf7fefc73ab18610592085366db28126708cd11 SHA512 0b68f482531c3fe5a354ce952c63acf214aebde373fe63dbe3679a8e5ea96a12481e06c5b60a565d25a54f562602ea742b8c9d86509d2fb73f81210e20d6eddf WHIRLPOOL 1a386763e0358feaff3661e28ab3bca0ca484f5700a4d793ec3cae71b4553863fb350479e595c436e367fa781f5a4897d3263550832ce6b180e4cebb45501c57
+MISC ChangeLog-2015 4812 SHA256 5b8167aa0447ea27f4a8ece528922adce63fae78b2c5266dd7178a15bd78503e SHA512 273bea2381014679dc51ccf9bd00ad0ced94c34acd7a5c7f30ca9f81f08c7c83f3c04a6e57d1a4bacea1182e166465696c7115a99eef8d3d9cab3cfeb05902dd WHIRLPOOL a1dd21204a97be68b45ac9a0f3d282716e6868e13f0bdf5a26169ba15ddcc8cf1e4479d72e34a1419122c8ec999d0e5303e0caee0c3b2e9b20493005faff889e
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/net-nntp/newspost/files/CAN-2005-0101.patch b/net-nntp/newspost/files/CAN-2005-0101.patch
new file mode 100644
index 000000000000..2bfdfc2c190d
--- /dev/null
+++ b/net-nntp/newspost/files/CAN-2005-0101.patch
@@ -0,0 +1,11 @@
+--- base/socket.c.orig Tue Jan 18 11:08:02 2005
++++ base/socket.c Tue Jan 18 11:10:08 2005
+@@ -126,7 +126,7 @@
+
+ i = 0;
+ pi = buffer;
+- while (TRUE) {
++ while (read_count < STRING_BUFSIZE - 1) {
+ retval = read(sockfd, pi, 1);
+ if(retval < 0)
+ ui_socket_error(errno);
diff --git a/net-nntp/newspost/files/newspost-2.1.1-glibc-2.10.patch b/net-nntp/newspost/files/newspost-2.1.1-glibc-2.10.patch
new file mode 100644
index 000000000000..fdaa78cbefb7
--- /dev/null
+++ b/net-nntp/newspost/files/newspost-2.1.1-glibc-2.10.patch
@@ -0,0 +1,57 @@
+diff -ur newspost-2.1.1.orig/base/newspost.c newspost-2.1.1/base/newspost.c
+--- newspost-2.1.1.orig/base/newspost.c 2003-04-23 18:33:23.000000000 +0300
++++ newspost-2.1.1/base/newspost.c 2009-08-06 14:46:41.000000000 +0300
+@@ -342,7 +342,7 @@
+ file = fopen(filename, "r");
+ if (file != NULL) {
+ while (!feof(file)) {
+- line = getline(line, file);
++ line = get_line(line, file);
+ if(line == NULL){
+ text_buffer = buff_add(text_buffer, "\r\n");
+ continue;
+diff -ur newspost-2.1.1.orig/base/utils.c newspost-2.1.1/base/utils.c
+--- newspost-2.1.1.orig/base/utils.c 2009-08-06 14:44:35.000000000 +0300
++++ newspost-2.1.1/base/utils.c 2009-08-06 14:45:20.000000000 +0300
+@@ -43,7 +43,7 @@
+ return NULL;
+ }
+
+-Buff * getline(Buff *buff, FILE *file){
++Buff * get_line(Buff *buff, FILE *file){
+ int c = fgetc(file);
+ buff = buff_free(buff);
+ while(TRUE){
+diff -ur newspost-2.1.1.orig/base/utils.h newspost-2.1.1/base/utils.h
+--- newspost-2.1.1.orig/base/utils.h 2003-02-08 17:09:41.000000000 +0200
++++ newspost-2.1.1/base/utils.h 2009-08-06 14:45:13.000000000 +0300
+@@ -26,7 +26,7 @@
+ file_entry * file_entry_alloc();
+ file_entry * file_entry_free(file_entry *fe);
+
+-Buff * getline(Buff *buff, FILE *file);
++Buff * get_line(Buff *buff, FILE *file);
+ Buff *buff_add(Buff *buff, char *data, ... );
+ Buff * buff_free(Buff *buff);
+ Buff *buff_create(Buff *buff, char *data, ... );
+diff -ur newspost-2.1.1.orig/ui/options.c newspost-2.1.1/ui/options.c
+--- newspost-2.1.1.orig/ui/options.c 2003-04-23 18:33:33.000000000 +0300
++++ newspost-2.1.1/ui/options.c 2009-08-06 14:46:31.000000000 +0300
+@@ -332,7 +332,7 @@
+ file = fopen(filename->data, "r");
+ if (file != NULL) {
+ while (!feof(file)) {
+- line = getline(line, file);
++ line = get_line(line, file);
+ linenum++;
+ if(line == NULL) continue;
+
+@@ -429,7 +429,7 @@
+ linenum = 0;
+ while (linenum < 8) {
+ linenum++;
+- line = getline(line, file);
++ line = get_line(line, file);
+ if(line == NULL) continue;
+
+ switch (linenum) {
diff --git a/net-nntp/newspost/files/newspost-2.1.1-nntp.patch b/net-nntp/newspost/files/newspost-2.1.1-nntp.patch
new file mode 100644
index 000000000000..8779e8f36b47
--- /dev/null
+++ b/net-nntp/newspost/files/newspost-2.1.1-nntp.patch
@@ -0,0 +1,69 @@
+--- newspost-2.1.1.orig/base/nntp.c
++++ newspost-2.1.1/base/nntp.c
+@@ -26,6 +26,10 @@
+ *** Public Routines
+ **/
+
++int _nntp_post(const char *subject, newspost_data *data,
++ const char *buffer, long length,
++ boolean no_ui_updates);
++
+ boolean nntp_logon(newspost_data *data) {
+ char buffer[STRING_BUFSIZE];
+
+@@ -78,6 +82,35 @@
+ int nntp_post(const char *subject, newspost_data *data,
+ const char *buffer, long length,
+ boolean no_ui_updates) {
++ int retval = _nntp_post(subject, data, buffer, length, no_ui_updates);
++
++ if (retval == POSTING_FAILED-64) {
++ /* try log out then back in */
++ ui_nntp_posting_retry();
++ nntp_logoff();
++ socket_close();
++ sleep(5);
++
++ /* create the socket */
++ ui_socket_connect_start(data->address->data);
++ retval = socket_create(data->address->data, data->port);
++ if (retval < 0)
++ return retval;
++ ui_socket_connect_done();
++
++ ui_nntp_logon_start(data->address->data);
++ if (nntp_logon(data) == FALSE)
++ return POSTING_FAILED;
++ ui_nntp_logon_done();
++
++ retval = _nntp_post(subject, data, buffer, length, no_ui_updates);
++ }
++ return retval;
++}
++
++int _nntp_post(const char *subject, newspost_data *data,
++ const char *buffer, long length,
++ boolean no_ui_updates) {
+ char response[STRING_BUFSIZE];
+ const char *pi;
+ long i, chunksize;
+@@ -95,7 +128,7 @@
+ if (strncmp(response, NNTP_PROCEED_WITH_POST, 3) != 0) {
+ /* this shouldn't really happen */
+ ui_nntp_unknown_response(response);
+- return POSTING_FAILED;
++ return POSTING_FAILED-64;
+ }
+
+ buff = buff_add(buff, "From: %s\r\n", data->from->data);
+--- newspost-2.1.1.orig/base/utils.c
++++ newspost-2.1.1/base/utils.c
+@@ -44,7 +44,7 @@
+ }
+
+ Buff * getline(Buff *buff, FILE *file){
+- char c = fgetc(file);
++ int c = fgetc(file);
+ buff = buff_free(buff);
+ while(TRUE){
+ if((c == '\n')
diff --git a/net-nntp/newspost/metadata.xml b/net-nntp/newspost/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/net-nntp/newspost/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/net-nntp/newspost/newspost-2.1.1-r3.ebuild b/net-nntp/newspost/newspost-2.1.1-r3.ebuild
new file mode 100644
index 000000000000..2bead23b4f88
--- /dev/null
+++ b/net-nntp/newspost/newspost-2.1.1-r3.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A usenet binary autoposter for unix"
+HOMEPAGE="http://newspost.unixcab.org/"
+SRC_URI="http://newspost.unixcab.org/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE=""
+
+src_prepare() {
+ # Should fix some problems with unexpected server replies, cf. bug 185468
+ epatch "${FILESDIR}"/${P}-nntp.patch
+ epatch "${FILESDIR}"/CAN-2005-0101.patch
+ epatch "${FILESDIR}"/${P}-glibc-2.10.patch
+
+ sed -e "/-strip newspost/d" -i Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" LIBS="${LDFLAGS}" main
+}
+
+src_install () {
+ dobin newspost
+ doman man/man1/newspost.1
+ dodoc CHANGES README
+}