ceph-0.94.9.ebuild 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. if [[ $PV = *9999* ]]; then
  6. scm_eclass=git-r3
  7. EGIT_REPO_URI="
  8. git://github.com/ceph/ceph.git
  9. https://github.com/ceph/ceph.git"
  10. SRC_URI=""
  11. else
  12. [[ -n ${UPSTREAM_VER} ]] && \
  13. UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
  14. SRC_URI="http://ceph.com/download/${P}.tar.gz
  15. ${UPSTREAM_PATCHSET_URI}"
  16. fi
  17. KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
  18. inherit check-reqs autotools eutils multilib python-single-r1 udev readme.gentoo-r1 systemd ${scm_eclass}
  19. DESCRIPTION="Ceph distributed filesystem"
  20. HOMEPAGE="http://ceph.com/"
  21. LICENSE="LGPL-2.1"
  22. SLOT="0"
  23. IUSE="babeltrace cryptopp debug fuse gtk libatomic +libaio lttng +nss radosgw static-libs jemalloc python tcmalloc xfs zfs"
  24. COMMON_DEPEND="
  25. app-arch/snappy
  26. dev-libs/boost:=[threads]
  27. dev-libs/fcgi
  28. dev-libs/libaio
  29. dev-libs/libedit
  30. dev-libs/leveldb[snappy]
  31. nss? ( dev-libs/nss )
  32. cryptopp? ( dev-libs/crypto++ )
  33. sys-apps/keyutils
  34. sys-apps/util-linux
  35. dev-libs/libxml2
  36. babeltrace? ( dev-util/babeltrace )
  37. fuse? ( sys-fs/fuse )
  38. libatomic? ( dev-libs/libatomic_ops )
  39. xfs? ( sys-fs/xfsprogs )
  40. zfs? ( sys-fs/zfs )
  41. gtk? (
  42. x11-libs/gtk+:2
  43. dev-cpp/gtkmm:2.4
  44. gnome-base/librsvg
  45. )
  46. radosgw? (
  47. dev-libs/fcgi
  48. dev-libs/expat
  49. net-misc/curl
  50. )
  51. jemalloc? ( dev-libs/jemalloc )
  52. !jemalloc? ( dev-util/google-perftools )
  53. lttng? ( dev-util/lttng-ust )
  54. ${PYTHON_DEPS}
  55. "
  56. DEPEND="${COMMON_DEPEND}
  57. virtual/pkgconfig"
  58. RDEPEND="${COMMON_DEPEND}
  59. sys-apps/hdparm
  60. dev-python/flask[${PYTHON_USEDEP}]
  61. dev-python/requests[${PYTHON_USEDEP}]
  62. "
  63. REQUIRED_USE="
  64. ${PYTHON_REQUIRED_USE}
  65. ^^ ( nss cryptopp )
  66. ?? ( jemalloc tcmalloc )
  67. "
  68. STRIP_MASK="/usr/lib*/rados-classes/*"
  69. PATCHES=(
  70. "${FILESDIR}"/${PN}-0.79-libzfs.patch
  71. )
  72. CHECKREQS_DISK_BUILD="1400M"
  73. pkg_setup() {
  74. python_setup
  75. }
  76. src_prepare() {
  77. # Upstream's patchset
  78. if [[ -n ${UPSTREAM_VER} ]]; then
  79. einfo "Try to apply Ceph Upstream patch set"
  80. EPATCH_SUFFIX="patch" \
  81. EPATCH_FORCE="yes" \
  82. EPATCH_OPTS="-p1" \
  83. epatch "${WORKDIR}"/patches-upstream
  84. fi
  85. [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
  86. epatch_user
  87. eautoreconf
  88. }
  89. src_configure() {
  90. local myeconfargs=(
  91. --without-hadoop
  92. --docdir="${EPREFIX}/usr/share/doc/${PF}"
  93. --includedir=/usr/include
  94. $(use_with debug)
  95. $(use_with fuse)
  96. $(use_with libaio)
  97. $(use_with libatomic libatomic-ops)
  98. $(use_with nss)
  99. $(use_with cryptopp)
  100. $(use_with radosgw)
  101. $(use_with gtk gtk2)
  102. $(use_enable static-libs static)
  103. $(use_with jemalloc)
  104. $(use_with xfs libxfs)
  105. $(use_with zfs libzfs)
  106. $(use_with lttng )
  107. $(use_with babeltrace)
  108. --without-kinetic
  109. --without-librocksdb
  110. )
  111. use jemalloc || \
  112. myeconfargs+=( $(usex tcmalloc " --with-tcmalloc" " --with-tcmalloc-minimal") )
  113. PYTHON="${EPYTHON}" \
  114. econf "${myeconfargs[@]}"
  115. }
  116. src_install() {
  117. default
  118. prune_libtool_files --all
  119. exeinto /usr/$(get_libdir)/ceph
  120. newexe src/init-ceph ceph_init.sh
  121. insinto /etc/logrotate.d/
  122. newins "${FILESDIR}"/ceph.logrotate ${PN}
  123. chmod 644 "${ED}"/usr/share/doc/${PF}/sample.*
  124. keepdir /var/lib/${PN}
  125. keepdir /var/lib/${PN}/tmp
  126. keepdir /var/log/${PN}/stat
  127. newinitd "${FILESDIR}/rbdmap.initd" rbdmap
  128. newinitd "${FILESDIR}/${PN}.initd-r1.1" ${PN}
  129. newconfd "${FILESDIR}/${PN}.confd-r1" ${PN}
  130. systemd_dounit "${FILESDIR}/ceph.target"
  131. systemd_newunit "${FILESDIR}/ceph-mds_at.service" "ceph-mds@.service"
  132. systemd_install_serviced "${FILESDIR}/ceph-mds_at.service.conf" "ceph-mds@.service"
  133. systemd_newunit "${FILESDIR}/ceph-osd_at.service" "ceph-osd@.service"
  134. systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" "ceph-osd@.service"
  135. systemd_newunit "${FILESDIR}/ceph-mon_at.service" "ceph-mon@.service"
  136. systemd_install_serviced "${FILESDIR}/ceph-mon_at.service.conf" "ceph-mon@.service"
  137. python_fix_shebang \
  138. "${ED}"/usr/sbin/{ceph-disk,ceph-create-keys} \
  139. "${ED}"/usr/bin/{ceph,ceph-rest-api,ceph-brag}
  140. #install udev rules
  141. udev_dorules udev/50-rbd.rules
  142. udev_dorules udev/95-ceph-osd.rules
  143. readme.gentoo_create_doc
  144. }
  145. pkg_postinst() {
  146. readme.gentoo_print_elog
  147. }