From 546c8a74e93ba53961de16a46c1ed86520708d37f94b83d2bd785a6cd959ab79 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 1 Oct 2021 19:28:19 +0000 Subject: [PATCH] Accepting request 921253 from home:manfred999:branches:Base:System This is Part 1/2 to remove update-alternatives support from awk. On linux systems, GNU software is usually considered the default implementation. There are a lot of scripts assuming gawk to be the interpreter engine, as for very long time now, gawk is the default interpreter for SUSE/openSUSE. Gawk is POSIX compliant if the env variable POSIXLY_CORRECT is set, and therefore should be able to run run all awk scripts seeking for compatibility. This patch unconditionally makes gawk the default awk implementation by setting a symlink from /usr/bin/gawk to /usr/bin/awk. OBS-URL: https://build.opensuse.org/request/show/921253 OBS-URL: https://build.opensuse.org/package/show/Base:System/gawk?expand=0&rev=84 --- gawk.changes | 7 +++++++ gawk.spec | 46 ++++++++-------------------------------------- 2 files changed, 15 insertions(+), 38 deletions(-) diff --git a/gawk.changes b/gawk.changes index 9d87cc3..54c1fee 100644 --- a/gawk.changes +++ b/gawk.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Sep 23 15:02:47 UTC 2021 - Manfred Schwarb + +- remove update-alternatives support, as on linux systems GNU software + (i.e. gawk in this case) is usually considered the default implementation. +- use %make macros + ------------------------------------------------------------------- Thu Feb 4 10:41:36 UTC 2021 - Ludwig Nussel diff --git a/gawk.spec b/gawk.spec index 0ff4d18..f4adc18 100644 --- a/gawk.spec +++ b/gawk.spec @@ -32,11 +32,6 @@ BuildRequires: automake BuildRequires: libtool BuildRequires: make BuildRequires: makeinfo -BuildRequires: update-alternatives -Requires(post): %{install_info_prereq} -Requires(post): update-alternatives -Requires(preun): %{install_info_prereq} -Requires(preun): update-alternatives Provides: awk %description @@ -52,48 +47,26 @@ almost completely POSIX 1003.2 compliant. %build autoreconf -fiv %configure -make %{?_smp_mflags} +%make_build %check -make check %{?_smp_mflags} +%make_build check %install %make_install %if !0%{?usrmerged} -install -d %{buildroot}/bin -ln -sf %{_bindir}/gawk %{buildroot}/bin -ln -s %{_sysconfdir}/alternatives/awk %{buildroot}/bin/awk +install -d -m 755 %{buildroot}/bin +ln -s %{_bindir}/gawk %{buildroot}/bin/gawk +ln -s %{_bindir}/gawk %{buildroot}/bin/awk %endif -rm -f %{buildroot}%{_bindir}/*-%{version} %{buildroot}%{_bindir}/awk -# create symlinks for update-alternatives -%if !0%{?usrmerged} -ln -s %{_sysconfdir}/alternatives/usr-bin-awk %{buildroot}%{_bindir}/awk -%else -ln -s %{_sysconfdir}/alternatives/awk %{buildroot}%{_bindir}/awk -%endif -ln -s %{_sysconfdir}/alternatives/awk.1%{?ext_man} %{buildroot}%{_mandir}/man1/awk.1%{?ext_man} +# remove versioned gawk and create symlink for awk.1 +rm -fv %{buildroot}%{_bindir}/*-%{version} +ln -sfv %{_mandir}/man1/gawk.1%{?ext_man} %{buildroot}%{_mandir}/man1/awk.1%{?ext_man} %find_lang %{name} -%post -%if !0%{?usrmerged} -%{_sbindir}/update-alternatives \ - --install /bin/awk awk %{_bindir}/gawk 20 \ - --slave %{_bindir}/awk usr-bin-awk %{_bindir}/gawk \ - --slave %{_mandir}/man1/awk.1.gz awk.1%{?ext_man} %{_mandir}/man1/gawk.1%{?ext_man} -%else -%{_sbindir}/update-alternatives \ - --install %{_bindir}/awk awk %{_bindir}/gawk 20 \ - --slave %{_mandir}/man1/awk.1.gz awk.1%{?ext_man} %{_mandir}/man1/gawk.1%{?ext_man} -%endif - -%postun -if [ ! -f %{_bindir}/gawk ]; then - %{_sbindir}/update-alternatives --remove awk %{_bindir}/gawk -fi - %files -f %{name}.lang %config %{_sysconfdir}/profile.d/gawk.csh %config %{_sysconfdir}/profile.d/gawk.sh @@ -101,13 +74,10 @@ fi #UsrMerge /bin/awk /bin/gawk -%ghost %{_sysconfdir}/alternatives/usr-bin-awk #EndUsrMerge %endif %{_bindir}/awk %{_mandir}/man1/awk.1%{?ext_man} -%ghost %{_sysconfdir}/alternatives/awk -%ghost %{_sysconfdir}/alternatives/awk.1%{?ext_man} %license COPYING* %doc AUTHORS NEWS POSIX.STD README ChangeLog* %{_bindir}/gawk