#
# Conditional build:
-%bcond_without tests # do not perform tests
+%bcond_without tests # do not perform tests
#
Summary: A collection of utilities and DSOs to handle compiled objects
Summary(pl): Zestaw narzêdzi i bibliotek do obs³ugi skompilowanych obiektów
Name: elfutils
Version: 0.95
-Release: 1
+Release: 2
License: OSL 1.0 (http://www.opensource.org/licenses/osl.php)
Group: Development/Tools
# http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/SRPMS/
Patch1: %{name}-debian-manpages.patch
Patch2: %{name}-alpha-stat.patch
#URL: file://home/devel/drepper
-BuildRequires: autoconf >= 2.54
+BuildRequires: autoconf >= 2.59
BuildRequires: automake >= 1.7
BuildRequires: gcc >= 3.2
BuildRequires: gettext-devel
+%ifarch alpha amd64 ia64 ppc64 s390x sparc64
+# PR*FAST{8,16} in <inttypes.h> were broken for 64-bit archs in older versions
+# also needed for nanosecond timestamps on alpha
+BuildRequires: glibc-devel >= 6:2.3.4
+%endif
BuildRequires: libltdl-devel
BuildRequires: perl-tools-pod
BuildRequires: sharutils
%setup -q
%patch0 -p1
%patch1 -p1
-# to be removed || updated after switching to glibc 2.3.4
-# (alpha stat64() with nsec fields was added in linux-2.6.4/glibc-2.3.4,
-# I don't know if elfutils knows how to use it)
+# no nanosecond timestamps on sparc64 yet (alpha has them now)
%patch2 -p1
%build
%{__make}
%{__make} -C debian/man
-%{?with_tests:%{__make} -C tests check}
+%if %{with tests}
+# $ORIGIN used in RPATH needs /proc to work - workaround it using LD_LIBRARY_PATH;
+# ../libelf is needed also to use proper libelf by ../src/elflint during tests
+LD_LIBRARY_PATH=../libasm:../libdw:../libebl:../libelf \
+%{__make} -C tests check
+%endif
%install
rm -rf $RPM_BUILD_ROOT