tgt-1.0.68.ebuild 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit flag-o-matic toolchain-funcs
  5. MY_TREE="7c3e84b"
  6. DESCRIPTION="Linux SCSI target framework (tgt)"
  7. HOMEPAGE="http://stgt.sourceforge.net"
  8. SRC_URI="https://github.com/fujita/tgt/tarball/v${PV} -> ${P}.tar.gz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="amd64 ~arm64 x86"
  12. IUSE="fcoe fcp ibmvio infiniband rbd"
  13. CDEPEND="dev-perl/Config-General
  14. dev-libs/libxslt
  15. rbd? ( sys-cluster/ceph )
  16. infiniband? (
  17. sys-fabric/libibverbs:=
  18. sys-fabric/librdmacm:=
  19. )"
  20. DEPEND="${CDEPEND}
  21. app-text/docbook-xsl-stylesheets"
  22. RDEPEND="${DEPEND}
  23. dev-libs/libaio
  24. sys-apps/sg3_utils"
  25. S=${WORKDIR}/fujita-tgt-${MY_TREE}
  26. pkg_setup() {
  27. tc-export CC
  28. }
  29. src_prepare() {
  30. sed -i -e 's:\($(CC)\) $^:\1 $(LDFLAGS) $^:' usr/Makefile || die
  31. # make sure xml docs are generated before trying to install them
  32. sed -i -e "s@install: @& all @g" doc/Makefile || die
  33. }
  34. src_compile() {
  35. local myconf
  36. use ibmvio && myconf="${myconf} IBMVIO=1"
  37. use infiniband && myconf="${myconf} ISCSI_RDMA=1"
  38. use fcp && myconf="${myconf} FCP=1"
  39. use fcoe && myconf="${myconf} FCOE=1"
  40. use rbd && myconf="${myconf} CEPH_RBD=1"
  41. emake -C usr/ KERNELSRC="${KERNEL_DIR}" ISCSI=1 ${myconf}
  42. emake -C doc
  43. }
  44. src_install() {
  45. emake install-programs install-scripts install-doc DESTDIR="${D}" docdir=/usr/share/doc/${PF}
  46. newinitd "${FILESDIR}"/tgtd.initd tgtd
  47. newconfd "${FILESDIR}"/tgtd.confd tgtd
  48. dodir /etc/tgt
  49. keepdir /etc/tgt
  50. }