diff --git a/s-nail.spec b/s-nail.spec index d1c1456..fba061b 100644 --- a/s-nail.spec +++ b/s-nail.spec @@ -1,5 +1,5 @@ Name: s-nail -Version: 14.9.18 +Version: 14.9.19 Release: 1%{?dist} Summary: Environment for sending and receiving mail @@ -19,6 +19,10 @@ BuildRequires: krb5-devel BuildRequires: libidn2-devel BuildRequires: ncurses-devel +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives +Requires(preun): %{_sbindir}/update-alternatives + %description S-nail provides a simple and friendly environment for sending @@ -38,6 +42,14 @@ non-interactive scripting capabilities. %autosetup -p1 +cat <>nail.rc + +# Fedora-specific defaults +set bsdcompat +set noemptystart +set prompt='& ' +EOF + %build %make_build \ @@ -61,20 +73,71 @@ non-interactive scripting capabilities. # s-nail binary is installed with 0555 permissions, fix that chmod 0755 %{buildroot}%{_bindir}/%{name} +# provide files for alternative usage +ln -s %{_bindir}/%{name} %{buildroot}%{_bindir}/mailx.%{name} +touch %{buildroot}%{_bindir}/{Mail,mail,mailx,nail} +ln -s %{_mandir}/man1/%{name}.1 %{buildroot}%{_mandir}/man1/mailx.%{name}.1 +touch %{buildroot}%{_mandir}/man1/{Mail,mail,mailx,nail}.1 + %check make test +%pre +# remove alternativized files if they are not symlinks +for f in Mail mail mailx nail; do + [ -L %{_bindir}/$f ] || rm -f %{_bindir}/$f >/dev/null 2>&1 || : + [ -L %{_mandir}/man1/$f.1.gz ] || rm -f %{_mandir}/man1/$f.1.gz >/dev/null 2>&1 || : +done + + +%preun +if [ $1 -eq 0 ]; then + %{_sbindir}/update-alternatives --remove mailx %{_bindir}/mailx.%{name} >/dev/null 2>&1 || : +fi + + +%post +# set up the alternatives files +%{_sbindir}/update-alternatives --install %{_bindir}/mailx mailx %{_bindir}/mailx.%{name} 100 \ + --slave %{_bindir}/Mail Mail %{_bindir}/%{name} \ + --slave %{_bindir}/mail mail %{_bindir}/%{name} \ + --slave %{_bindir}/nail nail %{_bindir}/%{name} \ + --slave %{_mandir}/man1/mailx.1.gz mailx.1.gz %{_mandir}/man1/mailx.%{name}.1.gz \ + --slave %{_mandir}/man1/Mail.1.gz Mail.1.gz %{_mandir}/man1/mailx.%{name}.1.gz \ + --slave %{_mandir}/man1/mail.1.gz mail.1.gz %{_mandir}/man1/mailx.%{name}.1.gz \ + --slave %{_mandir}/man1/nail.1.gz nail.1.gz %{_mandir}/man1/mailx.%{name}.1.gz \ + >/dev/null 2>&1 || : + + +%postun +if [ $1 -ge 1 ]; then + if [ "$(readlink %{_sysconfdir}/alternatives/mailx)" == "%{_bindir}/mailx.%{name}" ]; then + %{_sbindir}/update-alternatives --set mailx %{_bindir}/mailx.%{name} >/dev/null 2>&1 || : + fi +fi + + %files %license COPYING %doc README +%ghost %{_bindir}/{Mail,mail,mailx,nail} +%{_bindir}/mailx.%{name} %{_bindir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}.rc +%ghost %{_mandir}/man1/{Mail,mail,mailx,nail}.1* +%{_mandir}/man1/mailx.%{name}.1* %{_mandir}/man1/%{name}.1* %changelog +* Mon Apr 27 2020 Nikola Forró - 14.9.19-1 +- New upstream release 14.9.19 +- Adjust default configuration to be closer to Heirloom mailx +- Provide alternativized binaries and man pages + resolves: #1827969 + * Thu Apr 23 2020 Nikola Forró - 14.9.18-1 - Update to the latest upstream release diff --git a/sources b/sources index bd53cb1..a0fbea6 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (s-nail-14.9.18.tar.xz) = d1ae090554413a6517c360a7bb1da4f36394361005e3bb20854105e5445b2e63aa9ad9d2649a59cfe06d89727143f0c21e350a7c2d708c1ee0ef8c35e2c06ae9 -SHA512 (s-nail-14.9.18.tar.xz.asc) = fa3920b679b66bb84541e2c422e72c77ada926dc35b1f4b688d9606a11c896d0a87e80d8969dba0e779decb300fc64d4655d314a24454a9daae6f53425965945 +SHA512 (s-nail-14.9.19.tar.xz) = 53c8cf7449afc3e99029ad54ed9c63edefce8ca00cd32dab138c34a7ced7d16852e45e5ad3949b2b8d7baa17421ce38079405781517cdbd3cb67d773bad561f8 +SHA512 (s-nail-14.9.19.tar.xz.asc) = 2c15fb0b0df96a61b22222e4a615b53453400f1c35cc0f8d583707f45ae1fe3c864fd4a5aba64d0651878d6376391845b5d63e8204e3d4d9d28fc2d0693616e9