- Add LXD 3.11 package.

- Update to LXC 3.1.0.
- Update to LXCFS 3.0.3.

- Rework packaging to be a more modern openSUSE-style.

OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxcfs?expand=0&rev=17
This commit is contained in:
Christian Brauner
2019-03-27 17:26:15 +00:00
committed by Git OBS Bridge
parent b07e9a02b4
commit 2edede3c57
6 changed files with 75 additions and 76 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package lxcfs
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,81 +12,70 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: lxcfs
Version: 2.0.8
Version: 3.0.3
Release: 0
Summary: FUSE filesystem for LXC
License: Apache-2.0
Group: System/Management
Url: http://linuxcontainers.org
Url: https://linuxcontainers.org/lxcfs
Source: https://linuxcontainers.org/downloads/%{name}/%{name}-%{version}.tar.gz
Source1: https://linuxcontainers.org/downloads/%{name}/%{name}-%{version}.tar.gz.asc#/%{name}-%{version}.tar.gz.asc
Source1: https://linuxcontainers.org/downloads/%{name}/%{name}-%{version}.tar.gz.asc
Source2: %{name}.keyring
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: help2man
BuildRequires: libtool
BuildRequires: pam-devel
BuildRequires: pkg-config
BuildRequires: systemd
BuildRequires: pkgconfig(fuse)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}
%description
LXCFS is a simple userspace filesystem designed to work around some current limitations of the Linux kernel.
LXCFS is a small FUSE filesystem written with the intention of making Linux
containers feel more like a virtual machine. It started as a side-project of
LXC but is usable by any runtime.
Specifically, it's providing two main things
%package hooks-lxc
Summary: LXC hooks for %{name}
Group: System/Management
Requires: %{name} = %{version}
Supplements: packageand(%{name}:lxc)
BuildArch: noarch
A set of files which can be bind-mounted over their /proc originals
to provide CGroup-aware values.
A cgroupfs-like tree which is container aware.
The code is pretty simple, written in C using libfuse and glib.
The main driver for this work was the need to run systemd based containers as a regular unprivileged user
while still allowing systemd inside the container to interact with cgroups.
Now with the introduction of the cgroup namespace in the Linux kernel, that part is no longer necessary
on recent kernels and focus is now on making containers feel more like a real independent system through
the proc masking feature.
%package -n pam_cgfs
Summary: CGroup FS pam module
Group: System/Libraries
%description -n pam_cgfs
When a user logs in, this pam module will create cgroups which the user may
administer, either for all controllers or for any controllers listed on the
command line.
%description hooks-lxc
Configuration to add hooks for %{name} so that it automatically interoperates
with LXC for all containers.
%prep
%setup
%build
autoreconf --force --install
%configure --with-distro=suse
autoreconf -vif
%configure --with-distro=opensuse
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot} %{?_smp_mflags}
install -d -m 0755 %{buildroot}%{_unitdir}
install -p -m 0644 config/init/systemd/*.service %{buildroot}%{_unitdir}/
install -d -m 0755 %{buildroot}%{_sbindir}
ln -sf service %{buildroot}%{_sbindir}/rc%{name}
install -d -m 0755 %{buildroot}%{_includedir}/%{name}
rm bindings.h
install -d -m 0755 %{buildroot}%{_localstatedir}/lib/%{name}/
# The shared library liblxcfs.so used by lxcfs is not supposed to be used by
# any other program. So we follow best practice and install it in
# /usr/lib/lxcfs. Note that lxcfs *expects* liblxcfs.so to be found in
# /usr/lib/lxcfs when it cannot find it in the lib.so path.
mkdir -p %{buildroot}/usr/lib/%{name}/
install -p -m 0755 .libs/liblxcfs.so %{buildroot}/usr/lib/%{name}/
rm -f %{buildroot}%{_libdir}/liblxcfs.so*
rm -f %{buildroot}%{_libdir}/liblxcfs.la
# any other program. lxcfs will automatically install it to {_libdir}/{name}
# which is out of the way of any other users.
%make_install
install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name}
# systemd service and sysv-init compat wrapper.
install -D -m 0644 config/init/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
mkdir -p %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
# Clean up.
find %{buildroot} -type f -name '*.la' -delete
%fdupes %{buildroot}
%pre
%service_add_pre lxcfs.service
@@ -102,29 +91,27 @@ rm -f %{buildroot}%{_libdir}/liblxcfs.la
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog README
%doc AUTHORS README*
%license COPYING
%{_sbindir}/*
%{_bindir}/*
%{_datadir}/lxc
%{_datadir}/%{name}
%{_mandir}/man1/*
%{_unitdir}/*
%dir %{_localstatedir}/lib/%{name}
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/liblxcfs.la
%{_libdir}/%{name}/liblxcfs.so
# Mountpoint for lxcfs.
%dir %{_sharedstatedir}/%{name}
# The lxcfs executable requires liblxcfs.so be installed. It calls dlopen() to
# dynamically reload the shared library on upgrade. This is important. Do *not*
# split into a separate package and do not turn this into a versioned shared
# library! (This shared library allows lxcfs to be updated without having to
# restart it which is good when you have important system containers running!)
%dir /usr/lib/%{name}
/usr/lib/%{name}/liblxcfs.so
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/liblxcfs.so
%files -n pam_cgfs
%files hooks-lxc
%defattr(-,root,root)
/%{_lib}/security/pam_cgfs.so
%{_datadir}/lxc
%changelog