File diffutils.spec of Package diffutils-v33

#
# spec file for package diffutils
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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:           diffutils
Version:        3.3
Release:        0
Summary:        GNU diff Utilities
License:        GFDL-1.2 and GPL-3.0+
Group:          Productivity/Text/Utilities
Url:            https://www.gnu.org/software/diffutils/
Source0:        https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
# http://savannah.gnu.org/project/memberlist-gpgkeys.php?group=diffutils
Patch0:         gnulib-perl522.patch
BuildRequires:  xz
Requires(pre):  %{install_info_prereq}
Requires(preun): %{install_info_prereq}
Provides:       diff = %{version}
Obsoletes:      diff < %{version}
Obsoletes:      diffutils < 999
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The GNU diff utilities find differences between files. diff is used to
make source code patches, for instance.

%prep
%setup -q
# RAX compat: SIGSTKSZ constant for glibc 2.34+
# Fix SIGSTKSZ for glibc 2.34+ (no longer compile-time constant)
sed -i '/#if HAVE_LIBSIGSEGV/,/#endif/{s/SIGSTKSZ/16384/g}' lib/c-stack.c
sed -i 's/#elif HAVE_LIBSIGSEGV.*SIGSTKSZ.*/#elif 0/' lib/c-stack.c
%patch -P 0 -p1


# [V1 Fix] gnulib getcwd-lgpl.c missing stdlib.h (glibc 2.42 compat)
sed -i '1i #include <stdlib.h>' gnulib-tests/getcwd-lgpl.c 2>/dev/null || true

%build
export CFLAGS="%{optflags} -fPIE"
export LDFLAGS="-pie"
%configure
make %{?_smp_mflags} V=1

%check
make %{?_smp_mflags} check

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
gzip -9 %{buildroot}%{_infodir}/%{name}.info

%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README THANKS
%{_bindir}/cmp
%{_bindir}/diff
%{_bindir}/diff3
%{_bindir}/sdiff
%{_infodir}/diffutils.info.*
%{_mandir}/man1/cmp.1%{ext_man}
%{_mandir}/man1/diff.1%{ext_man}
%{_mandir}/man1/diff3.1%{ext_man}
%{_mandir}/man1/sdiff.1%{ext_man}

%changelog
openSUSE Build Service is sponsored by