2010-03-05 12:15:05 +01:00
#
2012-01-10 14:51:07 +01:00
# spec file for package mawk
2010-03-05 12:15:05 +01:00
#
2014-02-08 13:35:32 +01:00
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
2010-03-05 12:15:05 +01:00
# Copyright (c) 2010 Guido Berhoerster.
#
# 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 http://bugs.opensuse.org/
#
2012-05-15 10:43:49 +02:00
2010-03-05 12:15:05 +01:00
Name : mawk
Summary : Implementation of New/POSIX AWK
2011-12-06 18:28:28 +01:00
License : GPL-2.0
2010-03-05 12:15:05 +01:00
Group : Productivity/Text/Utilities
2012-01-10 14:51:07 +01:00
Version : 1.3.4
Release : 0
2010-03-05 12:15:05 +01:00
BuildRequires : update-alternatives
Requires(post) : update-alternatives
Requires(preun) : update-alternatives
Source : ftp://invisible-island.net/mawk/mawk-%{version} .tgz
2012-01-10 14:51:07 +01:00
# PATCH-FIX-UPSTREAM mawk-1.3.4-fix-make-check-path-handling.patch gber@opensuse.org -- Modifies makefile and mawktest to use relative paths
2010-03-05 12:15:05 +01:00
Patch0 : mawk-1.3.4-fix-make-check-path-handling.patch
2012-01-10 14:51:07 +01:00
# PATCH-FIX-UPSTREAM mawk-1.3.4-fix-regex-matching.patch bnc#740484 gber@opensuse.org -- Adds limit-check after processing match(test, "[^0-9A-Za-z]") to ensure the internal trailing null of the test-string is not mistaken for part of the string
Patch1 : mawk-1.3.4-fix-regex-matching.patch
2010-03-05 12:15:05 +01:00
Url : http://invisible-island.net/mawk/mawk.html
BuildRoot : %{_tmppath} /%{name} -%{version} -build
%description
mawk is an interpreter for the AWK Programming Language. It implements the AWK
language as defined in Aho, Kernighan and Weinberger, The AWK Programming
Language, Addison-Wesley Publishing, 1988. Furthermore, it conforms to the
POSIX 1003.2 (draft 11.3) definition of the AWK language and additionally
provides a small number of extensions.
%prep
%setup -q
%patch0 -p1
2012-01-10 14:51:07 +01:00
%patch1 -p1
2012-05-15 10:43:49 +02:00
chmod 755 examples/*
2010-03-05 12:15:05 +01:00
%build
# without --enable-warnings several functions will not be marked with gcc's
# noreturn attribute and produce warnings when $RPM_OPT_FLAGS contains -Wall
2012-05-15 10:43:49 +02:00
%configure \
2014-02-08 13:35:32 +01:00
--enable-warnings
2010-03-05 12:15:05 +01:00
make %{?_smp_mflags}
%install
%make_install
2012-05-15 10:43:49 +02:00
2014-02-08 13:35:32 +01:00
# compatibility symlink
install -d -m 755 %{buildroot} /bin
ln -s %{_bindir} /mawk %{buildroot} /bin/mawk
# create symlinks for update-alternatives
install -d -m 755 %{buildroot} %{_sysconfdir} /alternatives
ln -s %{_sysconfdir} /alternatives/awk %{buildroot} /bin/awk
ln -s %{_sysconfdir} /alternatives/usr-bin-awk %{buildroot} %{_bindir} /awk
ln -s %{_sysconfdir} /alternatives/awk.1%{?ext_man} %{buildroot} %{_mandir} /man1/awk.1%{?ext_man}
2010-03-05 12:15:05 +01:00
%check
make check
%post
2014-02-08 13:35:32 +01:00
%{_sbindir} /update-alternatives \
--install /bin/awk awk %{_bindir} /mawk 15 \
--slave %{_bindir} /awk usr-bin-awk %{_bindir} /mawk \
--slave %{_mandir} /man1/awk.1.gz awk.1%{?ext_man} %{_mandir} /man1/mawk.1%{?ext_man}
2010-03-05 12:15:05 +01:00
%preun
if [ $1 -eq 0 ]; then
2014-02-08 13:35:32 +01:00
%{_sbindir} /update-alternatives --remove awk %{_bindir} /mawk
2010-03-05 12:15:05 +01:00
fi
%files
%defattr (-,root,root,-)
2012-05-15 10:43:49 +02:00
%doc ACKNOWLEDGMENT CHANGES COPYING README examples/
2010-03-05 12:15:05 +01:00
/bin/mawk
2014-02-08 13:35:32 +01:00
%{_bindir} /mawk
%{_mandir} /man1/mawk.1%{?ext_man}
/bin/awk
%{_bindir} /awk
%{_mandir} /man1/awk.1%{?ext_man}
%ghost %{_sysconfdir} /alternatives/awk
%ghost %{_sysconfdir} /alternatives/usr-bin-awk
%ghost %{_sysconfdir} /alternatives/awk.1%{?ext_man}
2010-03-05 12:15:05 +01:00
%changelog