]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
config: Adds RPM spec file.
authortomponline <tomp@tomp.uk>
Wed, 6 Feb 2019 19:51:22 +0000 (19:51 +0000)
committertomponline <tomp@tomp.uk>
Wed, 6 Feb 2019 19:51:22 +0000 (19:51 +0000)
On RHEL 7 distros the RPM spec file will run the lxc.mount.hook with the --skip-cgroup-mounts option.

Signed-off-by: tomponline <tomp@tomp.uk>
.gitignore
Makefile.am
configure.ac
lxcfs.spec.in [new file with mode: 0644]

index 010f53ad0a276f6492ca29205691c4f13b8237d4..95b724ce3ace67ed36394237fe38509390034685 100644 (file)
@@ -21,6 +21,7 @@ m4/
 missing
 stamp-h1
 lxcfs.1
+lxcfs.spec
 share/00-lxcfs.conf
 share/lxc.mount.hook
 share/lxc.reboot.hook
index 57631c1d8ec198d34f6e90ced91fcd9a925a83b7..e3060efeae5c44483d917df76b127600e9db8700 100644 (file)
@@ -33,6 +33,7 @@ bin_PROGRAMS = lxcfs
 
 EXTRA_DIST = \
        lxcfs.man.add
+       lxcfs.spec
 
 if HAVE_HELP2MAN
 man_MANS = lxcfs.1
index 7f4d5a06ba4eecd5828c01335a27c9027b972b56..58d5567b9183c5a8c71636c6812a9d311906d152 100644 (file)
@@ -11,6 +11,7 @@ AC_GNU_SOURCE
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([
        Makefile
+       lxcfs.spec
        config/Makefile
        config/init/Makefile
        config/init/systemd/Makefile
diff --git a/lxcfs.spec.in b/lxcfs.spec.in
new file mode 100644 (file)
index 0000000..a96f36a
--- /dev/null
@@ -0,0 +1,77 @@
+# Set with_systemd on distros that use it, so we can install the service
+# file, otherwise the sysvinit script will be installed
+%if 0%{?fedora} >= 14 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
+%global with_systemd 1
+%define init_script systemd
+#
+# BuildRequires systemd-units on fedora and rhel
+%if 0%{?fedora} >= 14 || 0%{?rhel} >= 7
+BuildRequires: systemd-units
+%endif
+#
+# BuildRequires systemd on openSUSE and SUSE
+%if 0%{?suse_version} >= 1210
+BuildRequires: systemd
+%endif
+%else
+%global with_systemd 0
+%define init_script sysvinit
+%endif
+
+Summary: Linux Containers File System
+Name: @PACKAGE@
+Version: @PACKAGE_VERSION@
+Release: 1%{?dist}
+URL: https://linuxcontainers.org/lxcfs/downloads/
+Source0: %{name}-%{version}.tar.gz
+License: Apache 2.0
+Group: System Environment/Libraries
+BuildRoot: %{_tmppath}/%{name}-root
+
+BuildRequires: gcc
+BuildRequires: libtool
+BuildRequires: docbook2X
+BuildRequires: doxygen
+BuildRequires: fuse-devel
+Requires: fuse-libs
+
+%description
+LXCFS is a simple userspace filesystem designed to work around some current limitations of the Linux kernel.
+
+%prep
+%setup -q
+
+%build
+%configure \
+       --with-init-script=%{init_script}
+%{make_build}
+
+#Modify mount hook command if running on RHEL 7 to skip cgroup mounts for stability reasons.
+%if 0%{?rhel} == 7
+sed -i 's/\/lxc.mount.hook/\/lxc.mount.hook --skip-cgroup-mounts/g' share/00-lxcfs.conf
+%endif
+
+%install
+[ %{buildroot} != "/" ] && rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
+mkdir -p %{buildroot}/%{_sharedstatedir}/%{name}
+
+%clean
+[ %{buildroot} != "/" ] && rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%dir %{_sharedstatedir}/%{name}
+%if %{with_systemd}
+/lib/systemd/system/%{name}.service
+%endif
+%{_bindir}/%{name}
+%config(noreplace) %{_datarootdir}/lxc/config/common.conf.d/00-%{name}.conf
+%{_datarootdir}/%{name}/lxc.mount.hook
+%{_datarootdir}/%{name}/lxc.reboot.hook
+%{_libdir}/%{name}/liblxcfs.la
+%{_libdir}/%{name}/liblxcfs.so
+
+%changelog
+* Wed Jan 30 2019 Tom Parrott <tomp@tomp.uk> - 3.1.0
+- Initial RPM release.