summaryrefslogtreecommitdiff
path: root/filesystems/sqlfs
diff options
context:
space:
mode:
authorRobert Clausecker <fuz@FreeBSD.org>2024-09-27 12:48:46 +0200
committerRobert Clausecker <fuz@FreeBSD.org>2024-11-06 16:17:35 +0100
commit6e2da9672f79f44048d597f0f61e4646cdeade9d (patch)
treec92e4b3158e3419e8cec38e00227d08dcdaab3e9 /filesystems/sqlfs
parentmath/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/sqlfs')
-rw-r--r--filesystems/sqlfs/Makefile41
-rw-r--r--filesystems/sqlfs/distinfo3
-rw-r--r--filesystems/sqlfs/files/patch-fuse_main.c65
-rw-r--r--filesystems/sqlfs/pkg-descr6
-rw-r--r--filesystems/sqlfs/pkg-message13
5 files changed, 128 insertions, 0 deletions
diff --git a/filesystems/sqlfs/Makefile b/filesystems/sqlfs/Makefile
new file mode 100644
index 000000000000..820783f9370f
--- /dev/null
+++ b/filesystems/sqlfs/Makefile
@@ -0,0 +1,41 @@
+PORTNAME= sqlfs
+PORTVERSION= 1.1
+PORTREVISION= 1
+PORTEPOCH= 1
+CATEGORIES= filesystems
+MASTER_SITES= SAVANNAH/libsqlfs
+PKGNAMEPREFIX= fusefs-
+DISTNAME= lib${PORTNAME}-${PORTVERSION}
+
+MAINTAINER= ports@FreeBSD.org
+COMMENT= SQLite backed FUSE file system
+WWW= https://www.nongnu.org/libsqlfs/
+
+LICENSE= LGPL21+
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+DEPRECATED= Abandoned upstream, superseded by forks
+EXPIRATION_DATE=2024-12-31
+
+USES= fuse sqlite
+
+PORTDOCS= README
+PLIST_FILES= bin/sqlfs
+
+OPTIONS_DEFINE= DOCS
+
+do-build:
+ (cd ${WRKSRC} && ${CC} -DFUSE -DFUSE_USE_VERSION=25 \
+ -D_FILE_OFFSET_BITS=64 -D_REENTRANT ${CFLAGS} \
+ -I. -I${LOCALBASE}/include -L${LOCALBASE}/lib \
+ -lfuse -lsqlite${SQLITE_VER} sqlfs.c fuse_main.c \
+ -o sqlfs)
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/sqlfs ${STAGEDIR}${PREFIX}/bin
+
+do-install-DOCS-on:
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/filesystems/sqlfs/distinfo b/filesystems/sqlfs/distinfo
new file mode 100644
index 000000000000..dea05271c448
--- /dev/null
+++ b/filesystems/sqlfs/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1730905177
+SHA256 (libsqlfs-1.1.tar.gz) = 0ca70ae5f6153186e54931365bb4932a29c96be3e39aa9a981d838b53f3705ff
+SIZE (libsqlfs-1.1.tar.gz) = 329744
diff --git a/filesystems/sqlfs/files/patch-fuse_main.c b/filesystems/sqlfs/files/patch-fuse_main.c
new file mode 100644
index 000000000000..2e9fff3146e2
--- /dev/null
+++ b/filesystems/sqlfs/files/patch-fuse_main.c
@@ -0,0 +1,65 @@
+--- fuse_main.c.orig 2006-10-25 15:28:26 UTC
++++ fuse_main.c
+@@ -17,12 +17,60 @@ Foundation, Inc., 51 Franklin Street, Fi
+
+ *****************************************************************************/
+
++#include <stdlib.h>
++#include <stdio.h>
++#include <sysexits.h>
+ #include "sqlfs.h"
+
++void usage() __dead2;
++
++void usage()
++{
++ fprintf(stderr, "Usage: %s -o dbname [-h] dir\n", getprogname());
++
++ exit(EX_USAGE);
++}
+
+ int main(int argc, char **argv)
+ {
+- sqlfs_init("/tmp/fsdata");
++ char c;
++ int ret;
++ char *dbname = NULL;
++ char *args[2];
++ char *prog = argv[0];
++
++ while ((c = getopt(argc, argv, "o:h")) != -1)
++ switch (c) {
++ case 'o':
++ dbname = strdup(optarg);
++ break;
++ case 'h':
++ /* FALLTHROUGH */
++ default:
++ usage();
++ /* NOTREACHED */
++ }
++ argc -= optind;
++ argv += optind;
++
++ if (dbname == NULL) {
++ dbname = getenv("SQLFS_DBNAME");
++ }
++
++ if (dbname == NULL || argc < 1)
++ usage();
++ /* NOTREACHED */
++
++ ret = sqlfs_init(dbname);
++ if (ret != 0)
++ return ret;
++
++ fprintf(stderr, "init\n");
++
++ args[0] = strdup(getprogname());
++ args[1] = strdup(argv[0]);
+
+- return sqlfs_fuse_main(argc, argv);
++ ret = sqlfs_fuse_main(2, args);
++
++ return ret;
+ }
diff --git a/filesystems/sqlfs/pkg-descr b/filesystems/sqlfs/pkg-descr
new file mode 100644
index 000000000000..378379443d03
--- /dev/null
+++ b/filesystems/sqlfs/pkg-descr
@@ -0,0 +1,6 @@
+The sqlfs filesystem implements a POSIX style file system on top of an SQLite
+database. It allows applications to have access to a full read/write
+file system in a single file, complete with its own file hierarchy and name
+space. This is useful for applications which needs structured storage, such
+as embedding documents within documents, or management of configuration
+data or preferences.
diff --git a/filesystems/sqlfs/pkg-message b/filesystems/sqlfs/pkg-message
new file mode 100644
index 000000000000..7d5fccea8529
--- /dev/null
+++ b/filesystems/sqlfs/pkg-message
@@ -0,0 +1,13 @@
+[
+{ type: install
+ message: <<EOM
+Now sqlfs filesystem is installed.
+You can mount it by issuing
+% sqlfs -o /path/to/sqlite/database /path/to/mountpoint
+
+Alternatively you can supply database name via SQLFS_DBNAME env variable
+
+For additional information see supplied documentation.
+EOM
+}
+]