580d49
%global use_nss 0
580d49
%global mailrc %{_sysconfdir}/mail.rc
580d49
580d49
Summary: Enhanced implementation of the mailx command
580d49
Name: mailx
580d49
Version: 12.5
580d49
Release: 29%{?dist}
580d49
# MPLv1.1 .. nss.c, nsserr.c
580d49
License: BSD with advertising and MPLv1.1
580d49
Group: Applications/Internet
580d49
URL: http://heirloom.sourceforge.net/mailx.html
580d49
# Mailx's upstream provides only the CVS method of downloading source code.
580d49
# Use get-upstream-tarball.sh script to download current version of mailx.
580d49
Source0: mailx-%{version}.tar.xz
580d49
Source1: get-upstream-tarball.sh
580d49
580d49
Patch0: nail-11.25-config.patch
580d49
Patch1: mailx-12.3-pager.patch
580d49
Patch2: mailx-12.5-lzw.patch
580d49
# resolves: #805410
580d49
Patch3: mailx-12.5-fname-null.patch
580d49
# resolves: #857120
580d49
Patch4: mailx-12.5-collect.patch
580d49
# resolves: #948869
580d49
Patch5: mailx-12.5-usage.patch
580d49
# resolves: #1099275 and #979460
580d49
Patch6: mailx-12.5-man-page-fixes.patch
580d49
580d49
Patch7: mailx-12.5-outof-Introduce-expandaddr-flag.patch
580d49
Patch8: mailx-12.5-fio.c-Unconditionally-require-wordexp-support.patch
580d49
Patch9: mailx-12.5-globname-Invoke-wordexp-with-WRDE_NOCMD-CVE-2004-277.patch
580d49
Patch10: mailx-12.5-unpack-Disable-option-processing-for-email-addresses.patch
580d49
580d49
# resolves: #1113617
580d49
Patch11: mailx-12.5-empty-from.patch
580d49
# resolves: #1296536
580d49
Patch12: mailx-12.5-nss-hostname-matching.patch
580d49
# resolves: #1494559
580d49
Patch13: mailx-12.5-encsplit.patch
580d49
# fix issues with openssl >= 1.1.0
580d49
Patch14: mailx-12.5-openssl.patch
580d49
# resolves: #1602614
580d49
Patch15: mailx-12.5-coverity.patch
580d49
580d49
BuildRequires: gcc
580d49
580d49
%if %{use_nss}
580d49
BuildRequires: nss-devel, pkgconfig, krb5-devel
580d49
%else
580d49
BuildRequires: openssl-devel
580d49
%endif
580d49
580d49
Obsoletes: nail < %{version}
580d49
Provides: nail = %{version}
580d49
580d49
580d49
%description
580d49
Mailx is an enhanced mail command, which provides the functionality
580d49
of the POSIX mailx command, as well as SysV mail and Berkeley Mail
580d49
(from which it is derived).
580d49
580d49
Additionally to the POSIX features, mailx can work with Maildir/ e-mail
580d49
storage format (as well as mailboxes), supports IMAP, POP3 and SMTP
580d49
protocols (including over SSL) to operate with remote hosts, handles mime
580d49
types and different charsets. There are a lot of other useful features,
580d49
see mailx(1).
580d49
580d49
And as its ancient analogues, mailx can be used as a mail script language,
580d49
both for sending and receiving mail.
580d49
580d49
Besides the "mailx" command, this package provides "mail" and "Mail"
580d49
(which should be compatible with its predecessors from the mailx-8.x source),
580d49
as well as "nail" (the initial name of this project).
580d49
580d49
580d49
%prep
580d49
%setup -q
580d49
%patch0 -p1
580d49
%patch1 -p1
580d49
%patch2 -p1
580d49
%patch3 -p1
580d49
%patch4 -p1
580d49
%patch5 -p1
580d49
%patch6 -p1
580d49
%patch7 -p1
580d49
%patch8 -p1
580d49
%patch9 -p1
580d49
%patch10 -p1
580d49
%patch11 -p1
580d49
%patch12 -p1
580d49
%patch13 -p1
580d49
%patch14 -p1
580d49
%patch15 -p1
580d49
sed -i 's,/etc/nail.rc,%{mailrc},g' mailx.1
580d49
580d49
580d49
%build
580d49
%if %{use_nss}
580d49
INCLUDES="$INCLUDES `pkg-config --cflags-only-I nss`"
580d49
export INCLUDES
580d49
%endif
580d49
580d49
export LDFLAGS="%{build_ldflags}"
580d49
580d49
echo    PREFIX=%{_prefix} \
580d49
    BINDIR=/bin \
580d49
    MANDIR=%{_mandir} \
580d49
    SYSCONFDIR=%{_sysconfdir} \
580d49
    MAILRC=%{mailrc} \
580d49
    MAILSPOOL=%{_localstatedir}/mail \
580d49
    SENDMAIL=%{_sbindir}/sendmail \
580d49
    UCBINSTALL=install \
