app-misc/pax-utils: arm64 stable (bug #725010)
[gentoo.git] / sys-fs / lxcfs / lxcfs-3.0.3.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit systemd vcs-snapshot
7 DESCRIPTION="FUSE filesystem for LXC"
8 HOMEPAGE="https://linuxcontainers.org/lxcfs/introduction/"
9 LICENSE="Apache-2.0"
10 SLOT="0"
11
12 if [[ ${PV} == "9999" ]] ; then
13         EGIT_REPO_URI="https://github.com/lxc/lxcfs.git"
14         EGIT_BRANCH="master"
15         inherit git-r3
16         SRC_URI=""
17         KEYWORDS=""
18 else
19         SRC_URI="https://github.com/lxc/lxcfs/archive/${P}.tar.gz"
20         KEYWORDS="amd64"
21 fi
22
23 # Omit all dbus.  Upstream appears to require it because systemd, but
24 # lxcfs makes no direct use of dbus.
25 RDEPEND="
26         dev-libs/glib:2
27         sys-fs/fuse:0
28 "
29 DEPEND="
30         sys-apps/help2man
31         ${RDEPEND}
32 "
33 PATCHES="${FILESDIR}/${PN}-fusermount-path.patch"
34
35 src_prepare() {
36         default
37         ./bootstrap.sh || die "Failed to bootstrap configure files"
38 }
39
40 src_configure() {
41         # Without the localstatedir the filesystem isn't mounted correctly
42         econf --localstatedir=/var
43 }
44
45 # Test suite fails for me
46 # src_test() {
47 #       emake tests
48 #       tests/main.sh || die "Tests failed"
49 # }
50
51 src_install() {
52         default
53         keepdir /var/lib/lxcfs
54         newinitd "${FILESDIR}"/${PN}.initd lxcfs
55         systemd_dounit config/init/systemd/lxcfs.service
56 }
57
58 pkg_preinst() {
59         # In an upgrade situation merging /var/lib/lxcfs (an empty dir)
60         # fails because that is a live mountpoint when the service is
61         # running.  It's unnecessary anyway so skip the action.
62         [[ -d ${ROOT}/var/lib/lxcfs ]] && rm -rf ${D}/var
63 }
64
65 pkg_postinst() {
66         einfo
67         einfo "Starting with version 3.0.0 the cgfs PAM module has moved, and"
68         einfo "will eventually be available in app-emulation/lxc.  See:"
69         einfo "https://brauner.github.io/2018/02/28/lxc-includes-cgroup-pam-module.html"
70         einfo "for more information."
71         einfo
72 }