prelink-20130503-r1.ebuild 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit autotools eutils flag-o-matic
  5. DESCRIPTION="Modifies ELFs to avoid runtime symbol resolutions resulting in faster load times"
  6. HOMEPAGE="https://people.redhat.com/jakub/prelink"
  7. SRC_URI="mirror://gentoo/${P}.tar.bz2"
  8. #SRC_URI="https://people.redhat.com/jakub/prelink/${P}.tar.bz2"
  9. # if not available on jakub's dev space extract the distfile with rpm2tarbz2 from
  10. # https://mirrors.kernel.org/fedora/development/rawhide/source/SRPMS/p/prelink-[ver].src.rpm
  11. #
  12. # track http://pkgs.fedoraproject.org/cgit/prelink.git/ for updates
  13. LICENSE="GPL-2"
  14. SLOT="0"
  15. KEYWORDS="~amd64 -arm ~ppc ~ppc64 ~x86"
  16. IUSE="selinux"
  17. DEPEND=">=dev-libs/elfutils-0.100[static-libs(+)]
  18. selinux? ( sys-libs/libselinux[static-libs(+)] )
  19. !dev-libs/libelf
  20. >=sys-libs/glibc-2.8"
  21. RDEPEND="${DEPEND}
  22. >=sys-devel/binutils-2.18"
  23. S=${WORKDIR}/${PN}
  24. src_prepare() {
  25. epatch "${FILESDIR}"/${PN}-20130503-prelink-conf.patch
  26. epatch "${FILESDIR}"/${PN}-20130503-libiberty-md5.patch
  27. epatch "${FILESDIR}"/${PN}-armhf-dynamic-linker.patch
  28. sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die #469126
  29. sed -i -e '/^CC=/s: : -Wl,--disable-new-dtags :' testsuite/functions.sh #100147
  30. # >=binutils-2.22 --no-copy-dt-needed-entries is the default
  31. # --copy-dt-needed-entries was renamed from --add-needed in 2.21, use the
  32. # former so we don't have to bump the dep
  33. sed -i \
  34. -e '/CCLINK=/s:CCLINK="$(CC):& -Wl,--add-needed :' \
  35. -e '/CXXLINK=/s:CXXLINK="$(CXX):& -Wl,--add-needed :' \
  36. testsuite/Makefile.am
  37. has_version 'dev-libs/elfutils[threads]' && append-ldflags -pthread
  38. eautoreconf # prevent maintainer mode
  39. # have to do this after eautoreconf or automake barfs on the trailing
  40. # backslash of the previous line
  41. sed -i -e 's:undosyslibs.sh::' testsuite/Makefile.in #254201
  42. export ac_cv_{header_selinux_selinux_h,lib_selinux_is_selinux_enabled}=$(usex selinux)
  43. }
  44. src_install() {
  45. default
  46. insinto /etc
  47. doins doc/prelink.conf
  48. exeinto /etc/cron.daily
  49. newexe "${FILESDIR}"/prelink.cron prelink
  50. newconfd "${FILESDIR}"/prelink.confd prelink
  51. }
  52. pkg_postinst() {
  53. if [ -z "${REPLACING_VERSIONS}" ] ; then
  54. elog "You may wish to read the Gentoo Linux Prelink Guide, which can be"
  55. elog "found online at:"
  56. elog " https://wiki.gentoo.org/wiki/Prelink"
  57. elog "Please edit /etc/conf.d/prelink to enable and configure prelink"
  58. fi
  59. }