multipath-tools-0.6.2-r2.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils systemd toolchain-funcs udev
  5. DESCRIPTION="Device mapper target autoconfig"
  6. HOMEPAGE="http://christophe.varoqui.free.fr/"
  7. COMMIT_ID='e165b73a16fc9027aa3306df40052038c175be1b'
  8. SRC_URI="http://git.opensvc.com/?p=multipath-tools/.git;a=snapshot;h=${COMMIT_ID};sf=tgz -> ${P}.tar.gz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
  12. IUSE="systemd"
  13. RDEPEND=">=sys-fs/lvm2-2.02.45
  14. >=virtual/udev-171
  15. dev-libs/libaio
  16. dev-libs/userspace-rcu
  17. sys-libs/readline:*
  18. systemd? ( sys-apps/systemd )"
  19. DEPEND="${RDEPEND}
  20. virtual/pkgconfig"
  21. S="${WORKDIR}/${PN}-${COMMIT_ID:0:7}"
  22. PATCHES=(
  23. "${FILESDIR}"/${PN}-0.6.2-makefile.patch
  24. "${FILESDIR}"/${PN}-0.6.2-ignore-modprobe-failures.patch
  25. )
  26. get_systemd_pv() {
  27. use systemd && \
  28. $(tc-getPKG_CONFIG) --modversion systemd
  29. }
  30. src_compile() {
  31. # LIBDM_API_FLUSH involves grepping files in /usr/include,
  32. # so force the test to go the way we want #411337.
  33. emake \
  34. LIBDM_API_FLUSH=1 CC="$(tc-getCC)" SYSTEMD="$(get_systemd_pv)"
  35. }
  36. src_install() {
  37. local udevdir="$(get_udevdir)"
  38. dodir /sbin /usr/share/man/man{5,8}
  39. emake \
  40. DESTDIR="${D}" \
  41. SYSTEMD=$(get_systemd_pv) \
  42. unitdir="$(systemd_get_systemunitdir)" \
  43. libudevdir='${prefix}'/"${udevdir}" \
  44. install
  45. newinitd "${FILESDIR}"/rc-multipathd multipathd
  46. newinitd "${FILESDIR}"/multipath.rc multipath
  47. dodoc README ChangeLog
  48. }
  49. pkg_postinst() {
  50. if [[ -z ${REPLACING_VERSIONS} ]]; then
  51. elog "If you need multipath on your system, you must"
  52. elog "add 'multipath' into your boot runlevel!"
  53. fi
  54. }