File prelink.spec of Package prelink

#
# spec file for package prelink (Version 20100106)
#
# Copyright (c) 2010 SUSE LINUX Products 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/
#

# norootforbuild


Name:           prelink
BuildRequires:  gcc-c++ libelf0-devel
Summary:        An ELF Prelinking Utility
Version:        20100106
Release:        1
Group:          System/Base
License:        GPLv2+
Url:            ftp://people.redhat.com/jakub/prelink
PreReq:         %fillup_prereq
Source:         %name-%version.tar.bz2
Source2:        %name.conf
Source3:        SuSEconfig.%name
Source4:        sysconfig.%name
Patch0:         %name-make_it_cool.diff
Patch3:         %name-tests.diff
Patch4:         %name-make-dry-run-verbose.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# It does not work at all on ia64, so let's listen upstream supported
# architectures
ExclusiveArch:  %{ix86} alpha sparc sparc64 s390 s390x x86_64 ppc ppc64

%description
The prelink program is a utility that modifies shared libraries and
executables in the ELF format so that far less relocations need to be
resolved at run time.  This decreases program start-up time.

You can enable prelink support via the YaST sysconfig editor or in
/etc/sysconfig/prelink.

Be aware that prelink modifies all libraries and executables on your
system. Applications which monitor changes in files will no longer
work.



Authors:
--------
    Jakub Jelinek <jakub@redhat.com>

%prep
%setup -q -n prelink
%patch0 -p0
%patch3 -p0
%patch4 -p0

%build
# This package failed when testing with -Wl,-as-needed being default.
# So we disable it here, if you want to retest, just delete this comment and the line below.
export SUSE_ASNEEDED=0
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --mandir=%{_mandir}
make %{?jobs:-j%jobs}
make -C testsuite check-harder

%install
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc
sed -e "s,LIBDIR,%_lib," %{SOURCE2} > $RPM_BUILD_ROOT/etc/prelink.conf
FILLUP_DIR=$RPM_BUILD_ROOT/var/adm/fillup-templates
mkdir -p $FILLUP_DIR $RPM_BUILD_ROOT/sbin/conf.d
install -m 0644 %SOURCE4 $FILLUP_DIR/sysconfig.%name
install -m 0755 %SOURCE3 $RPM_BUILD_ROOT/sbin/conf.d/
install -m 0755 -d $RPM_BUILD_ROOT/var/lib/prelink
mkdir -p $RPM_BUILD_ROOT/etc/rpm
cat > $RPM_BUILD_ROOT/etc/rpm/macros.prelink <<EOF
# rpm-4.1 verifies prelinked libraries using a prelink undo helper.
#       Note: The 2nd token is used as argv[0] and "library" is a
#       placeholder that will be deleted and replaced with the appropriate
#       library file path.
%__prelink_undo_cmd     /usr/sbin/prelink prelink -y library
EOF

%post
%{fillup_only}

%clean
rm -fr $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%dir /var/lib/prelink
%dir /etc/rpm
%config(noreplace) /etc/prelink.conf
%config /etc/rpm/macros.prelink
%_sbindir/prelink
%_bindir/execstack
%_mandir/man8/prelink.8.*
%_mandir/man8/execstack.8.*
/sbin/conf.d/SuSEconfig.%name
/var/adm/fillup-templates/sysconfig.%name

%changelog
openSUSE Build Service is sponsored by