diff options
author | Robert Clausecker <fuz@FreeBSD.org> | 2024-09-27 12:48:46 +0200 |
---|---|---|
committer | Robert Clausecker <fuz@FreeBSD.org> | 2024-11-06 16:17:35 +0100 |
commit | 6e2da9672f79f44048d597f0f61e4646cdeade9d (patch) | |
tree | c92e4b3158e3419e8cec38e00227d08dcdaab3e9 /filesystems/fusefs-libs | |
parent | math/sdpa: speed up build (diff) |
filesystems: add new category for file systems and related utilities
The filesystems category houses file systems and file system utilities.
It is added mainly to turn the sysutils/fusefs-* pseudo-category into
a proper one, but is also useful for the sundry of other file systems
related ports found in the tree.
Ports that seem like they belong there are moved to the new category.
Two ports, sysutils/fusefs-funionfs and sysutils/fusefs-fusepak are
not moved as they currently don't fetch and don't have TIMESTAMP set
in their distinfo, but that is required to be able to push a rename
of the port by the pre-receive hook.
Approved by: portmgr (rene)
Reviewed by: mat
Pull Request: https://github.com/freebsd/freebsd-ports/pull/302
PR: 281988
Diffstat (limited to 'filesystems/fusefs-libs')
-rw-r--r-- | filesystems/fusefs-libs/Makefile | 43 | ||||
-rw-r--r-- | filesystems/fusefs-libs/distinfo | 3 | ||||
-rw-r--r-- | filesystems/fusefs-libs/files/patch-doc_Makefile.am | 11 | ||||
-rw-r--r-- | filesystems/fusefs-libs/files/patch-lib_fuse__versionscript | 53 | ||||
-rw-r--r-- | filesystems/fusefs-libs/files/patch-lib_helper.c | 72 | ||||
-rw-r--r-- | filesystems/fusefs-libs/files/patch-lib_mount__bsd.c | 77 | ||||
-rw-r--r-- | filesystems/fusefs-libs/files/patch-lib_mount__util.c | 23 | ||||
-rw-r--r-- | filesystems/fusefs-libs/files/patch-lib_mount__util.h | 7 | ||||
-rw-r--r-- | filesystems/fusefs-libs/pkg-descr | 3 | ||||
-rw-r--r-- | filesystems/fusefs-libs/pkg-message | 7 | ||||
-rw-r--r-- | filesystems/fusefs-libs/pkg-plist | 20 |
11 files changed, 319 insertions, 0 deletions
diff --git a/filesystems/fusefs-libs/Makefile b/filesystems/fusefs-libs/Makefile new file mode 100644 index 000000000000..49557f4a7c76 --- /dev/null +++ b/filesystems/fusefs-libs/Makefile @@ -0,0 +1,43 @@ +PORTNAME= fusefs +DISTVERSION= 2.9.9 +PORTREVISION= 2 +CATEGORIES= filesystems sysutils +MASTER_SITES= https://github.com/libfuse/libfuse/releases/download/fuse-${DISTVERSION}/ +PKGNAMESUFFIX= -libs +DISTNAME= fuse-${DISTVERSION} + +MAINTAINER= se@FreeBSD.org +COMMENT= FUSE allows filesystem implementation in userspace +WWW= https://github.com/libfuse/libfuse + +LICENSE= LGPL21 +LICENSE_FILE= ${WRKSRC}/COPYING.LIB + +IGNORE_DragonFly= fusefs has not been implemented on DragonFly + +USES= autoreconf gettext-tools iconv libtool +USE_LDCONFIG= yes + +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --with-pkgconfigdir=${PREFIX}/libdata/pkgconfig +CONFIGURE_ENV= MOUNT_FUSE_PATH=${PREFIX}/sbin +INSTALL_TARGET= install-strip + +PORTSCOUT= limit:^2\. + +PLIST_SUB= VERSION=${PORTVERSION} +PORTDOCS= * + +OPTIONS_DEFINE= DOCS + +pre-configure: + ${CP} ${LOCALBASE}/share/gettext/config.rpath ${WRKSRC} + +do-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR}/libs + ${INSTALL_DATA} ${WRKSRC}/doc/how-fuse-works ${WRKSRC}/doc/kernel.txt ${STAGEDIR}${DOCSDIR}/libs + +post-install: + ${INSTALL_DATA} ${WRKSRC}/include/fuse_kernel.h ${STAGEDIR}${PREFIX}/include/fuse + +.include <bsd.port.mk> diff --git a/filesystems/fusefs-libs/distinfo b/filesystems/fusefs-libs/distinfo new file mode 100644 index 000000000000..932ca6834e61 --- /dev/null +++ b/filesystems/fusefs-libs/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1601617112 +SHA256 (fuse-2.9.9.tar.gz) = d0e69d5d608cc22ff4843791ad097f554dd32540ddc9bed7638cc6fea7c1b4b5 +SIZE (fuse-2.9.9.tar.gz) = 1813177 diff --git a/filesystems/fusefs-libs/files/patch-doc_Makefile.am b/filesystems/fusefs-libs/files/patch-doc_Makefile.am new file mode 100644 index 000000000000..d80aa802128e --- /dev/null +++ b/filesystems/fusefs-libs/files/patch-doc_Makefile.am @@ -0,0 +1,11 @@ +--- doc/Makefile.am.orig 2019-07-31 16:36:32 UTC ++++ doc/Makefile.am +@@ -1,5 +1,8 @@ + ## Process this file with automake to produce Makefile.in + ++if BSD ++else + dist_man_MANS = fusermount.1 mount.fuse.8 ulockmgr_server.1 ++endif + + EXTRA_DIST = how-fuse-works kernel.txt Doxyfile html diff --git a/filesystems/fusefs-libs/files/patch-lib_fuse__versionscript b/filesystems/fusefs-libs/files/patch-lib_fuse__versionscript new file mode 100644 index 000000000000..f287af348fce --- /dev/null +++ b/filesystems/fusefs-libs/files/patch-lib_fuse__versionscript @@ -0,0 +1,53 @@ +--- lib/fuse_versionscript.orig 2019-01-04 13:33:33 UTC ++++ lib/fuse_versionscript +@@ -9,15 +9,15 @@ FUSE_2.2 { + fuse_loop_mt; + fuse_loop_mt_proc; + fuse_main; +- fuse_main_compat1; +- fuse_main_compat2; +- fuse_mount_compat1; +- fuse_new_compat1; +- fuse_new_compat2; ++# fuse_main_compat1; ++# fuse_main_compat2; ++# fuse_mount_compat1; ++# fuse_new_compat1; ++# fuse_new_compat2; + fuse_process_cmd; + fuse_read_cmd; + fuse_set_getcontext_func; +- fuse_setup_compat2; ++# fuse_setup_compat2; + }; + + FUSE_2.4 { +@@ -56,10 +56,10 @@ FUSE_2.5 { + + FUSE_2.5 { + global: +- fuse_lowlevel_new_compat; +- fuse_main_real_compat22; +- fuse_mount_compat22; +- fuse_new_compat22; ++# fuse_lowlevel_new_compat; ++# fuse_main_real_compat22; ++# fuse_mount_compat22; ++# fuse_new_compat22; + fuse_opt_parse; + fuse_opt_add_opt; + fuse_opt_add_arg; +@@ -69,10 +69,10 @@ FUSE_2.5 { + fuse_remove_signal_handlers; + fuse_reply_create; + fuse_reply_open; +- fuse_reply_open_compat; ++# fuse_reply_open_compat; + fuse_reply_statfs; +- fuse_reply_statfs_compat; +- fuse_setup_compat22; ++# fuse_reply_statfs_compat; ++# fuse_setup_compat22; + fuse_set_signal_handlers; + } FUSE_2.4; + diff --git a/filesystems/fusefs-libs/files/patch-lib_helper.c b/filesystems/fusefs-libs/files/patch-lib_helper.c new file mode 100644 index 000000000000..a9cb4b6fd1aa --- /dev/null +++ b/filesystems/fusefs-libs/files/patch-lib_helper.c @@ -0,0 +1,72 @@ +--- lib/helper.c.orig 2015-05-22 09:24:02 UTC ++++ lib/helper.c +@@ -31,7 +31,7 @@ enum { + struct helper_opts { + int singlethread; + int foreground; +- int nodefault_subtype; ++ int fsname; + char *mountpoint; + }; + +@@ -42,8 +42,7 @@ static const struct fuse_opt fuse_helper + FUSE_HELPER_OPT("debug", foreground), + FUSE_HELPER_OPT("-f", foreground), + FUSE_HELPER_OPT("-s", singlethread), +- FUSE_HELPER_OPT("fsname=", nodefault_subtype), +- FUSE_HELPER_OPT("subtype=", nodefault_subtype), ++ FUSE_HELPER_OPT("fsname=", fsname), + + FUSE_OPT_KEY("-h", KEY_HELP), + FUSE_OPT_KEY("--help", KEY_HELP), +@@ -53,7 +52,6 @@ static const struct fuse_opt fuse_helper + FUSE_OPT_KEY("-d", FUSE_OPT_KEY_KEEP), + FUSE_OPT_KEY("debug", FUSE_OPT_KEY_KEEP), + FUSE_OPT_KEY("fsname=", FUSE_OPT_KEY_KEEP), +- FUSE_OPT_KEY("subtype=", FUSE_OPT_KEY_KEEP), + FUSE_OPT_END + }; + +@@ -123,24 +121,24 @@ static int fuse_helper_opt_proc(void *da + } + } + +-static int add_default_subtype(const char *progname, struct fuse_args *args) ++static int add_default_fsname(const char *progname, struct fuse_args *args) + { + int res; +- char *subtype_opt; ++ char *fsname_opt; + const char *basename = strrchr(progname, '/'); + if (basename == NULL) + basename = progname; + else if (basename[1] != '\0') + basename++; + +- subtype_opt = (char *) malloc(strlen(basename) + 64); +- if (subtype_opt == NULL) { ++ fsname_opt = (char *) malloc(strlen(basename) + 64); ++ if (fsname_opt == NULL) { + fprintf(stderr, "fuse: memory allocation failed\n"); + return -1; + } +- sprintf(subtype_opt, "-osubtype=%s", basename); +- res = fuse_opt_add_arg(args, subtype_opt); +- free(subtype_opt); ++ sprintf(fsname_opt, "-ofsname=%s", basename); ++ res = fuse_opt_add_arg(args, fsname_opt); ++ free(fsname_opt); + return res; + } + +@@ -156,8 +154,8 @@ int fuse_parse_cmdline(struct fuse_args + if (res == -1) + return -1; + +- if (!hopts.nodefault_subtype) { +- res = add_default_subtype(args->argv[0], args); ++ if (!hopts.fsname) { ++ res = add_default_fsname(args->argv[0], args); + if (res == -1) + goto err; + } diff --git a/filesystems/fusefs-libs/files/patch-lib_mount__bsd.c b/filesystems/fusefs-libs/files/patch-lib_mount__bsd.c new file mode 100644 index 000000000000..765ec8fb8159 --- /dev/null +++ b/filesystems/fusefs-libs/files/patch-lib_mount__bsd.c @@ -0,0 +1,77 @@ +--- lib/mount_bsd.c.orig 2015-05-22 09:24:02 UTC ++++ lib/mount_bsd.c +@@ -10,6 +10,8 @@ + #include "fuse_misc.h" + #include "fuse_opt.h" + ++#include <sys/param.h> ++#include <sys/mount.h> + #include <sys/stat.h> + #include <sys/wait.h> + #include <sys/sysctl.h> +@@ -78,6 +80,7 @@ static const struct fuse_opt fuse_mount_ + FUSE_DUAL_OPT_KEY("ro", KEY_KERN), + FUSE_DUAL_OPT_KEY("rw", KEY_KERN), + FUSE_DUAL_OPT_KEY("auto", KEY_KERN), ++ FUSE_DUAL_OPT_KEY("automounted", KEY_KERN), + /* options supported under both Linux and FBSD */ + FUSE_DUAL_OPT_KEY("allow_other", KEY_KERN), + FUSE_DUAL_OPT_KEY("default_permissions",KEY_KERN), +@@ -192,56 +195,12 @@ void fuse_unmount_compat22(const char *m + free(umount_cmd); + } + +-static void do_unmount(char *dev, int fd) +-{ +- char device_path[SPECNAMELEN + 12]; +- const char *argv[4]; +- const char umount_cmd[] = "/sbin/umount"; +- pid_t pid; +- +- snprintf(device_path, SPECNAMELEN + 12, _PATH_DEV "%s", dev); +- +- argv[0] = umount_cmd; +- argv[1] = "-f"; +- argv[2] = device_path; +- argv[3] = NULL; +- +- pid = fork(); +- +- if (pid == -1) +- return; +- +- if (pid == 0) { +- close(fd); +- execvp(umount_cmd, (char **)argv); +- exit(1); +- } +- +- waitpid(pid, NULL, 0); +-} +- + void fuse_kern_unmount(const char *mountpoint, int fd) + { + char *ep, dev[128]; + struct stat sbuf; + +- (void)mountpoint; +- +- if (fstat(fd, &sbuf) == -1) +- goto out; +- +- devname_r(sbuf.st_rdev, S_IFCHR, dev, 128); +- +- if (strncmp(dev, "fuse", 4)) +- goto out; +- +- strtol(dev + 4, &ep, 10); +- if (*ep != '\0') +- goto out; +- +- do_unmount(dev, fd); +- +-out: ++ unmount(mountpoint, MNT_FORCE); + close(fd); + } + diff --git a/filesystems/fusefs-libs/files/patch-lib_mount__util.c b/filesystems/fusefs-libs/files/patch-lib_mount__util.c new file mode 100644 index 000000000000..1d6a5db2a488 --- /dev/null +++ b/filesystems/fusefs-libs/files/patch-lib_mount__util.c @@ -0,0 +1,23 @@ +--- lib/mount_util.c.orig 2015-05-22 09:24:02 UTC ++++ lib/mount_util.c +@@ -344,20 +344,3 @@ int fuse_mnt_check_empty(const char *pro + } + return 0; + } +- +-int fuse_mnt_check_fuseblk(void) +-{ +- char buf[256]; +- FILE *f = fopen("/proc/filesystems", "r"); +- if (!f) +- return 1; +- +- while (fgets(buf, sizeof(buf), f)) +- if (strstr(buf, "fuseblk\n")) { +- fclose(f); +- return 1; +- } +- +- fclose(f); +- return 0; +-} diff --git a/filesystems/fusefs-libs/files/patch-lib_mount__util.h b/filesystems/fusefs-libs/files/patch-lib_mount__util.h new file mode 100644 index 000000000000..07865d839d77 --- /dev/null +++ b/filesystems/fusefs-libs/files/patch-lib_mount__util.h @@ -0,0 +1,7 @@ +--- lib/mount_util.h.orig 2015-05-22 09:24:02 UTC ++++ lib/mount_util.h +@@ -16,4 +16,3 @@ int fuse_mnt_umount(const char *progname + char *fuse_mnt_resolve_path(const char *progname, const char *orig); + int fuse_mnt_check_empty(const char *progname, const char *mnt, + mode_t rootmode, off_t rootsize); +-int fuse_mnt_check_fuseblk(void); diff --git a/filesystems/fusefs-libs/pkg-descr b/filesystems/fusefs-libs/pkg-descr new file mode 100644 index 000000000000..73b81c35ecd0 --- /dev/null +++ b/filesystems/fusefs-libs/pkg-descr @@ -0,0 +1,3 @@ +FUSE makes it possible to implement a filesystem in a userspace program. +Features include: simple yet comprehensive API, secure mounting by non-root +users, support for FreeBSD kernels, multi-threaded operation. diff --git a/filesystems/fusefs-libs/pkg-message b/filesystems/fusefs-libs/pkg-message new file mode 100644 index 000000000000..3e54fcf60f9c --- /dev/null +++ b/filesystems/fusefs-libs/pkg-message @@ -0,0 +1,7 @@ +[ +{ type: install + message: <<EOM +Install the FUSE kernel module (kldload fusefs) to use this port. +EOM +} +] diff --git a/filesystems/fusefs-libs/pkg-plist b/filesystems/fusefs-libs/pkg-plist new file mode 100644 index 000000000000..b4fd07c97bc6 --- /dev/null +++ b/filesystems/fusefs-libs/pkg-plist @@ -0,0 +1,20 @@ +include/fuse.h +include/fuse/cuse_lowlevel.h +include/fuse/fuse.h +include/fuse/fuse_common.h +include/fuse/fuse_common_compat.h +include/fuse/fuse_compat.h +include/fuse/fuse_kernel.h +include/fuse/fuse_lowlevel.h +include/fuse/fuse_lowlevel_compat.h +include/fuse/fuse_opt.h +include/ulockmgr.h +lib/libfuse.a +lib/libfuse.so +lib/libfuse.so.2 +lib/libfuse.so.%%VERSION%% +lib/libulockmgr.a +lib/libulockmgr.so +lib/libulockmgr.so.1 +lib/libulockmgr.so.1.0.1 +libdata/pkgconfig/fuse.pc |