summaryrefslogtreecommitdiff
path: root/filesystems/sqlfs
diff options
context:
space:
mode:
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
+}
+]