multipath-tools-0.6.4.ebuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit linux-info systemd toolchain-funcs udev vcs-snapshot toolchain-funcs
  5. DESCRIPTION="Device mapper target autoconfig"
  6. HOMEPAGE="http://christophe.varoqui.free.fr/"
  7. SRC_URI="http://git.opensvc.com/?p=multipath-tools/.git;a=snapshot;h=${PV};sf=tgz -> ${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
  11. IUSE="systemd rbd"
  12. RDEPEND=">=sys-fs/lvm2-2.02.45
  13. >=virtual/udev-171
  14. dev-libs/libaio
  15. dev-libs/userspace-rcu
  16. sys-libs/readline:0=
  17. rbd? ( sys-cluster/ceph )
  18. systemd? ( sys-apps/systemd )"
  19. DEPEND="${RDEPEND}
  20. virtual/pkgconfig"
  21. CONFIG_CHECK="~DM_MULTIPATH"
  22. PATCHES=(
  23. # modprobe fails when modules are compiled statically into the kernel
  24. # https://www.redhat.com/archives/dm-devel/2017-January/msg00043.html
  25. "${FILESDIR}"/${PN}-0.6.2-ignore-modprobe-failures.patch
  26. # https://bugs.gentoo.org/show_bug.cgi?id=604228
  27. # https://www.redhat.com/archives/dm-devel/2017-January/msg00022.html
  28. "${FILESDIR}"/${P}-sysmacros.patch
  29. )
  30. get_systemd_pv() {
  31. use systemd && \
  32. $(tc-getPKG_CONFIG) --modversion systemd
  33. }
  34. pkg_pretend() {
  35. linux-info_pkg_setup
  36. }
  37. pkg_setup() {
  38. linux-info_pkg_setup
  39. }
  40. src_prepare() {
  41. default
  42. # The upstream lacks any way to configure the build at present
  43. # and ceph is a huge dependency, so we're using sed to make it
  44. # optional until the upstream has a proer configure system
  45. if ! use rbd ; then
  46. sed -i -e "s/libcheckrbd.so/# libcheckrbd.so/" libmultipath/checkers/Makefile
  47. sed -i -e "s/-lrados//" libmultipath/checkers/Makefile
  48. fi
  49. }
  50. src_compile() {
  51. # LIBDM_API_FLUSH involves grepping files in /usr/include,
  52. # so force the test to go the way we want #411337.
  53. emake \
  54. CC="$(tc-getCC)" \
  55. LIBDM_API_FLUSH=1 SYSTEMD="$(get_systemd_pv)"
  56. }
  57. src_install() {
  58. dodir /sbin /usr/share/man/man{5,8}
  59. emake \
  60. DESTDIR="${D}" \
  61. SYSTEMD=$(get_systemd_pv) \
  62. unitdir="$(systemd_get_systemunitdir)" \
  63. libudevdir='${prefix}'/"$(get_udevdir)" \
  64. install
  65. newinitd "${FILESDIR}"/rc-multipathd multipathd
  66. newinitd "${FILESDIR}"/multipath.rc multipath
  67. einstalldocs
  68. }
  69. pkg_postinst() {
  70. if [[ -z ${REPLACING_VERSIONS} ]]; then
  71. elog "If you need multipath on your system, you must"
  72. elog "add 'multipath' into your boot runlevel!"
  73. fi
  74. }