From d17def138a962135bc006e14bb965bbb2ae305cd7430fa687b4f41126132bae9 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 7 Jun 2018 09:36:47 +0000 Subject: [PATCH] update-alternatives OBS-URL: https://build.opensuse.org/package/show/server:mail/mailx?expand=0&rev=57 --- mailx.changes | 6 ++++++ mailx.spec | 26 +++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/mailx.changes b/mailx.changes index 8f35066..e6ee89a 100644 --- a/mailx.changes +++ b/mailx.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 7 09:35:26 UTC 2018 - werner@suse.de + +- Use update-alternatives to allow an other package like mailutils + to provide /usr/bin/mail as well + ------------------------------------------------------------------- Mon Jun 12 11:11:38 UTC 2017 - werner@suse.de diff --git a/mailx.spec b/mailx.spec index 8970f29..851173b 100644 --- a/mailx.spec +++ b/mailx.spec @@ -1,7 +1,7 @@ # # spec file for package mailx # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,14 +24,17 @@ BuildRequires: openssl-devel BuildRequires: pcre BuildRequires: pkg-config BuildRequires: postfix +BuildRequires: update-alternatives BuildRequires: pkgconfig(openssl) +Requires(post): update-alternatives +Requires(preun): update-alternatives Url: http://heirloom.sourceforge.net/mailx.html Provides: mail Recommends: smtp_daemon Version: 12.5 Release: 0 Summary: A MIME-Capable Implementation of the mailx Command -License: BSD-4-Clause and MPL-1.1 +License: BSD-4-Clause AND MPL-1.1 Group: Productivity/Networking/Email/Utilities Source: mailx-%{version}.tar.bz2 Patch: mailx-%{version}.dif @@ -105,11 +108,28 @@ minor enhancements like the ability to set a "From:" address. %clean rm -rf $RPM_BUILD_ROOT +%post +%{_sbindir}/update-alternatives --quiet --force \ + --install %{_bindir}/mail mail %{_bindir}/mailx 20 \ + --slave /bin/mail binmail %{_bindir}/mailx \ + --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} + +%preun +%{_sbindir}/update-alternatives --quiet --force --remove mail %{_bindir}/mu-mail + %files %defattr(-,root,root) -%doc COPYING README manual.ps.gz nail.rc +%license COPYING +%doc README manual.ps.gz nail.rc /bin/mail %config /etc/mail.rc +%ghost %config %{_sysconfdir}/alternatives/binmail +%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} /usr/bin/Mail /usr/bin/mail /usr/bin/mailx