[packages/metamail] Rel 5. Build fixes
arekm
arekm at pld-linux.org
Tue Oct 20 22:25:09 CEST 2026
commit c774664cad4155fc80a9eb90702435eff15f6686
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Oct 20 22:14:45 2026 +0200
Rel 5. Build fixes
metamail-fixes.patch | 74 +++++++++++++++++++++++
metamail-mktemp.patch | 82 ++++++++++++++++++++++++++
metamail-modern-build.patch | 141 ++++++++++++++++++++++++++++++++++++++++++++
metamail.spec | 19 ++++--
4 files changed, 312 insertions(+), 4 deletions(-)
---
diff --git a/metamail.spec b/metamail.spec
index e3201dc..f7af460 100644
--- a/metamail.spec
+++ b/metamail.spec
@@ -9,7 +9,7 @@ Summary(pl.UTF-8): Zestaw narzędzi do obsługi standardu MIME
Summary(tr.UTF-8): MIME işleme araçları
Name: metamail
Version: %{ver}.%{debrel}
-Release: 4
+Release: 5
License: GPL v2
Group: Applications/Mail
Source0: mm%{ver}.tar.Z
@@ -17,7 +17,7 @@ Source0: mm%{ver}.tar.Z
Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
# Source1-md5: 0ad0e591d536bc4e0d5ae97514ee6cc4
Source2: htmlview
-Source3: http://ftp.debian.org/debian/pool/main/m/metamail/%{name}_%{ver}-%{debrel}.diff.gz
+Source3: https://archive.debian.org/debian/pool/main/m/metamail/%{name}_%{ver}-%{debrel}.diff.gz
# Source3-md5: 2071dc7b9c33345443ab9a619e640a69
Patch0: %{name}-ncurses.patch
Patch1: %{name}-pager.patch
@@ -29,12 +29,18 @@ Patch6: %{name}-suggestedname.patch
Patch7: %{name}-metasend_mktemp.patch
Patch8: %{name}-procmail_warning.patch
Patch9: %{name}-2.7.53.3-glibc-2.10.patch
+Patch10: %{name}-modern-build.patch
+Patch11: %{name}-fixes.patch
+Patch12: %{name}-mktemp.patch
BuildRequires: autoconf
BuildRequires: automake
+BuildRequires: bzip2
BuildRequires: libtool
BuildRequires: ncurses-devel >= 5.0
-Requires: /usr/lib/sendmail
-Requires: mktemp
+BuildRequires: xorg-app-bdftopcf
+BuildRequires: xorg-app-mkfontscale
+Requires: /usr/sbin/sendmail
+Requires: coreutils
Requires: sharutils
Provides: htmlview
Obsoletes: htmlview
@@ -92,6 +98,9 @@ cd ..
cd src
%patch -P9 -p1
cd ..
+%patch -P10 -p1
+%patch -P11 -p1
+%patch -P12 -p1
%build
cd src
@@ -100,6 +109,8 @@ cd src
%{__autoconf}
%{__autoheader}
%{__automake}
+CFLAGS="%{rpmcppflags} %{rpmcflags} -std=gnu89"
+export CFLAGS
%configure \
--disable-static
%{__make} -j1
diff --git a/metamail-fixes.patch b/metamail-fixes.patch
new file mode 100644
index 0000000..07e33de
--- /dev/null
+++ b/metamail-fixes.patch
@@ -0,0 +1,74 @@
+# Description: fix pointer formats, ISO-2022 charset token and missing includes
+# Origin: PLD, written for this package (metamail 2.7 has no maintained upstream)
+# Reference: src/richmail/COMMANDS documents <x-iso-charset-HH>
+# Last-Update: 2026-10-20
+#
+# tmpfile.c formats pointers with %X and passes a stray argument; the ISO-2022
+# charset designator omits the hexadecimal suffix documented in
+# src/richmail/COMMANDS; shared.c and uue.c use string functions without
+# including <string.h>.
+
+diff -ruN old/mm2.7/src/src/metamail/shared.c new/mm2.7/src/src/metamail/shared.c
+--- mm2.7/src/src/metamail/shared.c 2026-10-20 22:00:47.686174919 +0200
++++ mm2.7/src/src/metamail/shared.c 2026-10-20 22:00:43.286665992 +0200
+@@ -2,6 +2,7 @@
+ #include <ctype.h>
+ #include <config.h>
+ #include <stdlib.h> /* malloc(3) and realloc(3) */
++#include <string.h>
+ #ifdef SYSV
+ #include <unistd.h>
+ #include <sys/utsname.h>
+diff -ruN old/mm2.7/src/src/metamail/tmpfile.c new/mm2.7/src/src/metamail/tmpfile.c
+--- mm2.7/src/src/metamail/tmpfile.c 2026-10-20 22:00:47.686675994 +0200
++++ mm2.7/src/src/metamail/tmpfile.c 2026-10-20 22:00:43.289999325 +0200
+@@ -34,7 +34,7 @@
+ fprintf(stderr, "name = \"%s\"\n", name);
+ AddTmpFileName( name );
+ if (DoDebug)
+- fprintf( stderr, "MkTmpFileName END\n", name);
++ fprintf( stderr, "MkTmpFileName END\n");
+ } else {
+ metamail_warning( "couldn't optain tmpfile: ", xstrerror( errno ) );
+ return;
+@@ -101,8 +101,8 @@
+ fprintf( stderr, "CleanupTmpFiles:\n" );
+
+ while ( TmpNameList.head ) {
+- if (DoDebug) fprintf(stderr, "tmpfile: %s %X\n", TmpNameList.head->data,
+- TmpNameList.head->next);
++ if (DoDebug) fprintf(stderr, "tmpfile: %s %p\n", (char *) TmpNameList.head->data,
++ (void *) TmpNameList.head->next);
+ if (!access( (char*) TmpNameList.head->data, R_OK )) {
+ if (DoDebug) fprintf( stderr, "access file yes\n" );
+ if (unlink( (char*) TmpNameList.head->data ) < 0) {
+@@ -113,7 +113,7 @@
+ }
+
+ help = dlist_remove( &TmpNameList, TmpNameList.head );
+- if (DoDebug) fprintf( stderr, "%X\n", help );
++ if (DoDebug) fprintf( stderr, "%p\n", (void *) help );
+ XFREE( help->data );
+ XFREE( help );
+ }
+diff -ruN old/mm2.7/src/src/metamail/uue.c new/mm2.7/src/src/metamail/uue.c
+--- mm2.7/src/src/metamail/uue.c 2026-10-20 22:00:47.686430100 +0200
++++ mm2.7/src/src/metamail/uue.c 2026-10-20 22:00:43.286665992 +0200
+@@ -1,4 +1,5 @@
+ #include <stdio.h>
++#include <string.h>
+
+ /*
+ * hack to metamail to decode uuencoded bodyparts
+diff -ruN old/mm2.7/src/src/richmail/richlex.c new/mm2.7/src/src/richmail/richlex.c
+--- mm2.7/src/src/richmail/richlex.c 2026-10-20 22:00:47.686865425 +0200
++++ mm2.7/src/src/richmail/richlex.c 2026-10-20 22:00:43.293332659 +0200
+@@ -87,7 +87,7 @@
+ * on the terminal.
+ */
+ #define ISO2022_GENERIC "x-iso-2022-gen-%2x"
+-#define ISO2022_CHARSET "x-iso-charset-"
++#define ISO2022_CHARSET "x-iso-charset-%2x"
+
+ /*
+ * Define the character set shift characters for ISO-2022-KR.
diff --git a/metamail-mktemp.patch b/metamail-mktemp.patch
new file mode 100644
index 0000000..6d7ea32
--- /dev/null
+++ b/metamail-mktemp.patch
@@ -0,0 +1,82 @@
+# Description: use mktemp(1) instead of tempfile(1)
+# Origin: PLD, written for this package (tempfile(1) comes from debianutils
+# and is deprecated; metamail 2.7 has no maintained upstream)
+# Last-Update: 2026-10-20
+#
+# tempfile(1) is deprecated and only available from debianutils; the other
+# scripts already use mktemp(1) from coreutils.
+
+diff -ruN old/mm2.7/src/bin/audiosend new/mm2.7/src/bin/audiosend
+--- mm2.7/src/bin/audiosend 2026-10-20 22:15:38.769999326 +0200
++++ mm2.7/src/bin/audiosend 2026-10-20 22:15:38.911004240 +0200
+@@ -66,8 +66,8 @@
+ echo -n "Press RETURN when you are ready to start recording: "
+ read foo
+
+- fname=`tempfile -p metamail -m 600`
+- fnameraw=`tempfile -p metamail -m 600`
++ fname=`mktemp -t metamail.XXXXXX`
++ fnameraw=`mktemp -t metamail.XXXXXX`
+
+ echo "To: $to" > $fname
+ echo "Subject: $subject" >> $fname
+diff -ruN old/mm2.7/src/bin/mailserver new/mm2.7/src/bin/mailserver
+--- mm2.7/src/bin/mailserver 2026-10-20 22:15:38.866665992 +0200
++++ mm2.7/src/bin/mailserver 2026-10-20 22:15:38.911382613 +0200
+@@ -26,7 +26,7 @@
+ rehash
+ set FromName=""
+ set Subject=""
+-set TmpFile=`tempfile -p metamail -m 600`
++set TmpFile=`mktemp -t metamail.XXXXXX`
+ set FOORAW=$<
+ while ("$FOORAW" != "")
+ set FOO=(` echo "$FOORAW" | tr "[" "x"`)
+diff -ruN old/mm2.7/src/bin/sun2mime new/mm2.7/src/bin/sun2mime
+--- mm2.7/src/bin/sun2mime 2026-10-20 22:15:38.886665992 +0200
++++ mm2.7/src/bin/sun2mime 2026-10-20 22:15:38.911832721 +0200
+@@ -6,7 +6,7 @@
+ # This program is for use with sun-message which takes an arg to figure out how
+ # (or if) the message is encoded.
+ #
+-TMPFILE=`tempfile -p metamail -m 600`
++TMPFILE=`mktemp -t metamail.XXXXXX`
+
+ /bin/awk '
+ BEGIN { printf("Content-type: multipart/mixed; boundary=--------\n\n")
+diff -ruN old/mm2.7/src/bin/sun-audio-file new/mm2.7/src/bin/sun-audio-file
+--- mm2.7/src/bin/sun-audio-file 2026-10-20 22:15:38.896665992 +0200
++++ mm2.7/src/bin/sun-audio-file 2026-10-20 22:15:38.912477369 +0200
+@@ -14,7 +14,7 @@
+ # Brought into line with metamail 2.7 beta release Csh version
+ # Dave Shield February 1994
+
+-audio-file=`tempfile -p metamail -m 600`
++audio-file=`mktemp -t metamail.XXXXXX`
+ uudecode -o $audio-file "$1"
+ audiotool $audio-file
+ rm $audio-file "$1"
+diff -ruN old/mm2.7/src/bin/sun-message new/mm2.7/src/bin/sun-message
+--- mm2.7/src/bin/sun-message 2026-10-20 22:15:38.899999325 +0200
++++ mm2.7/src/bin/sun-message 2026-10-20 22:15:38.912788653 +0200
+@@ -12,7 +12,7 @@
+
+ if [ "$2" = "uuencode" ]
+ then
+- fn=`tempfile -p metamail -m 600`
++ fn=`mktemp -t metamail.XXXXXX`
+ uudecode -o $fn "$1"
+
+ echo "The following file was uudecoded:"
+diff -ruN old/mm2.7/src/bin/sun-to-mime new/mm2.7/src/bin/sun-to-mime
+--- mm2.7/src/bin/sun-to-mime 2026-10-20 22:15:38.839999325 +0200
++++ mm2.7/src/bin/sun-to-mime 2026-10-20 22:15:38.913122942 +0200
+@@ -14,7 +14,7 @@
+ # Brought into line with metamail 2.7 beta release Csh version
+ # Dave Shield February 1994
+
+-TMPFILE=`tempfile -p metamail -m 600`
++TMPFILE=`mktemp -t metamail.XXXXXX`
+ echo "Content-type: multipart/mixed; boundary=--------" > $TMPFILE
+ echo "" >> $TMPFILE
+ sed -e 's/X-Sun-Data-Type:/Content-type:/' >> $TMPFILE < $1
diff --git a/metamail-modern-build.patch b/metamail-modern-build.patch
new file mode 100644
index 0000000..4b5939c
--- /dev/null
+++ b/metamail-modern-build.patch
@@ -0,0 +1,141 @@
+# Description: build with current glibc and GCC
+# Origin: PLD, written for this package (metamail 2.7 has no maintained upstream)
+# Last-Update: 2026-10-20
+#
+# metamail is K&R C from 1994: it includes the long-removed <termio.h>,
+# uses struct termio/TCGETA/TCSETA[W] and redeclares libc functions with
+# unprototyped declarations that conflict with current glibc prototypes.
+
+diff -ruN old/mm2.7/src/configure.in new/mm2.7/src/configure.in
+--- mm2.7/src/configure.in 2026-10-20 21:52:26.912772310 +0200
++++ mm2.7/src/configure.in 2026-10-20 21:52:26.824676327 +0200
+@@ -115,7 +115,8 @@
+ #include <sys/file.h>
+ #include <signal.h>
+
+-#include <termio.h>
++#include <termios.h>
++#include <sys/ioctl.h>
+ #include <fcntl.h>
+ #include <sys/utsname.h>
+ _EOF_
+@@ -282,7 +283,7 @@
+ case "${host}" in
+ *-*-linux-gnu*) cat >> $tmpfile << '_EOF_'
+ #define TMPNAME_MAX NAME_MAX
+-static struct termio MyTtyStateIn, MyTtyStateOut;
++static struct termios MyTtyStateIn, MyTtyStateOut;
+
+ _EOF_
+ ;;
+diff -ruN old/mm2.7/src/metamail/common.h new/mm2.7/src/metamail/common.h
+--- mm2.7/src/metamail/common.h 2026-10-20 21:52:26.913226845 +0200
++++ mm2.7/src/metamail/common.h 2026-10-20 21:52:26.830141264 +0200
+@@ -21,7 +21,8 @@
+ #include <sys/file.h>
+ #include <signal.h>
+
+-#include <termio.h>
++#include <termios.h>
++#include <sys/ioctl.h>
+ #include <fcntl.h>
+ #include <sys/utsname.h>
+
+@@ -173,17 +174,10 @@
+ #define TMPFILE_NAME_SIZE 1000
+ #define MAX_FILE_NAME_SIZE 1000
+
+-BEGIN_C_DECLS
+-
+-extern char **environ, *gets();
+-
+-extern char *getenv();
+-extern char *index();
+-extern char *rindex();
+-
+-extern FILE *popen();
+-
+-END_C_DECLS
++/* getenv, index, rindex and popen are declared by the system headers;
++ redeclaring them without prototypes conflicts with the prototypes in
++ glibc. gets was removed from C11. */
++extern char **environ;
+
+ //#ifndef NO_RLIMITS
+ //#include <sys/resource.h>
+@@ -196,7 +190,7 @@
+ #define CATCOMMAND "cat"
+ #define CATTEMPLATE "cat %s"
+ #define TMPNAME_MAX NAME_MAX
+-static struct termio MyTtyStateIn, MyTtyStateOut;
++static struct termios MyTtyStateIn, MyTtyStateOut;
+
+
+
+diff -ruN old/mm2.7/src/metamail/common-h.in new/mm2.7/src/metamail/common-h.in
+--- mm2.7/src/metamail/common-h.in 2026-10-20 21:52:26.913032804 +0200
++++ mm2.7/src/metamail/common-h.in 2026-10-20 21:52:26.830141264 +0200
+@@ -142,17 +142,10 @@
+ #define TMPFILE_NAME_SIZE 1000
+ #define MAX_FILE_NAME_SIZE 1000
+
+-BEGIN_C_DECLS
+-
+-extern char **environ, *gets();
+-
+-extern char *getenv();
+-extern char *index();
+-extern char *rindex();
+-
+-extern FILE *popen();
+-
+-END_C_DECLS
++/* getenv, index, rindex and popen are declared by the system headers;
++ redeclaring them without prototypes conflicts with the prototypes in
++ glibc. gets was removed from C11. */
++extern char **environ;
+
+ //#ifndef NO_RLIMITS
+ //#include <sys/resource.h>
+diff -ruN old/mm2.7/src/src/metamail/metamail.c new/mm2.7/src/src/metamail/metamail.c
+--- mm2.7/src/src/metamail/metamail.c 2026-10-20 21:52:26.913849362 +0200
++++ mm2.7/src/src/metamail/metamail.c 2026-10-20 21:52:26.830141264 +0200
+@@ -1992,16 +1992,16 @@
+
+ SaveTtyState() {
+ /* Bogus -- would like a good portable way to reset the terminal state here */
+- ioctl(fileno(stdin), TCGETA, &MyTtyStateIn);
+- ioctl(fileno(stdout), TCGETA, &MyTtyStateOut);
++ ioctl(fileno(stdin), TCGETS, &MyTtyStateIn);
++ ioctl(fileno(stdout), TCGETS, &MyTtyStateOut);
+
+ HasSavedTtyState = 1;
+ }
+
+ RestoreTtyState() {
+ if (HasSavedTtyState) {
+- ioctl(fileno(stdout), TCSETA, &MyTtyStateOut);
+- ioctl(fileno(stdin), TCSETA, &MyTtyStateIn);
++ ioctl(fileno(stdout), TCSETS, &MyTtyStateOut);
++ ioctl(fileno(stdin), TCSETS, &MyTtyStateIn);
+ }
+ }
+
+@@ -2209,14 +2209,14 @@
+ }
+
+ StartRawStdin() {
+- struct termio orterm, fterm;
+- ioctl(0, TCGETA, &orterm); /* get current (i.e. cooked) termio */
++ struct termios orterm, fterm;
++ ioctl(0, TCGETS, &orterm); /* get current (i.e. cooked) termio */
+ fterm = orterm; /* get termio to modify */
+
+ fterm.c_lflag &= ~ICANON; /* clear ICANON giving raw mode */
+ fterm.c_cc[VMIN] = 1; /* set MIN char count to 1 */
+ fterm.c_cc[VTIME] = 0; /* set NO time limit */
+- return ioctl(0, TCSETAW, &fterm); /* modify termio for raw mode */
++ return ioctl(0, TCSETSW, &fterm); /* modify termio for raw mode */
+ }
+
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/metamail.git/commitdiff/c774664cad4155fc80a9eb90702435eff15f6686
More information about the pld-cvs-commit
mailing list