iscsitarget-1.4.19.ebuild 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit linux-mod eutils flag-o-matic
  4. DESCRIPTION="Open Source iSCSI target with professional features"
  5. HOMEPAGE="http://iscsitarget.sourceforge.net/"
  6. SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
  7. LICENSE="GPL-2"
  8. SLOT="0"
  9. KEYWORDS="amd64 ppc x86"
  10. IUSE=""
  11. DEPEND="dev-libs/openssl"
  12. RDEPEND="${DEPEND}"
  13. MODULE_NAMES="iscsi_trgt(misc:${S}/kernel)"
  14. CONFIG_CHECK="CRYPTO_CRC32C"
  15. ERROR_CFG="iscsitarget needs support for CRC32C in your kernel."
  16. src_unpack() {
  17. unpack ${A}
  18. cd "${S}"
  19. epatch "${FILESDIR}"/${PN}-0.4.15-isns-set-scn-flag.patch #180619
  20. epatch "${FILESDIR}"/${PN}-0.4.17-build.patch
  21. epatch "${FILESDIR}"/${PN}-1.4.18+linux-2.6.32.patch
  22. if kernel_is ge 2 6 33; then
  23. epatch "${FILESDIR}"/${PN}-1.4.19+linux-2.6.33.patch
  24. fi
  25. convert_to_m "${S}"/Makefile
  26. }
  27. src_compile() {
  28. emake KSRC="${KERNEL_DIR}" usr || die "failed to build userspace"
  29. unset ARCH
  30. filter-ldflags -Wl,*
  31. emake KSRC="${KERNEL_DIR}" kernel || die "failed to build module"
  32. }
  33. src_install() {
  34. einfo "Installing userspace"
  35. # Install ietd into libexec; we don't need ietd to be in the path
  36. # for ROOT, since it's just a service.
  37. exeinto /usr/libexec
  38. doexe usr/ietd || die "doexe ietd failed"
  39. dosbin usr/ietadm || die "dosbin failed"
  40. insinto /etc
  41. doins etc/ietd.conf etc/initiators.allow || die "doins failed"
  42. # We moved ietd in /usr/libexec, so update the init script accordingly.
  43. sed -e 's:/usr/sbin/ietd:/usr/libexec/ietd:' "${FILESDIR}"/ietd-init.d-2 > "${T}"/ietd-init.d
  44. newinitd "${T}"/ietd-init.d ietd || die "newinitd failed"
  45. newconfd "${FILESDIR}"/ietd-conf.d ietd || die "newconfd failed"
  46. # Lock down perms, per bug 198209
  47. fperms 0640 /etc/ietd.conf /etc/initiators.{allow,deny}
  48. doman doc/manpages/*.[1-9] || die "manpages failed"
  49. dodoc ChangeLog README RELEASE_NOTES README.initiators README.vmware || die "docs failed"
  50. einfo "Installing kernel module"
  51. unset ARCH
  52. linux-mod_src_install || die "modules failed"
  53. }