support building on el6

This commit is contained in:
Dave Dykstra 2019-05-04 20:16:54 -05:00
parent eb8e5407a6
commit 7fcfe25ede
2 changed files with 69 additions and 3 deletions

View File

@ -0,0 +1,30 @@
diff --git a/util/mount.fuse.c b/util/mount.fuse.c
index d49e5b2..5c7a8c1 100644
--- a/util/mount.fuse.c
+++ b/util/mount.fuse.c
@@ -23,6 +23,25 @@
#include <sys/syscall.h>
#include <linux/capability.h>
#include <linux/securebits.h>
+/* for 2.6 kernels */
+#if !defined(SECBIT_KEEP_CAPS) && defined(SECURE_KEEP_CAPS)
+#define SECBIT_KEEP_CAPS (issecure_mask(SECURE_KEEP_CAPS))
+#endif
+#if !defined(SECBIT_KEEP_CAPS_LOCKED) && defined(SECURE_KEEP_CAPS_LOCKED)
+#define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED))
+#endif
+#if !defined(SECBIT_NO_SETUID_FIXUP) && defined(SECURE_NO_SETUID_FIXUP)
+#define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP))
+#endif
+#if !defined(SECBIT_NO_SETUID_FIXUP_LOCKED) && defined(SECURE_NO_SETUID_FIXUP_LOCKED)
+#define SECBIT_NO_SETUID_FIXUP_LOCKED (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED))
+#endif
+#if !defined(SECBIT_NOROOT) && defined(SECURE_NOROOT)
+#define SECBIT_NOROOT (issecure_mask(SECURE_NOROOT))
+#endif
+#if !defined(SECBIT_NOROOT_LOCKED) && defined(SECURE_NOROOT_LOCKED)
+#define SECBIT_NOROOT_LOCKED (issecure_mask(SECURE_NOROOT_LOCKED))
+#endif
#endif
#include "fuse.h"

View File

@ -1,6 +1,6 @@
Name: fuse3
Version: 3.4.2
Release: 6%{?dist}
Release: 7%{?dist}
Summary: File System in Userspace (FUSE) v3 utilities
License: GPL+
URL: http://fuse.sf.net
@ -13,15 +13,23 @@ Patch2: fuse3-0002-disable-device-creation-during-build-install.patch
# https://github.com/libfuse/libfuse/pull/392
# backported for fuse-3.4.2
Patch3: fuse3-0003-Whitelist-smb2-392.patch
# https://github.com/libfuse/libfuse/pull/409
Patch4: fuse3-0004-support-el6-kernel.patch
BuildRequires: which
%if ! 0%{?el6}
Conflicts: filesystem < 3
%endif
BuildRequires: libselinux-devel
BuildRequires: meson, ninja-build, gcc
%if ! 0%{?el6} && ! 0%{?el7}
BuildRequires: systemd-udev
%endif
%if 0%{?el6}
BuildRequires: udev, kernel-devel
%else
Requires: %{_sysconfdir}/fuse.conf
%endif
# fuse-common 3.4.2-3 had the fuse & fuse3 man pages in it
Conflicts: fuse-common < 3.4.2-4
@ -33,7 +41,9 @@ mount a FUSE filesystem.
%package libs
Summary: File System in Userspace (FUSE) v3 libraries
License: LGPLv2+
%if ! 0%{?el6}
Conflicts: filesystem < 3
%endif
%description libs
Devel With FUSE it is possible to implement a fully functional filesystem in a
@ -44,7 +54,9 @@ Summary: File System in Userspace (FUSE) v3 devel files
Requires: %{name}-libs = %{version}-%{release}
Requires: pkgconfig
License: LGPLv2+
%if ! 0%{?el6}
Conflicts: filesystem < 3
%endif
%description devel
With FUSE it is possible to implement a fully functional filesystem in a
@ -66,12 +78,28 @@ Common files for FUSE v2 and FUSE v3.
%patch1 -p1 -b .add_parentheses
%patch2 -p1 -b .nodev
%patch3 -p1 -b .smb2_whitelist
%patch4 -p1 -b .el6_compile
%build
export LC_ALL=en_US.UTF-8
%if ! 0%{?_vpath_srcdir:1}
%global _vpath_srcdir .
%endif
%if ! 0%{?_vpath_builddir:1}
%global _vpath_builddir build
%endif
%if 0%{?el6}
%if ! 0%{?__global_ldflags:1}
%global __global_ldflags ""
%endif
%meson -D udevrulesdir=/etc/udev/rules.d -D examples=false
(cd %{_vpath_builddir}
meson configure -D c_args=-I"`ls -d /usr/src/kernels/*/include|head -1`"
ninja-build reconfigure
)
%else
%meson
%endif
%meson_build
%install
@ -87,14 +115,14 @@ rm -f %{buildroot}/%{_libdir}/*.a
rm -f %{buildroot}%{_sysconfdir}/init.d/fuse3
%if 0%{?el6} || 0%{?el7}
# This is in the fuse package here
# This is in the fuse package on el7 and there's no default on el6
rm -f %{buildroot}%{_sysconfdir}/fuse.conf
%else
# Install config-file
install -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}
%endif
# Delete pointless udev rules, which do not belong in /etc (brc#748204)
# Delete pointless udev rules, which do not belong in /usr/lib (brc#748204)
rm -f %{buildroot}/usr/lib/udev/rules.d/99-fuse3.rules
%if 0%{?el6} || 0%{?el7}
@ -104,6 +132,8 @@ rm -f %{buildroot}/usr/lib/udev/rules.d/99-fuse3.rules
%ldconfig_scriptlets libs
%endif
%{!?_licensedir:%global license %%doc}
%files
%license LICENSE GPL2.txt
%doc AUTHORS ChangeLog.rst README.md
@ -111,6 +141,9 @@ rm -f %{buildroot}/usr/lib/udev/rules.d/99-fuse3.rules
%attr(4755,root,root) %{_bindir}/fusermount3
%{_mandir}/man1/*
%{_mandir}/man8/*
%if 0%{?el6}
%{_sysconfdir}/udev/rules.d/*
%endif
%files libs
%license LGPL2.txt
@ -127,6 +160,9 @@ rm -f %{buildroot}/usr/lib/udev/rules.d/99-fuse3.rules
%endif
%changelog
* Sat May 04 2019 Dave Dykstra <dwd@fedoraproject.org> - 3.4.2-7
- Fix building on el6
* Wed May 01 2019 Dave Dykstra <dwd@fedoraproject.org> - 3.4.2-6
- Need Conflicts: fuse-common < 3.4.2-4, because <= 3.4.2-3 isn't quite
enough.