diff --git a/.mailx.metadata b/.mailx.metadata new file mode 100644 index 0000000..0f0b1ed --- /dev/null +++ b/.mailx.metadata @@ -0,0 +1 @@ +4a32285906e04e06a2c7665f04bd6510fc278462 SOURCES/mailx-12.5.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/get-upstream-tarball.sh b/SOURCES/get-upstream-tarball.sh new file mode 100755 index 0000000..ecaf226 --- /dev/null +++ b/SOURCES/get-upstream-tarball.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# +# Mailx's upstream provides only the CVS method of downloading source code. +# This script can be used for downloading the CVS repository and creating +# the tarball. +# +# Usage: ./get-upstream-tarball.sh +# +# This code is in the public domain; do with it what you wish. +# +# Copyright (C) 2012 Peter Schiffer +# + +newdir=new-upstream-tarball + +mkdir $newdir +cd $newdir + +# checkout cvs +echo "== Just press Enter ==" +cvs -d:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail login +cvs -d:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail co nail + +# remove CVS folders +rm -rf nail/CVS nail/catd/CVS + +# find version in nail/version.c file defined as: #define V "xxx" +ver=$(sed -rn 's/#define\s+V\s+\"([0-9.]+)\"/\1/p' nail/version.c) + +mv nail mailx-$ver +tar cJf mailx-$ver.tar.xz mailx-$ver + +rm -rf mailx-$ver + diff --git a/SOURCES/mailx-12.3-pager.patch b/SOURCES/mailx-12.3-pager.patch new file mode 100644 index 0000000..d4b2439 --- /dev/null +++ b/SOURCES/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/SOURCES/mailx-12.5-collect.patch b/SOURCES/mailx-12.5-collect.patch new file mode 100644 index 0000000..b84d2e8 --- /dev/null +++ b/SOURCES/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/SOURCES/mailx-12.5-fname-null.patch b/SOURCES/mailx-12.5-fname-null.patch new file mode 100644 index 0000000..056e97f --- /dev/null +++ b/SOURCES/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/SOURCES/mailx-12.5-lzw.patch b/SOURCES/mailx-12.5-lzw.patch new file mode 100644 index 0000000..2dc1fbc --- /dev/null +++ b/SOURCES/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/SOURCES/mailx-12.5-usage.patch b/SOURCES/mailx-12.5-usage.patch new file mode 100644 index 0000000..3c375ad --- /dev/null +++ b/SOURCES/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/SOURCES/nail-11.25-config.patch b/SOURCES/nail-11.25-config.patch new file mode 100644 index 0000000..b1dd7e0 --- /dev/null +++ b/SOURCES/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/SPECS/mailx.spec b/SPECS/mailx.spec new file mode 100644 index 0000000..1dac1f3 --- /dev/null +++ b/SPECS/mailx.spec @@ -0,0 +1,263 @@ +%global use_nss 1 +%global mailrc %{_sysconfdir}/mail.rc + +Summary: Enhanced implementation of the mailx command +Name: mailx +Version: 12.5 +Release: 9%{?dist} +# MPLv1.1 .. nss.c, nsserr.c +License: BSD with advertising and MPLv1.1 +Group: Applications/Internet +URL: http://heirloom.sourceforge.net/mailx.html +# Mailx's upstream provides only the CVS method of downloading source code. +# Use get-upstream-tarball.sh script to download current version of mailx. +Source0: mailx-%{version}.tar.xz +Source1: get-upstream-tarball.sh + +Patch0: nail-11.25-config.patch +Patch1: mailx-12.3-pager.patch +Patch2: mailx-12.5-lzw.patch +# resolves: #805410 +Patch3: mailx-12.5-fname-null.patch +# resolves: #857120 +Patch4: mailx-12.5-collect.patch +# resolves: #948869 +Patch5: mailx-12.5-usage.patch + +%if %{use_nss} +BuildRequires: nss-devel, pkgconfig, krb5-devel +%else +BuildRequires: openssl-devel +%endif + +Obsoletes: nail < %{version} +Provides: nail = %{version} + + +%description +Mailx is an enhanced mail command, which provides the functionality +of the POSIX mailx command, as well as SysV mail and Berkeley Mail +(from which it is derived). + +Additionally to the POSIX features, mailx can work with Maildir/ e-mail +storage format (as well as mailboxes), supports IMAP, POP3 and SMTP +protocols (including over SSL) to operate with remote hosts, handles mime +types and different charsets. There are a lot of other useful features, +see mailx(1). + +And as its ancient analogues, mailx can be used as a mail script language, +both for sending and receiving mail. + +Besides the "mailx" command, this package provides "mail" and "Mail" +(which should be compatible with its predecessors from the mailx-8.x source), +as well as "nail" (the initial name of this project). + + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +sed -i 's,/etc/nail.rc,%{mailrc},g' mailx.1 + + +%build +%if %{use_nss} +INCLUDES="$INCLUDES `pkg-config --cflags-only-I nss`" +export INCLUDES +%endif + +echo PREFIX=%{_prefix} \ + BINDIR=/bin \ + MANDIR=%{_mandir} \ + SYSCONFDIR=%{_sysconfdir} \ + MAILRC=%{mailrc} \ + MAILSPOOL=%{_localstatedir}/mail \ + SENDMAIL=%{_sbindir}/sendmail \ + UCBINSTALL=install \ +> makeflags + +# %{?_smp_mflags} cannot be used here +make `cat makeflags` \ + CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" \ + IPv6=-DHAVE_IPv6_FUNCS + + +%install +make DESTDIR=$RPM_BUILD_ROOT STRIP=: `cat makeflags` install + +ln -s mailx $RPM_BUILD_ROOT/bin/mail + +install -d $RPM_BUILD_ROOT%{_bindir} +pref=`echo %{_bindir} | sed 's,/[^/]*,../,g'` + +pushd $RPM_BUILD_ROOT%{_bindir} +ln -s ${pref}bin/mailx Mail +ln -s ${pref}bin/mailx nail +popd + +pushd $RPM_BUILD_ROOT%{_mandir}/man1 +ln -s mailx.1 mail.1 +ln -s mailx.1 Mail.1 +ln -s mailx.1 nail.1 +popd + + +%triggerpostun -- mailx < 12 +[[ -f %{mailrc}.rpmnew ]] && { + # old config was changed. Merge both together. + ( echo '# The settings above was inherited from the old mailx-8.x config' + echo + cat %{mailrc}.rpmnew + ) >>%{mailrc} +} || : + + +%triggerpostun -- nail <= 12.3 +[[ -f %{_sysconfdir}/nail.rc.rpmsave ]] && { + # old config was changed... + save=%{mailrc}.rpmnew + [[ -f $save ]] && save=%{mailrc}.rpmsave + + mv -f %{mailrc} $save + mv -f %{_sysconfdir}/nail.rc.rpmsave %{mailrc} +} || : + + +%files +%doc COPYING AUTHORS README +%config(noreplace) %{mailrc} +/bin/* +%{_bindir}/* +%{_mandir}/*/* + + +%changelog +* Mon Jul 22 2013 Peter Schiffer - 12.5-9 +- related: #912785 + used -D_FILE_OFFSET_BITS=64 flag at the compile time +- return error code when TMPDIR is set to an invalid path while sending email +- added missing -v option to the usage message + +* Thu Feb 14 2013 Fedora Release Engineering - 12.5-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Nov 5 2012 Peter Schiffer - 12.5-7 +- cleaned .spec file +- resolves: #805410 + fixed SIGSEGV crash in which_protocol() function +- updated get-upstream-tarball.sh script and added it as additional source + +* Thu Jul 19 2012 Fedora Release Engineering - 12.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 12.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Aug 17 2011 Dmitry Butskoy - 12.5-4 +- Fix decompress lzw issues (#731342) + +* Wed Feb 09 2011 Fedora Release Engineering - 12.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Jan 27 2011 Dmitry Butskoy - 12.5-2 +- rebuild for new krb5-libs + +* Tue Oct 26 2010 Dmitry Butskoy - 12.5-1 +- update to 12.5 +- drop patches applied upstream + +* Fri Oct 1 2010 Ivana Hutarova Varekova - 12.4-7 +- fix the typo in man-page + +* Mon Dec 21 2009 Ivana Hutarova Varekova - 12.4-6 +- fix source tag + +* Fri Dec 18 2009 Ivana Hutarova Varekova - 12.4-5 +- fix license tag + +* Sat Dec 12 2009 Robert Scheck - 12.4-4 +- Make OpenSSL support working again if NSS flag is disabled + +* Sat Jul 25 2009 Fedora Release Engineering - 12.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 12.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Aug 11 2008 Dmitry Butskoy - 12.4-1 +- update to 12.4 + +* Tue Jul 29 2008 Dmitry Butskoy - 12.3-1 +- Place mailx to /bin/mailx, to avoid extra symlink in redhat-lsb package +- /bin/mailx is now a base binary, another symlinked to it. + +* Thu Jun 26 2008 Dmitry Butskoy +- add missed BR for krb5-devel +- activate IPv6 support +- change config to /etc/mail.rc for compatibility +- add triggerpostun scriptlets against previous mailx and nail + to check and merge (when possible) their user config changes +- use proper config filename in manuals +- use "less" instead of non-provided "pg" for nobsdcompat mode + +* Wed Jun 18 2008 Dmitry Butskoy - 12.3-0 +- Change the name from "nail" to upstream's "mailx". + Merge with the ordinary "mailx" cvs tree for Fedora 10. + Now this stuff supersedes the old ancient mailx-8.x in Fedora. +- Build with nss instead of openssl, for "Security Consolidation" process. + +* Mon Feb 18 2008 Fedora Release Engineering - 12.3-4 +- Autorebuild for GCC 4.3 + +* Wed Dec 05 2007 Release Engineering - 12.3-3 + - Rebuild for deps + +* Tue Aug 28 2007 Fedora Release Engineering - 12.3-2 +- Rebuild for selinux ppc32 issue. + +* Fri Aug 17 2007 Dmitry Butskoy +- Change License tag to "BSD with advertising" + +* Tue Jul 24 2007 Dmitry Butskoy - 12.3-1 +- update to 12.3 + +* Fri Jan 12 2007 Dmitry Butskoy - 12.2-1 +- update to 12.2 +- spec file cleanups + +* Fri Jun 16 2006 Dmitry Butskoy - 12.1-1 +- update to 12.1 + +* Wed Mar 22 2006 Dmitry Butskoy - 12.0-2 +- complete "mailx to nail" changes in the manual and config files +- drop _smp_mflags: it caused make to work incorrectly. + +* Tue Mar 21 2006 Dmitry Butskoy - 12.0-1 +- upgrade to 12.0 +- change new upstream name "mailx" to the old name "nail" to avoid + conflicts with the Core mailx package. +- drop Source1, use package's html file instead. + +* Mon Oct 17 2005 Dmitry Butskoy - 11.25-4 +- don't strip binaries on makeinstall (#170972) + +* Mon Oct 3 2005 Dmitry Butskoy +- clear buildroot before install (Michael Schwendt) + +* Mon Sep 26 2005 Dmitry Butskoy - 11.25-3 +- more spec file cleanups +- accepted for Fedora Extra + (review by Aurelien Bompard ) + +* Mon Aug 22 2005 Dmitry Butskoy - 11.25-2 +- spec file cleanups (#166343) + +* Fri Aug 19 2005 Dmitry Butskoy - 11.25-1 +- initial release +- add "set bsdcompat" to nail.rc as default +- copy nail web page to doc +