From c0a9d3902731c8789ca106bb94289f6cceef7af4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sun, 24 Oct 2021 19:29:31 +0200 Subject: [PATCH] - fix building with gcc 10+, rebuild with openssl 3.0.0, rel 3 --- epic4-maildir.patch | 168 -------------------------------------------- epic4.spec | 10 +-- gcc10.patch | 10 +++ 3 files changed, 13 insertions(+), 175 deletions(-) delete mode 100644 epic4-maildir.patch create mode 100644 gcc10.patch diff --git a/epic4-maildir.patch b/epic4-maildir.patch deleted file mode 100644 index 1c6f23d..0000000 --- a/epic4-maildir.patch +++ /dev/null @@ -1,168 +0,0 @@ -diff -urN epic4-1.0.1.orig/source/mail.c epic4-1.0.1/source/mail.c ---- epic4-1.0.1.orig/source/mail.c Tue Dec 5 01:11:57 2000 -+++ epic4-1.0.1/source/mail.c Sun Apr 14 12:28:16 2002 -@@ -5,7 +5,10 @@ - * Written by Jeremy Nelson - * Copyright 1996 EPIC Software Labs - */ -- -+/* -+ * Maildirs are also supported. -+ * Written by Olgierd Pieczul -+ */ - #include "irc.h" - #include "mail.h" - #include "lastlog.h" -@@ -18,7 +21,8 @@ - #endif - #include - #include -- -+#include -+#include - static char *mail_path = (char *) 0; - - /* -@@ -31,7 +35,6 @@ - static time_t old_stat = 0; - struct stat sb; - struct stat * stat_buf; -- - if (ptr) - stat_buf = (struct stat *)ptr; - else -@@ -51,9 +54,14 @@ - if (!(tmp_mail_path = getenv("MAIL"))) - tmp_mail_path = path_search(username, mail_path_list); - -- if (tmp_mail_path) -+ if (tmp_mail_path) { - mail_path = m_strdup(tmp_mail_path); -- -+ if (stat(mail_path, stat_buf) == -1) -+ return 0; -+ /* Check whether mailbox is a directory (Maildir) and add "new/" suffix */ -+ if ((stat_buf->st_mode & S_IFMT) == S_IFDIR) -+ mail_path = m_2dup(mail_path, "/new/"); -+ } - else - mail_path = m_strdup(""); - } -@@ -70,22 +78,35 @@ - { - old_stat = stat_buf->st_ctime; - if (stat_buf->st_size) -- return 2; -+ return 2; - } - - /* - * If there is something in the mailbox - */ -- if (stat_buf->st_size) -- return 1; -- -+ if (stat_buf->st_size) { -+ /* if maildir - how many files */ -+ if ((stat_buf->st_mode & S_IFMT) == S_IFDIR) { -+ DIR *dir; -+ int i = -2; -+ if ((dir = opendir(mail_path)) == NULL) -+ return 0; -+ while (readdir(dir) != NULL) -+ i++; -+ closedir(dir); -+ if (i > 0) -+ return 1; -+ else -+ return 0; -+ } -+ return 1; -+ } - /* - * The mailbox is empty. - */ - return 0; - } - -- - /* - * check_mail: report on status of inbox. - * -@@ -142,8 +163,10 @@ - case 3: - { - FILE * mail; -+ DIR * dir; - char buffer[255]; - int count = 0; -+ - static int old_count = 0; - static char ret_str[12]; - struct utimbuf ts; -@@ -152,34 +175,43 @@ - { - case 2: - { -- if (!(mail = fopen(mail_path, "r"))) -- return NULL; -- -- while (fgets(buffer, 254, mail)) -- if (!strncmp("From ", buffer, 5)) -- count++; -- -- fclose(mail); -- -- if (state == 3) -+ /* if maildir */ -+ if ((stat_buf.st_mode & S_IFMT) == S_IFDIR) { -+ if ((dir = opendir(mail_path)) == NULL) -+ return NULL; -+ while (readdir(dir) != NULL) -+ count++; -+ closedir(dir); -+ count -= 2; -+ } -+ else -+ { -+ if (!(mail = fopen(mail_path, "r"))) -+ return NULL; -+ -+ while (fgets(buffer, 254, mail)) -+ if (!strncmp("From ", buffer, 5)) -+ count++; -+ fclose(mail); -+ } -+ if (state == 3) - { -- /* XXX Ew. Evil. Gross. */ -- ts.actime = stat_buf.st_atime; -- ts.modtime = stat_buf.st_mtime; -- utime(mail_path, &ts); /* XXX Ick. Gross */ -+ /* XXX Ew. Evil. Gross. */ -+ ts.actime = stat_buf.st_atime; -+ ts.modtime = stat_buf.st_mtime; -+ utime(mail_path, &ts); /* XXX Ick. Gross */ - } -- -- if (count > old_count) -- { -- if (do_hook(MAIL_LIST, "%d %d", -- count - old_count, count)) -- { -- int lastlog_level = -+ if (count > old_count) -+ { -+ if (do_hook(MAIL_LIST, "%d %d", -+ count - old_count, count)) -+ { -+ int lastlog_level = - set_lastlog_msg_level(LOG_CRAP); - say("You have new email."); - set_lastlog_msg_level(lastlog_level); - } -- } -+ } - - old_count = count; - sprintf(ret_str, "%d", old_count); diff --git a/epic4.spec b/epic4.spec index 3e4b87a..ba091d2 100644 --- a/epic4.spec +++ b/epic4.spec @@ -2,7 +2,7 @@ Summary: Another popular Unix IRC client Summary(pl.UTF-8): Jeszcze jeden popularny uniksowy klient IRC Name: epic4 Version: 2.10.6 -Release: 2 +Release: 3 License: distributable Group: Applications/Communications Source0: ftp://ftp.epicsol.org/pub/ircii/EPIC4-PRODUCTION/%{name}-%{version}.tar.xz @@ -13,9 +13,7 @@ Source2: epic.desktop Patch0: %{name}-DESTDIR.patch Patch1: %{name}-gethostname_is_in_libc_aka_no_libnsl.patch Patch2: %{name}-config_file_path.patch -#Patch3: http://www.t17.ds.pwr.wroc.pl/~misiek/ipv6/%{name}-%{version}-ipv6-20010418.patch.gz -#Patch4: %{name}-ac.patch -Patch5: http://linux.slupsk.net/patches/%{name}-maildir.patch +Patch3: gcc10.patch URL: http://www.epicsol.org/ BuildRequires: autoconf BuildRequires: automake @@ -40,9 +38,7 @@ program wykorzystywany do łączenia się z serwerami IRC na całym %patch0 -p1 %patch1 -p1 %patch2 -p1 -#%patch3 -p1 -#%patch4 -p1 -#%patch5 -p1 +%patch3 -p1 %build %{__aclocal} diff --git a/gcc10.patch b/gcc10.patch new file mode 100644 index 0000000..ae526f1 --- /dev/null +++ b/gcc10.patch @@ -0,0 +1,10 @@ +--- epic4-2.10.6/include/irc.h~ 2016-01-30 17:32:30.000000000 +0100 ++++ epic4-2.10.6/include/irc.h 2021-10-24 19:26:11.232881095 +0200 +@@ -166,6 +166,6 @@ + char * current_package (void); /* XXX command.c */ + + /* keep track of signals for scripted events */ +-volatile int signals_caught[NSIG]; ++extern volatile int signals_caught[NSIG]; + + #endif /* __irc_h */ -- 2.44.0