1 Summary: FUSE filesystem for LXC
6 Group: Applications/System
7 Source0: https://linuxcontainers.org/downloads/lxcfs/%{name}-%{version}.tar.gz
8 # Source0-md5: fea9124c9d6d7370e12c4a3f0d405541
9 URL: https://linuxcontainers.org/lxcfs/
10 Patch0: 0001-skip-empty-entries-under-proc-self-cgroup.patch
11 BuildRequires: help2man
12 BuildRequires: libfuse-devel
13 BuildRequires: pam-devel
14 BuildRequires: pkg-config
15 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
17 %define _libexecdir %{_prefix}/lib
20 LXCFS is a simple userspace filesystem designed to work around some
21 current limitations of the Linux kernel.
23 Specifically, it's providing two main things:
24 - A set of files which can be bind-mounted over their /proc originals
25 to provide CGroup-aware values.
26 - A cgroupfs-like tree which is container aware.
28 The code is pretty simple, written in C using libfuse and glib.
30 The main driver for this work was the need to run systemd based
31 containers as a regular unprivileged user while still allowing systemd
32 inside the container to interact with cgroups.
34 Now with the introduction of the cgroup namespace in the Linux kernel,
35 that part is no longer necessary on recent kernels and focus is now on
36 making containers feel more like a real independent system through the
39 %package -n pam-pam_cgfs
40 Summary: CGroup FS pam module
43 %description -n pam-pam_cgfs
44 When a user logs in, this pam module will create cgroups which the
45 user may administer, either for all controllers or for any controllers
46 listed on the command line.
56 %{__make} %{?_smp_mflags}
59 rm -rf $RPM_BUILD_ROOT
61 DESTDIR=$RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT{%{systemdunitdir},%{_libexecdir},%{_includedir}/%{name},%{_localstatedir}/lib/%{name}}
65 cp -p config/init/systemd/*.service $RPM_BUILD_ROOT%{systemdunitdir}
67 # The shared library liblxcfs.so used by lxcfs is not supposed to be used by
68 # any other program. So we follow best practice and install it in
69 # %{_prefix}/lib/lxcfs. Note that lxcfs *expects* liblxcfs.so to be found in
70 # %{_prefix}/lib/lxcfs when it cannot find it in the lib.so path.
71 install -p .libs/liblxcfs.so $RPM_BUILD_ROOT%{_libexecdir}
72 rm $RPM_BUILD_ROOT%{_libdir}/liblxcfs.so*
73 rm $RPM_BUILD_ROOT%{_libdir}/liblxcfs.la
76 rm -rf $RPM_BUILD_ROOT
80 %service_add_pre lxcfs.service
83 %service_add_post lxcfs.service
86 %service_del_preun lxcfs.service
89 %service_del_postun lxcfs.service
93 %defattr(644,root,root,755)
94 %doc AUTHORS ChangeLog README
95 %attr(755,root,root) %{_bindir}/lxcfs
96 %{_mandir}/man1/lxcfs.1*
97 %{systemdunitdir}/lxcfs.service
98 %dir %{_datadir}/%{name}
99 %attr(755,root,root) %{_datadir}/%{name}/lxc.mount.hook
100 %attr(755,root,root) %{_datadir}/%{name}/lxc.reboot.hook
101 %dir %{_localstatedir}/lib/%{name}
103 %{_datadir}/lxc/config/common.conf.d/00-lxcfs.conf
105 # The lxcfs executable requires liblxcfs.so be installed. It calls dlopen() to
106 # dynamically reload the shared library on upgrade. This is important. Do *not*
107 # split into a separate package and do not turn this into a versioned shared
108 # library! (This shared library allows lxcfs to be updated without having to
109 # restart it which is good when you have important system containers running!)
110 %{_libexecdir}/liblxcfs.so
112 %files -n pam-pam_cgfs
113 %defattr(644,root,root,755)
114 /%{_lib}/security/pam_cgfs.so