sedutil-1.12.ebuild 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit toolchain-funcs
  5. DESCRIPTION="The Drive Trust Alliance Self Encrypting Drive Utility"
  6. HOMEPAGE="https://github.com/Drive-Trust-Alliance/sedutil"
  7. SRC_URI="https://github.com/Drive-Trust-Alliance/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="GPL-3+"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE=""
  12. src_prepare() {
  13. # https://github.com/Drive-Trust-Alliance/sedutil/pull/49
  14. find -name '*.mk' -exec sed -E -i 's: -(Werror|g|O[0-9]?) : :g' {} + || die
  15. # https://github.com/Drive-Trust-Alliance/sedutil/issues/52
  16. if has_version '>=sys-kernel/linux-headers-4.4' ; then
  17. mkdir linux/linux || die
  18. cp "${FILESDIR}"/nvme.h linux/linux/ || die
  19. fi
  20. }
  21. src_configure() {
  22. case $(tc-arch) in
  23. x86) sedutil_arch="Release_i686" ;;
  24. amd64) sedutil_arch="Release_x86_64" ;;
  25. *) die "unsupported architecture" ;;
  26. esac
  27. }
  28. src_compile() {
  29. emake \
  30. -C "linux/CLI" \
  31. V=1 \
  32. CONF="${sedutil_arch}" \
  33. CC="$(tc-getCC)" \
  34. CXX="$(tc-getCXX)" \
  35. CFLAGS="${CFLAGS}" \
  36. CXXFLAGS="${CXXFLAGS}"
  37. }
  38. src_install() {
  39. dobin "linux/CLI/dist/${sedutil_arch}/GNU-Linux/sedutil-cli"
  40. dodoc README.md
  41. }