mawk/mawk.spec
OBS User autobuild e25a29c77c Accepting request 33796 from Base:System
Copy from Base:System/mawk based on submit request 33796 from user gberh

OBS-URL: https://build.opensuse.org/request/show/33796
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mawk?expand=0&rev=1
2010-03-05 11:15:05 +00:00

99 lines
2.9 KiB
RPMSpec

#
# spec file for package mawk (Version 1.3.4)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 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/
#
Name: mawk
Summary: Implementation of New/POSIX AWK
Version: 1.3.4
Release: 1
License: GPLv2
Group: Productivity/Text/Utilities
BuildRequires: update-alternatives
AutoReqProv: on
Requires(post): update-alternatives
Requires(preun): update-alternatives
Source: ftp://invisible-island.net/mawk/mawk-%{version}.tgz
Patch0: mawk-1.3.4-fix-make-check-path-handling.patch
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.
Authors:
--------
Thomas E. Dickey <dickey@invisible-island.net>
Mike Brennan
%prep
%setup -q
%patch0 -p1
%build
# without --enable-warnings several functions will not be marked with gcc's
# noreturn attribute and produce warnings when $RPM_OPT_FLAGS contains -Wall
%configure --enable-warnings
make %{?_smp_mflags}
%install
%make_install
# move to /bin and symlink to /usr/bin
%__mkdir_p $RPM_BUILD_ROOT/bin
%__mv $RPM_BUILD_ROOT/usr/bin/mawk $RPM_BUILD_ROOT/bin
%__ln_s ../../bin/mawk $RPM_BUILD_ROOT/usr/bin/mawk
# create ghost files
touch $RPM_BUILD_ROOT/bin/awk $RPM_BUILD_ROOT/usr/bin/awk \
$RPM_BUILD_ROOT/%{_mandir}/man1/awk.1.gz
%clean
rm -rf $RPM_BUILD_ROOT
%check
make check
%post
/usr/sbin/update-alternatives --install /bin/awk awk /bin/mawk 15 \
--slave /usr/bin/awk usr-bin-awk /bin/mawk \
--slave %{_mandir}/man1/awk.1.gz awk.1.gz %{_mandir}/man1/mawk.1.gz
%preun
if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove awk /bin/mawk
fi
%files
%defattr(-,root,root,-)
%doc CHANGES README ACKNOWLEDGMENT examples/
%doc %{_mandir}/man1/mawk.1*
%if %{suse_version} >= 1120
%ghost /bin/awk
%ghost %{_bindir}/awk
%ghost %{_mandir}/man1/awk.1.gz
%endif
/usr/bin/mawk
/bin/mawk
%changelog