iscsitarget-1.4.20.2_p20130821.ebuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit linux-mod eutils flag-o-matic
  5. if [ ${PV} == "9999" ] ; then
  6. inherit subversion
  7. ESVN_REPO_URI="https://svn.code.sf.net/p/iscsitarget/code/trunk"
  8. else
  9. SRC_URI="https://dev.gentoo.org/~ryao/dist/${P}.tar.xz"
  10. KEYWORDS="amd64 ~ppc x86"
  11. fi
  12. DESCRIPTION="Open Source iSCSI target with professional features"
  13. HOMEPAGE="http://iscsitarget.sourceforge.net/"
  14. LICENSE="GPL-2"
  15. SLOT="0"
  16. IUSE=""
  17. DEPEND="dev-libs/openssl"
  18. RDEPEND="${DEPEND}"
  19. MODULE_NAMES="iscsi_trgt(misc:${S}/kernel)"
  20. pkg_setup() {
  21. CONFIG_CHECK="CRYPTO_CRC32C"
  22. ERROR_CFG="iscsitarget needs support for CRC32C in your kernel."
  23. kernel_is ge 2 6 14 || die "Linux 2.6.14 or newer required"
  24. [ ${PV} != "9999" ] && \
  25. { kernel_is le 3 11 || die "Linux 3.11 is the latest supported version."; }
  26. linux-mod_pkg_setup
  27. }
  28. src_prepare() {
  29. if [ ${PV} != "9999" ]
  30. then
  31. # Fix build system to apply proper patches
  32. epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-fix-3.2-support.patch"
  33. # Respect LDFLAGS. Bug #365735
  34. epatch "${FILESDIR}/${PN}-1.4.20.2-respect-flags-v2.patch"
  35. # Avoid use of WRITE_SAME_16 in Linux 2.6.32 and earlier
  36. epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch"
  37. fi
  38. # Apply kernel-specific patches
  39. emake KSRC="${KERNEL_DIR}" patch || die
  40. epatch_user
  41. }
  42. src_compile() {
  43. emake KSRC="${KERNEL_DIR}" usr || die
  44. unset ARCH
  45. filter-ldflags -Wl,*
  46. emake KSRC="${KERNEL_DIR}" kernel || die
  47. }
  48. src_install() {
  49. einfo "Installing userspace"
  50. # Install ietd into libexec; we don't need ietd to be in the path
  51. # for ROOT, since it's just a service.
  52. exeinto /usr/libexec
  53. doexe usr/ietd || die
  54. dosbin usr/ietadm || die
  55. insinto /etc
  56. doins etc/ietd.conf etc/initiators.allow || die
  57. # We moved ietd in /usr/libexec, so update the init script accordingly.
  58. sed -e 's:/usr/sbin/ietd:/usr/libexec/ietd:' "${FILESDIR}"/ietd-init.d-2 > "${T}"/ietd-init.d
  59. newinitd "${T}"/ietd-init.d ietd || die
  60. newconfd "${FILESDIR}"/ietd-conf.d ietd || die
  61. # Lock down perms, per bug 198209
  62. fperms 0640 /etc/ietd.conf /etc/initiators.allow
  63. doman doc/manpages/*.[1-9] || die
  64. dodoc ChangeLog README RELEASE_NOTES README.initiators README.mcs README.vmware || die
  65. einfo "Installing kernel module"
  66. unset ARCH
  67. linux-mod_src_install || die
  68. }