smartmontools-6.4.ebuild 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit flag-o-matic systemd
  5. if [[ ${PV} == "9999" ]] ; then
  6. ESVN_REPO_URI="https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools"
  7. ESVN_PROJECT="smartmontools"
  8. inherit subversion autotools
  9. else
  10. SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
  11. KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos"
  12. fi
  13. DESCRIPTION="Tools to monitor storage systems to provide advanced warning of disk degradation"
  14. HOMEPAGE="https://www.smartmontools.org"
  15. LICENSE="GPL-2"
  16. SLOT="0"
  17. IUSE="caps minimal selinux static"
  18. DEPEND="
  19. caps? (
  20. static? ( sys-libs/libcap-ng[static-libs] )
  21. !static? ( sys-libs/libcap-ng )
  22. )
  23. selinux? (
  24. sys-libs/libselinux
  25. )"
  26. RDEPEND="${DEPEND}
  27. !minimal? ( virtual/mailx )
  28. selinux? ( sec-policy/selinux-smartmon )
  29. "
  30. src_prepare() {
  31. if [[ ${PV} == "9999" ]] ; then
  32. #./autogen.sh
  33. eautoreconf
  34. fi
  35. }
  36. src_configure() {
  37. use minimal && einfo "Skipping the monitoring daemon for minimal build."
  38. use static && append-ldflags -static
  39. # The build installs /etc/init.d/smartd, but we clobber it
  40. # in our src_install, so no need to manually delete it.
  41. econf \
  42. --docdir="${EPREFIX}/usr/share/doc/${PF}" \
  43. --with-initscriptdir="${EPREFIX}/etc/init.d" \
  44. $(use_with caps libcap-ng) \
  45. $(use_with selinux) \
  46. $(systemd_with_unitdir)
  47. }
  48. src_install() {
  49. if use minimal ; then
  50. dosbin smartctl
  51. doman smartctl.8
  52. else
  53. default
  54. newinitd "${FILESDIR}"/smartd-r1.rc smartd
  55. newconfd "${FILESDIR}"/smartd.confd smartd
  56. fi
  57. }