lxcfs-2.0.4.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit systemd vcs-snapshot versionator
  5. DESCRIPTION="FUSE filesystem for LXC"
  6. HOMEPAGE="https://linuxcontainers.org/lxcfs/introduction/"
  7. LICENSE="Apache-2.0"
  8. SLOT="0"
  9. if [[ ${PV} == "9999" ]] ; then
  10. EGIT_REPO_URI="https://github.com/lxc/lxcfs.git"
  11. EGIT_BRANCH="master"
  12. inherit git-r3
  13. SRC_URI=""
  14. KEYWORDS=""
  15. else
  16. # e.g. upstream is 2.0.0.beta2, we want 2.0.0_beta2
  17. UPSTREAM_PV=$(replace_version_separator 3 '.' )
  18. SRC_URI="https://github.com/lxc/lxcfs/archive/${PN}-${UPSTREAM_PV}.tar.gz -> ${P}.tar.gz"
  19. KEYWORDS="~amd64"
  20. fi
  21. IUSE="pam"
  22. # Omit all dbus. Upstream appears to require it because systemd, but
  23. # lxcfs makes no direct use of dbus.
  24. RDEPEND="
  25. dev-libs/glib:2
  26. sys-fs/fuse
  27. virtual/pam
  28. "
  29. DEPEND="
  30. sys-apps/help2man
  31. ${RDEPEND}
  32. "
  33. PATCHES="${FILESDIR}/${P}-fusermount-path.patch"
  34. src_prepare() {
  35. default
  36. ./bootstrap.sh || die "Failed to bootstrap configure files"
  37. }
  38. src_configure() {
  39. use pam || pamflag="--with-pamdir=none"
  40. # Without the localstatedir the filesystem isn't mounted correctly
  41. econf --localstatedir=/var ${pamflag}
  42. }
  43. # Test suite fails for me
  44. # src_test() {
  45. # emake tests
  46. # tests/main.sh || die "Tests failed"
  47. # }
  48. src_install() {
  49. default
  50. dodir /var/lib/lxcfs
  51. newinitd "${FILESDIR}"/${P}.initd lxcfs
  52. systemd_dounit config/init/systemd/lxcfs.service
  53. }
  54. pkg_preinst() {
  55. # In an upgrade situation merging /var/lib/lxcfs (an empty dir)
  56. # fails because that is a live mountpoint when the service is
  57. # running. It's unnecessary anyway so skip the action.
  58. [[ -d ${ROOT}/var/lib/lxcfs ]] && rm -rf ${D}/var
  59. }