580d49
> makeflags
580d49
580d49
#  %{?_smp_mflags} cannot be used here
580d49
make `cat makeflags` \
580d49
    CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" \
580d49
    IPv6=-DHAVE_IPv6_FUNCS
580d49
580d49
580d49
%install
580d49
make DESTDIR=$RPM_BUILD_ROOT STRIP=: `cat makeflags` install
580d49
580d49
ln -s mailx $RPM_BUILD_ROOT/bin/mail
580d49
580d49
install -d $RPM_BUILD_ROOT%{_bindir}
580d49
pref=`echo %{_bindir} | sed 's,/[^/]*,../,g'`
580d49
580d49
pushd $RPM_BUILD_ROOT%{_bindir}
580d49
ln -s ${pref}bin/mailx Mail
580d49
ln -s ${pref}bin/mailx nail
580d49
popd
580d49
580d49
pushd $RPM_BUILD_ROOT%{_mandir}/man1
580d49
ln -s mailx.1 mail.1
580d49
ln -s mailx.1 Mail.1
580d49
ln -s mailx.1 nail.1
580d49
popd
580d49
580d49
580d49
%triggerpostun -- mailx < 12
580d49
[[ -f %{mailrc}.rpmnew ]] && {
580d49
    # old config was changed. Merge both together.
580d49
    ( echo '# The settings above was inherited from the old mailx-8.x config'
580d49
      echo
580d49
      cat %{mailrc}.rpmnew
580d49
    ) >>%{mailrc}
580d49
} || :
580d49
580d49
580d49
%triggerpostun -- nail <= 12.3
580d49
[[ -f %{_sysconfdir}/nail.rc.rpmsave ]] && {
580d49
    # old config was changed...
580d49
    save=%{mailrc}.rpmnew
580d49
    [[ -f $save ]] && save=%{mailrc}.rpmsave
580d49
580d49
    mv -f %{mailrc} $save
580d49
    mv -f %{_sysconfdir}/nail.rc.rpmsave %{mailrc}
580d49
} || :
580d49
580d49
580d49
%files
580d49
%doc COPYING AUTHORS README
580d49
%config(noreplace) %{mailrc}
580d49
/bin/*
580d49
%{_bindir}/*
580d49
%{_mandir}/*/*
580d49
580d49
580d49
%changelog
580d49
* Thu Oct 18 2018 Nikola Forró <nforro@redhat.com> - 12.5-29
580d49
- fix important Covscan defects
580d49
  resolves: #1602614
580d49
580d49
* Wed Apr 18 2018 Nikola Forró <nforro@redhat.com> - 12.5-28
580d49
- switch to OpenSSL
580d49
580d49
* Tue Feb 20 2018 Nikola Forró <nforro@redhat.com> - 12.5-27
580d49
- add missing gcc build dependency
580d49
 
580d49
* Fri Feb  9 2018 Florian Weimer <fweimer@redhat.com> - 12.5-26
580d49
- Use LDFLAGS from redhat-rpm-config
580d49
580d49
* Wed Feb 07 2018 Nikola Forró <nforro@redhat.com> - 12.5-25
580d49
- fix also quoted-printable encoded words
580d49
  related: #1494559, #1515591
580d49
580d49
* Wed Nov 22 2017 Nikola Forró <nforro@redhat.com> - 12.5-24
580d49
- add missing linear whitespace to encsplit patch
580d49
  resolves: #1515591
580d49
580d49
* Fri Sep 22 2017 Nikola Forró <nforro@redhat.com> - 12.5-23
580d49
- fix multi-byte encoded line-folding
580d49
  resolves: #1494559
580d49
580d49
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 12.5-22
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
580d49
580d49
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 12.5-21
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
580d49
580d49
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 12.5-20
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
580d49
580d49
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 12.5-19
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
580d49
580d49
* Thu Jan 07 2016 Nikola Forró <nforro@redhat.com> - 12.5-18
580d49
- fix nss hostname matching
580d49
  resolves: #1296536
580d49
580d49
* Thu Jul 16 2015 Nikola Forró <nforro@redhat.com> - 12.5-17
580d49
- fix SIGSEGV crash in smtp_auth_var()
580d49
- add warning message for empty from
580d49
  resolves: #1113617
580d49
580d49
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-16
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
580d49
580d49
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 12.5-15
580d49
- Rebuilt for Fedora 23 Change
580d49
  https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
580d49
580d49
* Wed Dec 17 2014 jchaloup <jchaloup@redhat.com> - 12.5-14
580d49
- Security fix for CVE-2004-2771, CVE-2014-7844
580d49
  resolves: #1174903
580d49
580d49
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-13
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
580d49
580d49
* Fri Jun 13 2014 Peter Schiffer <pschiffe@redhat.com> - 12.5-12
580d49
- added 2 clarifications to the mailx(1) man page
580d49
580d49
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-11
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
580d49
580d49
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-10
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
580d49
580d49
* Mon Jul 22 2013 Peter Schiffer <pschiffe@redhat.com> - 12.5-9
580d49
- related: #912785
580d49
  used -D_FILE_OFFSET_BITS=64 flag at the compile time
