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