2006-12-19 00:17:04 +01:00
|
|
|
#
|
2011-04-09 23:34:13 +02:00
|
|
|
# spec file for package mailx
|
2006-12-19 00:17:04 +01:00
|
|
|
#
|
2023-11-07 11:24:59 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2006-12-19 00:17:04 +01:00
|
|
|
#
|
2008-10-23 04:39:33 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2021-01-06 10:42:55 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2006-12-19 00:17:04 +01:00
|
|
|
#
|
|
|
|
|
2008-10-23 04:39:33 +02:00
|
|
|
|
2022-02-18 15:21:53 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
|
|
|
|
2006-12-19 00:17:04 +01:00
|
|
|
Name: mailx
|
2013-06-26 15:16:11 +02:00
|
|
|
BuildRequires: groff
|
2012-03-23 15:09:16 +01:00
|
|
|
BuildRequires: krb5-devel
|
2012-09-16 22:47:26 +02:00
|
|
|
BuildRequires: man
|
2012-03-23 15:09:16 +01:00
|
|
|
BuildRequires: pcre
|
2017-06-12 13:20:41 +02:00
|
|
|
BuildRequires: pkg-config
|
2012-03-23 15:09:16 +01:00
|
|
|
BuildRequires: postfix
|
2018-06-07 11:36:47 +02:00
|
|
|
BuildRequires: update-alternatives
|
2017-06-12 13:18:21 +02:00
|
|
|
BuildRequires: pkgconfig(openssl)
|
2022-02-18 15:21:53 +01:00
|
|
|
%if %{with libalternatives}
|
|
|
|
BuildRequires: alts
|
|
|
|
Requires: alts
|
|
|
|
%else
|
2018-06-07 11:36:47 +02:00
|
|
|
Requires(post): update-alternatives
|
2021-11-23 13:43:48 +01:00
|
|
|
Requires(postun):update-alternatives
|
2022-02-18 15:21:53 +01:00
|
|
|
%endif
|
2021-01-06 10:42:55 +01:00
|
|
|
URL: http://heirloom.sourceforge.net/mailx.html
|
2006-12-19 00:17:04 +01:00
|
|
|
Provides: mail
|
2011-02-03 12:01:03 +01:00
|
|
|
Recommends: smtp_daemon
|
2011-05-13 13:37:37 +02:00
|
|
|
Version: 12.5
|
2012-03-23 15:09:16 +01:00
|
|
|
Release: 0
|
2006-12-19 00:17:04 +01:00
|
|
|
Summary: A MIME-Capable Implementation of the mailx Command
|
2018-06-07 11:36:47 +02:00
|
|
|
License: BSD-4-Clause AND MPL-1.1
|
2012-03-23 15:09:16 +01:00
|
|
|
Group: Productivity/Networking/Email/Utilities
|
2006-12-19 00:17:04 +01:00
|
|
|
Source: mailx-%{version}.tar.bz2
|
2023-11-07 11:24:59 +01:00
|
|
|
Patch0: mailx-%{version}.dif
|
2006-12-19 00:17:04 +01:00
|
|
|
Patch1: nail-11.25-path.dif
|
2011-05-13 13:37:37 +02:00
|
|
|
Patch2: mailx-%{version}-replyto.patch
|
2006-12-19 00:17:04 +01:00
|
|
|
Patch3: nail-11.25-ttychar.dif
|
|
|
|
Patch4: nail-11.25-toaddr.dif
|
|
|
|
Patch5: mailx-%{version}-mime.dif
|
2010-04-20 02:07:59 +02:00
|
|
|
Patch6: mailx-fix-openssl.patch
|
2013-07-02 13:35:50 +02:00
|
|
|
#PATCH-FIX-OPENSUSE: Try to tranquilize gcc warning about parentheses (please check!)
|
|
|
|
Patch7: mailx-12.5-parentheses.dif
|
2013-12-06 13:48:41 +01:00
|
|
|
#PATCH-FIX-SUSE: Fix IPv6 address handling
|
2013-12-03 10:08:35 +01:00
|
|
|
Patch8: mailx-12.5-ipv6.dif
|
2014-12-17 13:34:52 +01:00
|
|
|
#PATCH-FIX-SUSE: bsc#909208 -- CVE-2004-2771, CVE-2014-7844: mailx: shell command injection via crafted email addresses
|
|
|
|
Patch9: 0001-outof-Introduce-expandaddr-flag.patch
|
|
|
|
#PATCH-FIX-SUSE: bsc#909208 -- CVE-2004-2771, CVE-2014-7844: mailx: shell command injection via crafted email addresses
|
|
|
|
Patch10: 0002-unpack-Disable-option-processing-for-email-addresses.patch
|
|
|
|
#PATCH-FIX-SUSE: bsc#909208 -- CVE-2004-2771, CVE-2014-7844: mailx: shell command injection via crafted email addresses
|
|
|
|
Patch11: 0003-fio.c-Unconditionally-require-wordexp-support.patch
|
|
|
|
#PATCH-FIX-SUSE: bsc#909208 -- CVE-2004-2771, CVE-2014-7844: mailx: shell command injection via crafted email addresses
|
|
|
|
Patch12: 0004-globname-Invoke-wordexp-with-WRDE_NOCMD-CVE-2004-277.patch
|
2017-06-12 13:13:44 +02:00
|
|
|
#PATCH-FIX-SUSE: bsc#1042663 -- mailx fails to build with openssl-1.1
|
|
|
|
Patch13: mailx-12.5-openssl-1.1.0f.patch
|
2021-01-06 10:42:55 +01:00
|
|
|
#PATCH-FIX-SUSE: bsc#1180355 -- mailx calls sendmail with wrong name
|
|
|
|
Patch14: fix-sendmail-name.patch
|
2021-11-23 13:43:48 +01:00
|
|
|
#PATCH-FIX-SUSE: bsc#1192916 - mailx does not send mails unless run via strace or in verbose mode
|
|
|
|
Patch15: mailx-12.5-systemd.patch
|
2023-12-11 08:07:14 +01:00
|
|
|
#Moving /etc/mailrc to /usr/etc/mail.rc
|
|
|
|
Patch16: mailx-usr-etc.patch
|
2006-12-19 00:17:04 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
|
|
|
Nail is a mail user agent derived from Berkeley Mail 8.1. It is
|
|
|
|
intended to provide the functionality of the POSIX.2 mailx command with
|
|
|
|
additional support for MIME messages, POP3, and SMTP. In recent system
|
|
|
|
environments, nail is Unicode/UTF-8 capable. Further, it contains some
|
|
|
|
minor enhancements like the ability to set a "From:" address.
|
|
|
|
|
|
|
|
%prep
|
2014-04-25 20:09:11 +02:00
|
|
|
%setup -q -n mailx-%{version}
|
2006-12-19 00:17:04 +01:00
|
|
|
%patch1 -p0 -b .path
|
|
|
|
%patch2 -p0 -b .rplyto
|
|
|
|
%patch3 -p0 -b .ttychr
|
|
|
|
%patch4 -p0 -b .toaddr
|
|
|
|
%patch5 -p0 -b .mime
|
2011-05-13 13:37:37 +02:00
|
|
|
%patch6 -p0 -b .ssl
|
2013-07-02 13:35:50 +02:00
|
|
|
%patch7 -p0 -b .par
|
2013-12-03 10:08:35 +01:00
|
|
|
%patch8 -p0 -b .ipv6
|
2014-12-17 13:34:52 +01:00
|
|
|
%patch9 -p1 -b .0001
|
|
|
|
%patch10 -p1 -b .0002
|
|
|
|
%patch11 -p1 -b .0003
|
|
|
|
%patch12 -p1 -b .0004
|
2017-06-12 13:13:44 +02:00
|
|
|
%patch13 -p0 -b .ssl11f
|
2021-01-06 10:42:55 +01:00
|
|
|
%patch14 -p1 -b .sendmail
|
2021-11-23 13:43:48 +01:00
|
|
|
%patch15 -p0 -b .systemd
|
2023-11-07 11:24:59 +01:00
|
|
|
%patch0 -p1 -b .0
|
2023-12-11 08:07:14 +01:00
|
|
|
%patch16 -p1 -b .usretc
|
2006-12-19 00:17:04 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
CC=gcc
|
2018-06-11 11:52:20 +02:00
|
|
|
CFLAGS="%{optflags} -pipe -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN $(pkg-config --cflags openssl)"
|
2006-12-19 00:17:04 +01:00
|
|
|
export CC CFLAGS
|
2011-02-03 12:01:03 +01:00
|
|
|
$SHELL ./makeconfig
|
2023-12-11 08:07:14 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
make %{?_smp_mflags} PREFIX=/usr CC="$CC" CFLAGS="$CFLAGS" DISTCONF="-DDISTCONFMAILRC=\"\\\"/usr/etc/mail.rc\\\"\""
|
|
|
|
%else
|
2018-06-11 11:52:20 +02:00
|
|
|
make %{?_smp_mflags} PREFIX=/usr CC="$CC" CFLAGS="$CFLAGS"
|
2023-12-11 08:07:14 +01:00
|
|
|
%endif
|
2017-05-11 08:19:02 +02:00
|
|
|
tbl < mailx.1 | groff -mandocdb -Tps | grep -v %%%%CreationDate > manual.ps
|
|
|
|
gzip -9fn manual.ps
|
2006-12-19 00:17:04 +01:00
|
|
|
|
|
|
|
%install
|
2018-06-11 11:52:20 +02:00
|
|
|
%make_install PREFIX=/usr
|
|
|
|
rm -rf %{buildroot}/bin
|
|
|
|
mkdir %{buildroot}/bin
|
2022-02-18 15:21:53 +01:00
|
|
|
%if ! %{with libalternatives}
|
2022-03-21 11:32:34 +01:00
|
|
|
# create symlinks for update-alternatives
|
2018-11-19 10:49:16 +01:00
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
2023-01-09 11:24:45 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
2018-11-19 10:49:16 +01:00
|
|
|
ln -sf %{_sysconfdir}/alternatives/binmail %{buildroot}/bin/mail
|
2021-01-29 08:56:05 +01:00
|
|
|
%endif
|
2018-11-19 10:49:16 +01:00
|
|
|
ln -sf %{_sysconfdir}/alternatives/Mail %{buildroot}/usr/bin/Mail
|
|
|
|
ln -sf %{_sysconfdir}/alternatives/mail %{buildroot}/usr/bin/mail
|
|
|
|
ln -sf %{_sysconfdir}/alternatives/Mail.1%{?ext_man} %{buildroot}%{_mandir}/man1/Mail.1%{?ext_man}
|
|
|
|
ln -sf %{_sysconfdir}/alternatives/mail.1%{?ext_man} %{buildroot}%{_mandir}/man1/mail.1%{?ext_man}
|
|
|
|
#
|
2023-01-09 11:24:45 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
2018-11-19 10:49:16 +01:00
|
|
|
ln -sf %{_bindir}/mailx %{buildroot}%{_sysconfdir}/alternatives/binmail
|
2021-01-29 08:56:05 +01:00
|
|
|
%endif
|
2018-11-19 10:49:16 +01:00
|
|
|
ln -sf %{_bindir}/mailx %{buildroot}%{_sysconfdir}/alternatives/Mail
|
|
|
|
ln -sf %{_bindir}/mailx %{buildroot}%{_sysconfdir}/alternatives/mail
|
|
|
|
ln -sf %{_mandir}/man1/mailx.1%{?ext_man} %{buildroot}%{_sysconfdir}/alternatives/Mail.1%{?ext_man}
|
|
|
|
ln -sf %{_mandir}/man1/mailx.1%{?ext_man} %{buildroot}%{_sysconfdir}/alternatives/mail.1%{?ext_man}
|
2022-02-18 15:21:53 +01:00
|
|
|
%else
|
|
|
|
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/Mail
|
2023-01-09 11:24:45 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
2022-02-18 15:21:53 +01:00
|
|
|
ln -sf %{_bindir}/alts %{buildroot}/bin/Mail
|
|
|
|
%endif
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/libalternatives/Mail
|
|
|
|
cat > %{buildroot}%{_datadir}/libalternatives/Mail/20.conf <<EOF
|
|
|
|
binary=%{_bindir}/mailx
|
|
|
|
man=mailx.1
|
|
|
|
group=mail, Mail
|
|
|
|
EOF
|
|
|
|
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/mail
|
2023-01-09 11:24:45 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
2022-02-18 15:21:53 +01:00
|
|
|
ln -sf %{_bindir}/alts %{buildroot}/bin/mail
|
|
|
|
%endif
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/libalternatives/mail
|
|
|
|
cat > %{buildroot}%{_datadir}/libalternatives/mail/20.conf <<EOF
|
|
|
|
binary=%{_bindir}/mailx
|
|
|
|
man=mailx.1
|
|
|
|
group=mail, Mail
|
|
|
|
EOF
|
2022-03-21 11:32:34 +01:00
|
|
|
%endif
|
2023-12-11 08:07:14 +01:00
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
mkdir -p %{buildroot}%{_distconfdir}
|
|
|
|
install -m 0644 mail.rc %{buildroot}%{_distconfdir}
|
|
|
|
rm %{buildroot}/etc/mail.rc
|
|
|
|
%else
|
2018-06-11 11:52:20 +02:00
|
|
|
install -m 0644 mail.rc %{buildroot}/etc
|
2023-12-11 08:07:14 +01:00
|
|
|
%endif
|
2018-06-11 11:52:20 +02:00
|
|
|
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}
|
2008-10-23 04:39:33 +02:00
|
|
|
|
2022-03-21 11:32:34 +01:00
|
|
|
%if ! %{with libalternatives}
|
2018-06-07 11:36:47 +02:00
|
|
|
%post
|
|
|
|
%{_sbindir}/update-alternatives --quiet --force \
|
|
|
|
--install %{_bindir}/mail mail %{_bindir}/mailx 20 \
|
2023-01-09 11:24:45 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
2018-06-07 11:36:47 +02:00
|
|
|
--slave /bin/mail binmail %{_bindir}/mailx \
|
2021-01-29 08:56:05 +01:00
|
|
|
%endif
|
2018-06-07 11:36:47 +02:00
|
|
|
--slave %{_bindir}/Mail Mail %{_bindir}/mailx \
|
|
|
|
--slave %{_mandir}/man1/mail.1%{?ext_man} mail.1%{?ext_man} %{_mandir}/man1/mailx.1%{?ext_man} \
|
|
|
|
--slave %{_mandir}/man1/Mail.1%{?ext_man} Mail.1%{?ext_man} %{_mandir}/man1/mailx.1%{?ext_man}
|
|
|
|
|
2021-01-29 08:56:05 +01:00
|
|
|
%postun
|
2018-11-19 11:53:20 +01:00
|
|
|
if test ! -e %{_bindir}/mailx; then
|
|
|
|
%{_sbindir}/update-alternatives --quiet --force --remove mail %{_bindir}/mailx
|
|
|
|
fi
|
2023-12-11 08:07:14 +01:00
|
|
|
%endif
|
2022-03-21 11:32:34 +01:00
|
|
|
|
2022-02-18 15:21:53 +01:00
|
|
|
%pre
|
2023-12-11 08:07:14 +01:00
|
|
|
echo "Calling pre installation script"
|
|
|
|
%if %{with libalternatives}
|
2022-02-18 15:21:53 +01:00
|
|
|
# removing old update-alternatives entries
|
2022-03-21 11:32:34 +01:00
|
|
|
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
|
|
|
|
%{_sbindir}/update-alternatives --quiet --force --remove mail %{_bindir}/mailx
|
2022-02-18 15:21:53 +01:00
|
|
|
fi
|
|
|
|
%endif
|
2023-12-11 08:07:14 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
# Prepare for migration to /usr/etc; save any old .rpmsave
|
|
|
|
for i in mail.rc; do
|
|
|
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
|
|
|
|
done
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%posttrans
|
|
|
|
# Migration to /usr/etc, restore just created .rpmsave
|
|
|
|
for i in mail.rc; do
|
|
|
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
|
|
|
|
done
|
|
|
|
%endif
|
2018-06-07 11:36:47 +02:00
|
|
|
|
2006-12-19 00:17:04 +01:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2018-06-07 11:36:47 +02:00
|
|
|
%license COPYING
|
|
|
|
%doc README manual.ps.gz nail.rc
|
2023-12-11 08:07:14 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%{_distconfdir}/mail.rc
|
|
|
|
%else
|
2006-12-19 00:17:04 +01:00
|
|
|
%config /etc/mail.rc
|
2023-12-11 08:07:14 +01:00
|
|
|
%endif
|
2023-01-09 11:24:45 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
2021-01-29 08:56:05 +01:00
|
|
|
/bin/mail
|
2022-02-18 15:21:53 +01:00
|
|
|
%endif
|
|
|
|
/usr/bin/Mail
|
|
|
|
/usr/bin/mail
|
|
|
|
%if ! 0%{with libalternatives}
|
2023-01-09 11:24:45 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
2018-06-07 11:36:47 +02:00
|
|
|
%ghost %config %{_sysconfdir}/alternatives/binmail
|
2021-01-29 08:56:05 +01:00
|
|
|
%endif
|
2018-06-07 11:36:47 +02:00
|
|
|
%ghost %config %{_sysconfdir}/alternatives/Mail
|
|
|
|
%ghost %config %{_sysconfdir}/alternatives/mail
|
|
|
|
%ghost %config %{_sysconfdir}/alternatives/Mail.1%{?ext_man}
|
|
|
|
%ghost %config %{_sysconfdir}/alternatives/mail.1%{?ext_man}
|
2006-12-19 00:17:04 +01:00
|
|
|
%doc %{_mandir}/man1/Mail.1.gz
|
|
|
|
%doc %{_mandir}/man1/mail.1.gz
|
2022-02-18 15:21:53 +01:00
|
|
|
%else
|
|
|
|
%dir %{_datadir}/libalternatives
|
|
|
|
%dir %{_datadir}/libalternatives/mail
|
|
|
|
%dir %{_datadir}/libalternatives/Mail
|
|
|
|
%{_datadir}/libalternatives/Mail/20.conf
|
|
|
|
%{_datadir}/libalternatives/mail/20.conf
|
|
|
|
%endif
|
|
|
|
|
|
|
|
/usr/bin/mailx
|
2006-12-19 00:17:04 +01:00
|
|
|
%doc %{_mandir}/man1/mailx.1.gz
|
|
|
|
|
2007-04-18 00:40:16 +02:00
|
|
|
%changelog
|