commit 383765d30152e6adc8844152aca74b4dd8048150 Author: EnumDev Date: Fri Oct 31 18:26:19 2025 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..cd89e29 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Ignore this package +echo "ignore" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..a426492 --- /dev/null +++ b/pkg.info @@ -0,0 +1,18 @@ +name: mailx +description: Mail user agent for Unix systems +version: "12.5" +revision: 1 +url: http://heirloom.sourceforge.net/mailx.html +license: BSD-4-Clause +architecture: any +type: source +make_depends: + - openssl + - krb5 +keep: + - etc/mailx.rc +downloads: + - url: https://pkgs.fedoraproject.org/repo/pkgs/mailx/mailx-${BPM_PKG_VERSION}.tar.xz/836bf1da322d2d1f78b7056c2b3b2304/mailx-${BPM_PKG_VERSION}.tar.xz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 1b8136fb2466adeaf71a5e3c65db9fa1a967f1f6469ff689c2cf06e21f638823 diff --git a/source-files/libressl.patch b/source-files/libressl.patch new file mode 100644 index 0000000..15767d2 --- /dev/null +++ b/source-files/libressl.patch @@ -0,0 +1,39 @@ +--- a/openssl.c.orig 2014-07-22 20:59:16.024655378 +0200 ++++ b/openssl.c 2014-07-22 21:00:45.754482770 +0200 +@@ -137,11 +137,13 @@ ssl_rand_init(void) + + if ((cp = value("ssl-rand-egd")) != NULL) { + cp = expand(cp); ++#ifdef HAVE_OPENSSL_RAND_EGD + if (RAND_egd(cp) == -1) { + fprintf(stderr, catgets(catd, CATSET, 245, + "entropy daemon at \"%s\" not available\n"), + cp); + } else ++#endif + state = 1; + } else if ((cp = value("ssl-rand-file")) != NULL) { + cp = expand(cp); +@@ -216,9 +218,7 @@ ssl_select_method(const char *uhp) + + cp = ssl_method_string(uhp); + if (cp != NULL) { +- if (equal(cp, "ssl2")) +- method = SSLv2_client_method(); +- else if (equal(cp, "ssl3")) ++ if (equal(cp, "ssl3")) + method = SSLv3_client_method(); + else if (equal(cp, "tls1")) + method = TLSv1_client_method(); + +--- a/openssl.c.orig 2016-03-30 17:03:49.491514269 +0200 ++++ b/openssl.c 2016-03-30 17:04:03.026491689 +0200 +@@ -219,7 +219,7 @@ ssl_select_method(const char *uhp) + cp = ssl_method_string(uhp); + if (cp != NULL) { + if (equal(cp, "ssl3")) +- method = SSLv3_client_method(); ++ method = SSLv23_client_method(); + else if (equal(cp, "tls1")) + method = TLSv1_client_method(); + else { diff --git a/source-files/mailx-12.3-pager.patch b/source-files/mailx-12.3-pager.patch new file mode 100644 index 0000000..d4b2439 --- /dev/null +++ b/source-files/mailx-12.3-pager.patch @@ -0,0 +1,12 @@ +diff -Nrbu mailx-12.3/cmd1.c mailx-12.3-OK/cmd1.c +--- mailx-12.3/cmd1.c 2007-06-16 16:48:39.000000000 +0400 ++++ mailx-12.3-OK/cmd1.c 2008-06-26 19:57:38.000000000 +0400 +@@ -78,7 +78,7 @@ + + cp = value("PAGER"); + if (cp == NULL || *cp == '\0') +- cp = value("bsdcompat") ? "more" : "pg"; ++ cp = value("bsdcompat") ? "more" : "less"; + return cp; + } + diff --git a/source-files/mailx-12.5-collect.patch b/source-files/mailx-12.5-collect.patch new file mode 100644 index 0000000..b84d2e8 --- /dev/null +++ b/source-files/mailx-12.5-collect.patch @@ -0,0 +1,13 @@ +--- mailx-12.4.orig/collect.c 2012-09-12 16:07:53.653103796 -0400 ++++ mailx-12.4/collect.c 2012-09-12 21:27:05.092259236 -0400 +@@ -905,7 +905,9 @@ err: + if (collf != NULL) { + Fclose(collf); + collf = NULL; +- } ++ } else { ++ exit(1); ++ } + out: + if (collf != NULL) { + if ((cp = value("MAILX_TAIL")) != NULL) { diff --git a/source-files/mailx-12.5-fname-null.patch b/source-files/mailx-12.5-fname-null.patch new file mode 100644 index 0000000..056e97f --- /dev/null +++ b/source-files/mailx-12.5-fname-null.patch @@ -0,0 +1,12 @@ +diff -upr mailx-12.5.orig/names.c mailx-12.5/names.c +--- mailx-12.5.orig/names.c 2006-03-04 01:32:16.000000000 +0100 ++++ mailx-12.5/names.c 2012-11-01 15:28:43.883573793 +0100 +@@ -357,7 +357,7 @@ outof(struct name *names, FILE *fo, stru + free_child(pid); + } else { + int f; +- if ((fout = Zopen(fname, "a", NULL)) == NULL) { ++ if ((fname == NULL) || ((fout = Zopen(fname, "a", NULL)) == NULL)) { + perror(fname); + senderr++; + goto cant; diff --git a/source-files/mailx-12.5-lzw.patch b/source-files/mailx-12.5-lzw.patch new file mode 100644 index 0000000..2dc1fbc --- /dev/null +++ b/source-files/mailx-12.5-lzw.patch @@ -0,0 +1,12 @@ +diff -Nrbu mailx-12.5/lzw.c mailx-12.5-OK/lzw.c +--- mailx-12.5/lzw.c 2006-03-04 03:32:16.000000000 +0300 ++++ mailx-12.5-OK/lzw.c 2011-08-17 16:30:01.000000000 +0400 +@@ -516,6 +516,8 @@ + + /* Generate output characters in reverse order. */ + while (code >= 256) { ++ if (stackp - de_stack >= HSIZE - 1) ++ return -1; + *stackp++ = tab_suffixof(code); + code = tab_prefixof(code); + } diff --git a/source-files/mailx-12.5-usage.patch b/source-files/mailx-12.5-usage.patch new file mode 100644 index 0000000..3c375ad --- /dev/null +++ b/source-files/mailx-12.5-usage.patch @@ -0,0 +1,12 @@ +diff -upr mailx-12.5.orig/main.c mailx-12.5/main.c +--- mailx-12.5.orig/main.c 2007-10-02 14:15:50.000000000 +0200 ++++ mailx-12.5/main.c 2013-07-22 16:06:56.960765683 +0200 +@@ -353,7 +353,7 @@ main(int argc, char *argv[]) + case '?': + usage: + fprintf(stderr, catgets(catd, CATSET, 135, +-"Usage: %s -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users\n"), progname); ++"Usage: %s -eiIUdEFntBDNHRVv~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users\n"), progname); + exit(2); + } + } diff --git a/source-files/nail-11.25-config.patch b/source-files/nail-11.25-config.patch new file mode 100644 index 0000000..b1dd7e0 --- /dev/null +++ b/source-files/nail-11.25-config.patch @@ -0,0 +1,11 @@ +diff -Nrbu nail-11.25/nail.rc nail-11.25-OK/nail.rc +--- nail-11.25/nail.rc 2005-01-15 17:33:16.000000000 +0300 ++++ nail-11.25-OK/nail.rc 2005-08-19 16:55:09.000000000 +0400 +@@ -60,3 +60,7 @@ + + # Only include selected header fields when forwarding messages. + fwdretain subject date from to ++ ++# For Linux and BSD, this should be set. ++set bsdcompat ++ diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..71c5dfd --- /dev/null +++ b/source.sh @@ -0,0 +1,39 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + for p in "$BPM_WORKDIR"/*.patch; do + patch -Np1 -i "$p" + done + + local OPTS=( + PREFIX=/usr + BINDIR=/usr/bin + MANDIR=/usr/share/man + SYSCONFDIR=/etc + MAILRC=/etc/mailx.rc + MAILSPOOL=/var/mail + UCBINSTALL=/usr/bin/install + SENDMAIL=/usr/sbin/sendmail + ) + echo "${OPTS[@]}" > makeflags +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + make $(cat makeflags) IPv6=-DHAVE_IPv6_FUNCS CFLAGS="${CFLAGS} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + make $(cat makeflags) DESTDIR="$BPM_OUTPUT" install + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/mailx/COPYING +}