580d49
- return error code when TMPDIR is set to an invalid path while sending email
580d49
- added missing -v option to the usage message
580d49
580d49
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-8
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
580d49
580d49
* Mon Nov  5 2012 Peter Schiffer <pschiffe@redhat.com> - 12.5-7
580d49
- cleaned .spec file
580d49
- resolves: #805410
580d49
  fixed SIGSEGV crash in which_protocol() function
580d49
- updated get-upstream-tarball.sh script and added it as additional source
580d49
580d49
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-6
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
580d49
580d49
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-5
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
580d49
580d49
* Wed Aug 17 2011 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.5-4
580d49
- Fix decompress lzw issues (#731342)
580d49
580d49
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-3
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
580d49
580d49
* Thu Jan 27 2011 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.5-2
580d49
- rebuild for new krb5-libs
580d49
580d49
* Tue Oct 26 2010 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.5-1
580d49
- update to 12.5
580d49
- drop patches applied upstream
580d49
580d49
* Fri Oct  1 2010 Ivana Hutarova Varekova <varekova@redhat.com> - 12.4-7
580d49
- fix the typo in man-page
580d49
580d49
* Mon Dec 21 2009 Ivana Hutarova Varekova <varekova@redhat.com> - 12.4-6
580d49
- fix source tag
580d49
580d49
* Fri Dec 18 2009 Ivana Hutarova Varekova <varekova@redhat.com> - 12.4-5
580d49
- fix license tag
580d49
580d49
* Sat Dec 12 2009 Robert Scheck <robert@fedoraproject.org> - 12.4-4
580d49
- Make OpenSSL support working again if NSS flag is disabled
580d49
580d49
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.4-3
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
580d49
580d49
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.4-2
580d49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
580d49
580d49
* Mon Aug 11 2008 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.4-1
580d49
- update to 12.4
580d49
580d49
* Tue Jul 29 2008 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.3-1
580d49
- Place mailx to /bin/mailx, to avoid extra symlink in redhat-lsb package
580d49
- /bin/mailx is now a base binary, another symlinked to it.
580d49
580d49
* Thu Jun 26 2008 Dmitry Butskoy <Dmitry@Butskoy.name>
580d49
- add missed BR for krb5-devel
580d49
- activate IPv6 support
580d49
- change config to /etc/mail.rc for compatibility
580d49
- add triggerpostun scriptlets against previous mailx and nail
580d49
  to check and merge (when possible) their user config changes
580d49
- use proper config filename in manuals
580d49
- use "less" instead of non-provided "pg" for nobsdcompat mode
580d49
580d49
* Wed Jun 18 2008 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.3-0
580d49
- Change the name from "nail" to upstream's "mailx".
580d49
  Merge with the ordinary "mailx" cvs tree for Fedora 10.
580d49
  Now this stuff supersedes the old ancient mailx-8.x in Fedora.
580d49
- Build with nss instead of openssl, for "Security Consolidation" process.
580d49
580d49
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 12.3-4
580d49
- Autorebuild for GCC 4.3
580d49
580d49
* Wed Dec 05 2007 Release Engineering <rel-eng at fedoraproject dot org> - 12.3-3
580d49
 - Rebuild for deps
580d49
580d49
* Tue Aug 28 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 12.3-2
580d49
- Rebuild for selinux ppc32 issue.
580d49
580d49
* Fri Aug 17 2007 Dmitry Butskoy <Dmitry@Butskoy.name>
580d49
- Change License tag to "BSD with advertising"
580d49
580d49
* Tue Jul 24 2007 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.3-1
580d49
- update to 12.3
580d49
580d49
* Fri Jan 12 2007 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.2-1
580d49
- update to 12.2
580d49
- spec file cleanups
580d49
580d49
* Fri Jun 16 2006 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.1-1
580d49
- update to 12.1
580d49
580d49
* Wed Mar 22 2006 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.0-2
580d49
- complete "mailx to nail" changes in the manual and config files
580d49
- drop _smp_mflags: it caused make to work incorrectly.
580d49
580d49
* Tue Mar 21 2006 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.0-1
580d49
- upgrade to 12.0
580d49
- change new upstream name "mailx" to the old name "nail" to avoid
580d49
  conflicts with the Core mailx package.
580d49
- drop Source1, use package's html file instead.
580d49
580d49
* Mon Oct 17 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 11.25-4
580d49
- don't strip binaries on makeinstall (#170972)
580d49
580d49
* Mon Oct  3 2005 Dmitry Butskoy <Dmitry@Butskoy.name>
580d49
- clear buildroot before install (Michael Schwendt)
580d49
580d49
* Mon Sep 26 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 11.25-3
580d49
- more spec file cleanups
580d49
- accepted for Fedora Extra
580d49
  (review by Aurelien Bompard <gauret@free.fr>)
580d49
580d49
* Mon Aug 22 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 11.25-2
580d49
- spec file cleanups (#166343)
580d49
580d49
* Fri Aug 19 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 11.25-1
580d49
- initial release
580d49
- add "set bsdcompat" to nail.rc as default
580d49
- copy nail web page to doc
580d49