prelink-20130503.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  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. dodir /var/{lib/misc,log}
  52. touch "${ED}"/var/lib/misc/prelink.{full,quick,force}
  53. touch "${ED}"/var/log/prelink.log
  54. }
  55. pkg_postinst() {
  56. if [ -z "${REPLACING_VERSIONS}" ] ; then
  57. elog "You may wish to read the Gentoo Linux Prelink Guide, which can be"
  58. elog "found online at:"
  59. elog " https://wiki.gentoo.org/wiki/Prelink"
  60. elog "Please edit /etc/conf.d/prelink to enable and configure prelink"
  61. fi
  62. touch "${EROOT}/var/lib/misc/prelink.force"
  63. }