From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- x11-plugins/wmpop3lb/Manifest | 7 + ...2-fix-RECV-and-try-STAT-if-LAST-wont-work.patch | 190 +++++++++++++++++++++ .../wmpop3lb/files/wmpop3lb-2.4.2-list.patch | 127 ++++++++++++++ x11-plugins/wmpop3lb/metadata.xml | 9 + x11-plugins/wmpop3lb/wmpop3lb-2.4.2-r2.ebuild | 49 ++++++ 5 files changed, 382 insertions(+) create mode 100644 x11-plugins/wmpop3lb/Manifest create mode 100644 x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-fix-RECV-and-try-STAT-if-LAST-wont-work.patch create mode 100644 x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-list.patch create mode 100644 x11-plugins/wmpop3lb/metadata.xml create mode 100644 x11-plugins/wmpop3lb/wmpop3lb-2.4.2-r2.ebuild (limited to 'x11-plugins/wmpop3lb') diff --git a/x11-plugins/wmpop3lb/Manifest b/x11-plugins/wmpop3lb/Manifest new file mode 100644 index 000000000000..2f3e997f3ede --- /dev/null +++ b/x11-plugins/wmpop3lb/Manifest @@ -0,0 +1,7 @@ +AUX wmpop3lb-2.4.2-fix-RECV-and-try-STAT-if-LAST-wont-work.patch 5673 SHA256 ae7a6fcd16b4bf5584104de6241d54dedec43f8a81aa20737d40a1a2217c2e3b SHA512 a3c8d27d30a844737a8e66d20806e82c56c91d757f6d0eddcc75debc8ebd8db2c7d8f89ad528f52200bdac06088b68b69bc486e45c9488b83aca09cab2d06e33 WHIRLPOOL 62ec997ad1bf9355b267e0dc2e72de465fbdfe3131742a6ed341c4ee3d1a0e283ef1d29470858952e18fd099b2a06da71f108d27efb2679cb3fe2bb74031b0a2 +AUX wmpop3lb-2.4.2-list.patch 2945 SHA256 41c70f5c9453bc60907cd3c4fcda96e14a3923d69a835189009d8dba66e5fa3c SHA512 4b03e507984b1e2bb01d62970ba39a7469b997978c376505deccec65e936bcbb9be12140b702cd7c69b0cca79ef7f5e2680978cae0c80202a5c4028f32b7313a WHIRLPOOL c96be19fc1946ff27e12bdddade90e53cb18349c45749ba6ba15120f0e211b58d5542bdbfc0dce2a3b38f39e4dff7cb4fe4e864d00996005cd08390599e0621d +DIST wmpop3lb2.4.2.tar.gz 37391 SHA256 209b5ca409f226032b1200779e09f3d45a3522bc08eeb9f1b63e14bd04e780f3 SHA512 6d9d12261c457542ba45bbbb2f07ea9895a456d87c60187e2df0f0cc6e6da57fb498ea642346d113749b9529f1bebc623ec9dad48ee84e5016925b2440211e0f WHIRLPOOL e454e021c85ed00aaadedaeb205d2c7c65a28187a3d74b1939f021aa55a519162290fc4814058dfdcce2f04f1482d95e69b00aca5f8d621e65a18e86ad665033 +EBUILD wmpop3lb-2.4.2-r2.ebuild 1051 SHA256 4a89a759dc123e50f74ea6bf5467e3dc5ea53875f6610c5dec0245c8446fec30 SHA512 94093c3e60b1f4ecd58b7fac1169241e24f7d9196403c9185e5117a54ea91b58273d5cba3e6fcb68c4e77fbdc4c7078a307f4146738799d3e2831ea6ebe691e2 WHIRLPOOL 797b1f8dd6f8c2544bb8f0aa9e986bef40d111a774889ec65d2bb2dfbf3e1b8e73ed2efe3dafa581106ee9490312b741a4e307d4c5f85454c099009ac474456a +MISC ChangeLog 3163 SHA256 78e9a7460f9a84288fdec40b95775928e89cde6538e274535474ef32a7c297fd SHA512 55f66a00da147bd14895eae4f03b16cfb5e0e11c09a1913f19ddc9571a5bcedd0ebd8753a53b3da76309bb54b316ff51e778d2fc2a2380a342b07ebde19c252f WHIRLPOOL b75df41321329a232b8ebc0101dfdd7f94c20de8eb28af1a768ec8f35b5727ee532f539b0d736f4b0f15f44c4d3b368f344e4b601d3b17082e0d238500773f58 +MISC ChangeLog-2015 1808 SHA256 98489b49fcf5eebcdd935f035d5652a45984a8e98ae699a4d269fba5635407e6 SHA512 d84b97aa719c6f667fee4d7332a2c4e1871a061a1e1484833782648c8c1979ddd555b6fda6ac69a99d0126489ed4ae87200fbc987ea84aed75773d71242bf536 WHIRLPOOL 10ccbe8eafd0bfe6da95b6540ca3b2f57518b301551f5b71faaeb6d0ce378dfc24bb4f13dc5b04f107fcc6a7eae9201a60d6633822bf2511de111c10af27c580 +MISC metadata.xml 249 SHA256 ab0de85cc2ebef9f9bca3773395bc5c909312efb834a8b3948806c1b00dee4e5 SHA512 1a1312bb0e9f74f1e3852218d8fd4817fbad3bc65633cecbe8735607bc33c1e05b414c2628ff3f6e24dfc4a3999de7191f6cdadd2161b03cf614d5b6f24fab8d WHIRLPOOL 3d7026fc5a045f5c90505dab413fe4534364d8c9a47c053ffbfaf3579478e55f77427eb00b05bd4c593a372c69eefae5ca93a2bab9398f52d20d374c2265fb2d diff --git a/x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-fix-RECV-and-try-STAT-if-LAST-wont-work.patch b/x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-fix-RECV-and-try-STAT-if-LAST-wont-work.patch new file mode 100644 index 000000000000..16cbe4ed6bce --- /dev/null +++ b/x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-fix-RECV-and-try-STAT-if-LAST-wont-work.patch @@ -0,0 +1,190 @@ +--- wmpop3lb2.4.2/wmpop3/Pop3Client.c 2002-06-27 16:04:42.000000000 +0200 ++++ wmpop3lb2.4.2-pathed/wmpop3/Pop3Client.c 2007-01-11 14:39:12.000000000 +0200 +@@ -27,6 +27,49 @@ + + #include "Pop3Client.h" + ++/* receive full responce */ ++int do_recv(int s, void *ibuf, size_t len, int flags) ++{ ++ size_t ret, total; ++ char *p, *buf = ibuf; ++ ++ total = 0; ++ while (1) ++ { ++ /* left one byte for null termination */ ++ ret = recv(s, buf + total, len - 1 - total, flags); ++ /* if we got error or close, then brea */ ++ if (ret <= 0) ++ { ++ break; ++ } ++ /* increase size of received data */ ++ total += ret; ++ /* null terminating received data */ ++ buf[total] = 0; ++ /* left one byte for null termination ++ * if out of buffer, return */ ++ if (len - total <= 1) ++ { ++ break; ++ } ++ /* if we found end of line signal, then stop */ ++ p = strstr(buf, "\r\n"); ++ printf("p == %p\n", p); ++ if (p != 0) ++ { ++ break; ++ } ++ } ++ ++ /* if there wasn't any data, then return error code */ ++ if (total == 0) ++ { ++ return ret; ++ } ++ return total; ++} ++ + /* return size if all goes well, -1 if not expected answer */ + int send_command(char *exp_answer, char **retour, Pop3 pc) + { +@@ -61,18 +104,29 @@ + return (pc); + } + int pop3MakeConnection(Pop3 pc, char *serverName, int port){ ++ struct timeval t; + + pc->s = socket(AF_INET, SOCK_STREAM, 0 ); + memset( &(pc->server), 0 , sizeof(pc->server)); + pc->server.sin_family = AF_INET; + pc->hp = gethostbyname(serverName); + if( pc->hp == 0) ++ { ++ close(pc->s); + return -1; ++ } + memcpy( &(pc->server.sin_addr), pc->hp->h_addr, pc->hp->h_length); + pc->server.sin_port = htons(port); + if ( connect(pc->s, (struct sockaddr *)&(pc->server) + , sizeof(pc->server)) < 0 ) ++ { ++ close(pc->s); + return -1; ++ } ++ t.tv_sec = 60; ++ t.tv_usec = 0; ++ setsockopt(pc->s, SOL_SOCKET, SO_RCVTIMEO, &t, sizeof(t)); ++ setsockopt(pc->s, SOL_SOCKET, SO_SNDTIMEO, &t, sizeof(t)); + pc->connected = CONNECTED; + return 0; + } +@@ -94,7 +148,7 @@ + return -1; + } + +- size = recv(pc->s,&pc->inBuf,1024,0); ++ size = do_recv(pc->s,&pc->inBuf,1024,0); + memset(temp,0,1024); + memcpy(temp,pc->inBuf,size); + if( temp[0] != '+' ){ +@@ -104,10 +158,10 @@ + + sprintf(pc->outBuf,"USER %s\r\n",name); + send(pc->s, &pc->outBuf,strlen(pc->outBuf),0); +- size =recv(pc->s,pc->inBuf,1024,0); ++ size = do_recv(pc->s,pc->inBuf,1024,0); + memset(temp,0,1024); + memcpy(temp,pc->inBuf,size); +- if( temp[0] != '+' ){ ++ if( temp[0] != '+' && temp[0] != '\r' ){ + fprintf(stderr,"Invalid User Name\n"); + return -1; + } +@@ -115,10 +169,10 @@ + memset(pc->outBuf,0,1024); + sprintf(pc->outBuf,"PASS %s\r\n",pass); + send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); +- size =recv(pc->s,&pc->inBuf,1024,0); ++ size = do_recv(pc->s,&pc->inBuf,1024,0); + memset(temp,0,1024); + memcpy(temp,pc->inBuf,size); +- if( temp[0] != '+' ){ ++ if( temp[0] != '+' && temp[0] != '\r'){ + fprintf(stderr,"Incorrect Password\n"); + return -1; + } +@@ -213,7 +267,7 @@ + /* Find total number of messages in mail box */ + sprintf(pc->outBuf,"STAT\r\n"); + send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); +- size = recv(pc->s,pc->inBuf,1024,0); ++ size = do_recv(pc->s,pc->inBuf,1024,0); + if( pc->inBuf[0] != '+' ){ + perror("Error Receiving Stats"); + return (-1); +@@ -266,7 +320,7 @@ + /* Find total number of messages in mail box */ + sprintf(pc->outBuf,"STAT\r\n"); + send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); +- size = recv(pc->s,pc->inBuf,1024,0); ++ size = do_recv(pc->s,pc->inBuf,1024,0); + pc->inBuf[size] = '\0'; + #ifdef _DEBUG + printf(" pop3CheckMail, stat received buf (size=%d): [%s]\n", +@@ -313,7 +367,7 @@ + + sprintf(pc->outBuf,"LAST\r\n"); + send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); +- size = recv(pc->s,pc->inBuf,1024,0); ++ size = do_recv(pc->s,pc->inBuf,1024,0); + pc->inBuf[size] = '\0'; + #ifdef _DEBUG + printf(" pop3CheckMail, last received buf (size=%d): [%s]\n", +@@ -325,9 +379,25 @@ + #ifdef _DEBUG + printf(" Error Receiving LAST: [%s]\n", temp); + #endif +- pc->numOfUnreadMessages = pc->numOfMessages; ++ /* TRY STAT instead LAST */ ++ sprintf(pc->outBuf,"STAT\r\n"); ++ send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); ++ size = do_recv(pc->s,pc->inBuf,1024,0); ++ pc->inBuf[size] = '\0'; ++#ifdef _DEBUG ++ printf(" pop3CheckMail, last received buf (size=%d): [%s]\n", ++ size, pc->inBuf); ++#endif ++ memset(temp,0,1024); ++ memcpy(temp,pc->inBuf,size); ++ if( temp[0] != '+' ){ ++#ifdef _DEBUG ++ printf(" Error Receiving STAT: [%s]\n", temp); ++#endif ++ pc->numOfUnreadMessages = pc->numOfMessages; ++ } + } +- else { ++ if( temp[0] != '+' ){ + ptr = strtok(temp, " "); + ptr = strtok( 0," "); + pc->numOfUnreadMessages = pc->numOfMessages - atoi(ptr); +@@ -545,7 +615,7 @@ + printf(" %s\n", pc->outBuf); + #endif + send(pc->s, pc->outBuf, strlen(pc->outBuf), 0); +- size = recv(pc->s, pc->inBuf, 4096, 0); ++ size = do_recv(pc->s, pc->inBuf, 4096, 0); + if ('+' != pc->inBuf[0]) { + perror("error while deleting mail"); + return (1); +@@ -579,7 +649,7 @@ + if( pc->connected == NOT_CONNECTED ) + return -1; + send(pc->s, "quit\r\n", 6,0 ); +- size =recv(pc->s,&pc->inBuf,1024,0); ++ size = do_recv(pc->s,&pc->inBuf,1024,0); + pc->connected = NOT_CONNECTED; + if(pc->s != 0) + close(pc->s); diff --git a/x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-list.patch b/x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-list.patch new file mode 100644 index 000000000000..604498f3b311 --- /dev/null +++ b/x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-list.patch @@ -0,0 +1,127 @@ +diff -Naur wmgeneral.orig/list.c wmgeneral/list.c +--- wmgeneral.orig/list.c 2016-01-04 13:22:26.492218531 +0100 ++++ wmgeneral/list.c 2016-01-04 13:22:59.018229270 +0100 +@@ -38,7 +38,7 @@ + + /* Return a cons cell produced from (head . tail) */ + +-INLINE LinkedList* ++LinkedList* + list_cons(void* head, LinkedList* tail) + { + LinkedList* cell; +@@ -51,7 +51,7 @@ + + /* Return the length of a list, list_length(NULL) returns zero */ + +-INLINE int ++int + list_length(LinkedList* list) + { + int i = 0; +@@ -66,7 +66,7 @@ + /* Return the Nth element of LIST, where N count from zero. If N + larger than the list length, NULL is returned */ + +-INLINE void* ++void* + list_nth(int index, LinkedList* list) + { + while(index-- != 0) +@@ -81,7 +81,7 @@ + + /* Remove the element at the head by replacing it by its successor */ + +-INLINE void ++void + list_remove_head(LinkedList** list) + { + if (!*list) return; +@@ -101,7 +101,7 @@ + + /* Remove the element with `car' set to ELEMENT */ + /* +-INLINE void ++void + list_remove_elem(LinkedList** list, void* elem) + { + while (*list) +@@ -112,7 +112,7 @@ + } + }*/ + +-INLINE LinkedList * ++LinkedList * + list_remove_elem(LinkedList* list, void* elem) + { + LinkedList *tmp; +@@ -132,7 +132,7 @@ + + /* Return element that has ELEM as car */ + +-INLINE LinkedList* ++LinkedList* + list_find(LinkedList* list, void* elem) + { + while(list) +@@ -146,7 +146,7 @@ + + /* Free list (backwards recursive) */ + +-INLINE void ++void + list_free(LinkedList* list) + { + if(list) +@@ -158,7 +158,7 @@ + + /* Map FUNCTION over all elements in LIST */ + +-INLINE void ++void + list_mapcar(LinkedList* list, void(*function)(void*)) + { + while(list) +diff -Naur wmgeneral.orig/list.h wmgeneral/list.h +--- wmgeneral.orig/list.h 2016-01-04 13:22:26.492218531 +0100 ++++ wmgeneral/list.h 2016-01-04 13:22:30.028219699 +0100 +@@ -29,31 +29,25 @@ + #ifndef __LIST_H_ + #define __LIST_H_ + +-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +-# define INLINE inline +-#else +-# define INLINE +-#endif +- + typedef struct LinkedList { + void *head; + struct LinkedList *tail; + } LinkedList; + +-INLINE LinkedList* list_cons(void* head, LinkedList* tail); ++LinkedList* list_cons(void* head, LinkedList* tail); + +-INLINE int list_length(LinkedList* list); ++int list_length(LinkedList* list); + +-INLINE void* list_nth(int index, LinkedList* list); ++void* list_nth(int index, LinkedList* list); + +-INLINE void list_remove_head(LinkedList** list); ++void list_remove_head(LinkedList** list); + +-INLINE LinkedList *list_remove_elem(LinkedList* list, void* elem); ++LinkedList *list_remove_elem(LinkedList* list, void* elem); + +-INLINE void list_mapcar(LinkedList* list, void(*function)(void*)); ++void list_mapcar(LinkedList* list, void(*function)(void*)); + +-INLINE LinkedList*list_find(LinkedList* list, void* elem); ++LinkedList*list_find(LinkedList* list, void* elem); + +-INLINE void list_free(LinkedList* list); ++void list_free(LinkedList* list); + + #endif diff --git a/x11-plugins/wmpop3lb/metadata.xml b/x11-plugins/wmpop3lb/metadata.xml new file mode 100644 index 000000000000..1d5e6504004e --- /dev/null +++ b/x11-plugins/wmpop3lb/metadata.xml @@ -0,0 +1,9 @@ + + + + + voyageur@gentoo.org + Bernard Cafarelli + + + diff --git a/x11-plugins/wmpop3lb/wmpop3lb-2.4.2-r2.ebuild b/x11-plugins/wmpop3lb/wmpop3lb-2.4.2-r2.ebuild new file mode 100644 index 000000000000..7a9b0fb776b4 --- /dev/null +++ b/x11-plugins/wmpop3lb/wmpop3lb-2.4.2-r2.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=2 +inherit eutils + +IUSE="" + +MY_P=${PN}${PV} +S=${WORKDIR}/${MY_P} +DESCRIPTION="dockapp for checking up to 7 pop3 accounts" +HOMEPAGE="http://wmpop3lb.jourdain.org" +SRC_URI="http://lbj.free.fr/wmpop3/${MY_P}.tar.gz" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="amd64 ~sparc x86" + +RDEPEND="x11-libs/libX11 + x11-libs/libXext + x11-libs/libXpm" +DEPEND="${RDEPEND} + x11-proto/xextproto + >=sys-apps/sed-4" + +src_prepare() { + #Honour Gentoo CFLAGS + sed -i -e "s:-g2 -D_DEBUG:${CFLAGS}:" "wmpop3/Makefile" + + #Fix bug #161530 + epatch "${FILESDIR}"/${P}-fix-RECV-and-try-STAT-if-LAST-wont-work.patch + + #De-hardcode compiler + sed -i -e "s:cc:\$(CC):g" "wmpop3/Makefile" + + #Honour Gentoo LDFLAGS - bug #335986 + sed -i -e "s:\$(FLAGS) -o wmpop3lb:\$(LDFLAGS) -o wmpop3lb:" "wmpop3/Makefile" + + epatch "${FILESDIR}"/${P}-list.patch +} + +src_compile() { + emake -C wmpop3 || die "parallel make failed" +} + +src_install() { + dobin wmpop3/wmpop3lb + dodoc CHANGE_LOG README +} -- cgit v1.2.3