File gawk.spec of Package gawk

# spec file for package gawk
# Copyright (c) 2021 SUSE LLC
# 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.

# Please submit bugfixes or comments via

Name:           gawk
Version:        5.1.0
Release:        0
Summary:        Domain-specific language for text processing
License:        GPL-3.0-or-later
Group:          Productivity/Text/Utilities
Source4:        gawk.rpmlintrc
BuildRequires:  autoconf
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

AWK is a domain-specific language designed for text processing and
typically used as a data extraction and reporting tool.

GNU awk is upwardly compatible with the System V Release 4 awk.  It is
almost completely POSIX 1003.2 compliant.

%autosetup -p1

autoreconf -fiv
make %{?_smp_mflags}

make check %{?_smp_mflags}


%if !0%{?usrmerged}
install -d %{buildroot}/bin
ln -sf %{_bindir}/gawk %{buildroot}/bin
ln -s %{_sysconfdir}/alternatives/awk %{buildroot}/bin/awk
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
ln -s %{_sysconfdir}/alternatives/awk %{buildroot}%{_bindir}/awk
ln -s %{_sysconfdir}/alternatives/awk.1%{?ext_man} %{buildroot}%{_mandir}/man1/awk.1%{?ext_man}

%find_lang %{name}

%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}
%{_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}

if [ ! -f %{_bindir}/gawk ]; then
    %{_sbindir}/update-alternatives --remove awk %{_bindir}/gawk

%files -f %{name}.lang
%config %{_sysconfdir}/profile.d/gawk.csh
%config %{_sysconfdir}/profile.d/
%if !0%{?usrmerged}
%ghost %{_sysconfdir}/alternatives/usr-bin-awk
%ghost %{_sysconfdir}/alternatives/awk
%ghost %{_sysconfdir}/alternatives/awk.1%{?ext_man}
%license COPYING*

openSUSE Build Service is sponsored by