| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-devel/prelink/prelink-20120628.ebuild,v 1.1 2012/08/18 06:47:48 dirtyepic Exp $
|
| 4 |
|
| 5 |
EAPI="4"
|
| 6 |
|
| 7 |
inherit autotools eutils flag-o-matic
|
| 8 |
|
| 9 |
DESCRIPTION="Modifies ELFs to avoid runtime symbol resolutions resulting in faster load times"
|
| 10 |
HOMEPAGE="http://people.redhat.com/jakub/prelink"
|
| 11 |
|
| 12 |
SRC_URI="mirror://gentoo/${P}.tar.bz2"
|
| 13 |
#SRC_URI="http://people.redhat.com/jakub/prelink/${P}.tar.bz2"
|
| 14 |
|
| 15 |
# if not available on jakub's dev space extract the distfile with rpm2tarbz2 from
|
| 16 |
# http://mirrors.kernel.org/fedora/development/rawhide/source/SRPMS/prelink-[ver].src.rpm
|
| 17 |
#
|
| 18 |
# track http://pkgs.fedoraproject.org/cgit/prelink.git/ for updates
|
| 19 |
|
| 20 |
LICENSE="GPL-2"
|
| 21 |
SLOT="0"
|
| 22 |
KEYWORDS="~amd64 -arm ~ppc ~ppc64 ~x86"
|
| 23 |
IUSE="selinux"
|
| 24 |
|
| 25 |
DEPEND=">=dev-libs/elfutils-0.100[static-libs(+)]
|
| 26 |
selinux? ( sys-libs/libselinux[static-libs(+)] )
|
| 27 |
!dev-libs/libelf
|
| 28 |
>=sys-libs/glibc-2.8"
|
| 29 |
RDEPEND="${DEPEND}
|
| 30 |
>=sys-devel/binutils-2.18"
|
| 31 |
|
| 32 |
S=${WORKDIR}/${PN}
|
| 33 |
|
| 34 |
src_prepare() {
|
| 35 |
epatch "${FILESDIR}"/${PN}-20061201-prelink-conf.patch
|
| 36 |
|
| 37 |
sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die #469126
|
| 38 |
|
| 39 |
sed -i -e '/^CC=/s: : -Wl,--disable-new-dtags :' testsuite/functions.sh #100147
|
| 40 |
# >=binutils-2.22 --no-copy-dt-needed-entries is the default
|
| 41 |
# --copy-dt-needed-entries was renamed from --add-needed in 2.21, use the
|
| 42 |
# former so we don't have to bump the dep
|
| 43 |
sed -i \
|
| 44 |
-e '/CCLINK=/s:\(CCLINK="$(CC)\):\1 -Wl,--add-needed :' \
|
| 45 |
-e '/CXXLINK=/s:\(CXXLINK="$(CXX)\):\1 -Wl,--add-needed :' \
|
| 46 |
testsuite/Makefile.am
|
| 47 |
|
| 48 |
# older GCCs don't support this flag
|
| 49 |
sed -i -e 's:-Wno-pointer-sign::' src/Makefile.am #325269
|
| 50 |
append-cflags -Wno-pointer-sign
|
| 51 |
strip-unsupported-flags
|
| 52 |
|
| 53 |
has_version 'dev-libs/elfutils[threads]' && append-ldflags -pthread
|
| 54 |
|
| 55 |
eautoreconf # prevent maintainer mode
|
| 56 |
|
| 57 |
# have to do this after eautoreconf or automake barfs on the trailing
|
| 58 |
# backslash of the previous line
|
| 59 |
sed -i -e 's:undosyslibs.sh::' testsuite/Makefile.in # 254201
|
| 60 |
|
| 61 |
export ac_cv_{header_selinux_selinux_h,lib_selinux_is_selinux_enabled}=$(usex selinux)
|
| 62 |
}
|
| 63 |
|
| 64 |
src_install() {
|
| 65 |
default
|
| 66 |
|
| 67 |
insinto /etc
|
| 68 |
doins doc/prelink.conf
|
| 69 |
|
| 70 |
exeinto /etc/cron.daily
|
| 71 |
newexe "${FILESDIR}"/prelink.cron prelink
|
| 72 |
newconfd "${FILESDIR}"/prelink.confd prelink
|
| 73 |
|
| 74 |
dodir /var/{lib/misc,log}
|
| 75 |
touch "${D}/var/lib/misc/prelink.full"
|
| 76 |
touch "${D}/var/lib/misc/prelink.quick"
|
| 77 |
touch "${D}/var/lib/misc/prelink.force"
|
| 78 |
touch "${D}/var/log/prelink.log"
|
| 79 |
}
|
| 80 |
|
| 81 |
pkg_postinst() {
|
| 82 |
echo
|
| 83 |
elog "You may wish to read the Gentoo Linux Prelink Guide, which can be"
|
| 84 |
elog "found online at:"
|
| 85 |
elog
|
| 86 |
elog " http://www.gentoo.org/doc/en/prelink-howto.xml"
|
| 87 |
elog
|
| 88 |
elog "Please edit /etc/conf.d/prelink to enable and configure prelink"
|
| 89 |
echo
|
| 90 |
touch "${ROOT}/var/lib/misc/prelink.force"
|
| 91 |
}
|