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