diff --git a/sysutils/fusefs-unionfs/Makefile b/sysutils/fusefs-unionfs/Makefile index 7fc8cbe..2ca7545 100644 --- a/sysutils/fusefs-unionfs/Makefile +++ b/sysutils/fusefs-unionfs/Makefile @@ -2,31 +2,34 @@ # $FreeBSD$ PORTNAME= unionfs -PORTVERSION= 0.26 -PORTREVISION= 1 +PORTVERSION= 1.0 +DISTVERSIONPREFIX= v CATEGORIES= sysutils -MASTER_SITES= http://podgorny.cz/unionfs-fuse/releases/ PKGNAMEPREFIX= fusefs- -DISTNAME= unionfs-fuse-${PORTVERSION} -MAINTAINER= ports@FreeBSD.org +MAINTAINER= brendan+freebsd@bbqsrc.net COMMENT= FUSE based implementation of the well-known unionfs LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE -PLIST_FILES= bin/unionfs \ - man/man8/unionfs-fuse.8.gz +USE_GITHUB= yes +GH_ACCOUNT= rpodgorny +GH_PROJECT= unionfs-fuse -USES= fuse cmake tar:xz +PLIST_FILES= bin/unionfs \ + bin/unionfsctl \ + man/man8/unionfs.8.gz -CFLAGS+= -I${LOCALBASE}/include -LDFLAGS+= -L${LOCALBASE}/lib +USES= python:3.2+,test fuse cmake localbase post-patch: @${REINPLACE_CMD} "s,share/man,man,g" ${WRKSRC}/man/CMakeLists.txt +do-test: + @cd ${WRKSRC} && ${PYTHON_CMD} test.py + post-install: - ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} + @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/* .include diff --git a/sysutils/fusefs-unionfs/distinfo b/sysutils/fusefs-unionfs/distinfo index ace19a4..162d328 100644 --- a/sysutils/fusefs-unionfs/distinfo +++ b/sysutils/fusefs-unionfs/distinfo @@ -1,2 +1,2 @@ -SHA256 (unionfs-fuse-0.26.tar.xz) = 8d5c9dcb51ecb9a9b03890e16d17e37d602b0c1f23ed6a9ddec2b0f719c9f662 -SIZE (unionfs-fuse-0.26.tar.xz) = 38600 +SHA256 (rpodgorny-unionfs-fuse-v1.0_GH0.tar.gz) = 2ee80bd0634a61adb2159212e155d607a0a82ad659214ae6edb3530396cccc09 +SIZE (rpodgorny-unionfs-fuse-v1.0_GH0.tar.gz) = 48149 diff --git a/sysutils/fusefs-unionfs/files/patch-CMakeLists.txt b/sysutils/fusefs-unionfs/files/patch-CMakeLists.txt index a61f5a4..107d85a 100644 --- a/sysutils/fusefs-unionfs/files/patch-CMakeLists.txt +++ b/sysutils/fusefs-unionfs/files/patch-CMakeLists.txt @@ -1,6 +1,6 @@ ---- ./CMakeLists.txt.orig 2012-09-11 00:06:32.000000000 +0200 -+++ ./CMakeLists.txt 2013-07-24 16:54:01.550064323 +0200 -@@ -9,12 +9,6 @@ +--- CMakeLists.txt.orig 2015-01-14 10:08:20 UTC ++++ CMakeLists.txt +@@ -9,12 +9,6 @@ IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT SET(CMAKE_BUILD_TYPE RelWithDebInfo) ENDIF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) @@ -10,6 +10,6 @@ -SET(CMAKE_C_FLAGS_RELEASE "-O2") -SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -DDEBUG") - - add_definitions(-D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26) - - option(WITH_XATTR "Enable support for extended attributes" OFF) + if (UNIX AND APPLE) + include_directories("/usr/local/include/osxfuse/fuse") + endif() diff --git a/sysutils/fusefs-unionfs/files/patch-src__unionfs.c b/sysutils/fusefs-unionfs/files/patch-src__unionfs.c index 859351c..af74275 100644 --- a/sysutils/fusefs-unionfs/files/patch-src__unionfs.c +++ b/sysutils/fusefs-unionfs/files/patch-src__unionfs.c @@ -1,6 +1,6 @@ ---- ./src/unionfs.c.orig 2012-09-11 00:06:32.000000000 +0200 -+++ ./src/unionfs.c 2013-07-24 16:54:01.555073796 +0200 -@@ -83,7 +83,11 @@ +--- src/unionfs.c.orig 2015-01-14 10:08:20 UTC ++++ src/unionfs.c +@@ -92,7 +92,11 @@ static int unionfs_chmod(const char *pat char p[PATHLEN_MAX]; if (BUILD_PATH(p, uopt.branches[i].path, path)) RETURN(-ENAMETOOLONG); @@ -12,29 +12,19 @@ if (res == -1) RETURN(-errno); RETURN(0); -@@ -190,7 +194,7 @@ - DBG("%s\n", path); +@@ -287,6 +291,7 @@ static int unionfs_ioctl(const char *pat + return -EINVAL; + return 0; + } ++#ifndef __FreeBSD__ + case UNIONFS_SET_DEBUG_FILE: { + char *debug_path = (char *) data; - if (uopt.stats_enabled && strcmp(path, STATS_FILENAME) == 0) { -- memset(stbuf, 0, sizeof(stbuf)); -+ memset(stbuf, 0, sizeof(*stbuf)); - stbuf->st_mode = S_IFREG | 0444; - stbuf->st_nlink = 1; - stbuf->st_size = STATS_SIZE; -@@ -663,7 +667,16 @@ - char p[PATHLEN_MAX]; - if (BUILD_PATH(p, uopt.branches[i].path, path)) RETURN(-ENAMETOOLONG); - -+#ifdef __FreeBSD__ -+ struct timeval tv[2]; -+ tv[0].tv_sec = ts[0].tv_sec; -+ tv[0].tv_usec = ts[0].tv_nsec / 1000; -+ tv[1].tv_sec = ts[0].tv_sec; -+ tv[1].tv_usec = ts[0].tv_nsec / 1000; -+ int res = lutimes(p, tv); -+#else - int res = utimensat(0, p, ts, AT_SYMLINK_NOFOLLOW); +@@ -295,6 +300,7 @@ static int unionfs_ioctl(const char *pat + debug_init(); + return 0; + } +#endif - - if (res == -1) RETURN(-errno); - + default: + USYSLOG(LOG_ERR, "Unknown ioctl: %d", cmd); + return -EINVAL; diff --git a/sysutils/fusefs-unionfs/files/patch-src__usyslog.c b/sysutils/fusefs-unionfs/files/patch-src__usyslog.c deleted file mode 100644 index 1f62509..0000000 --- a/sysutils/fusefs-unionfs/files/patch-src__usyslog.c +++ /dev/null @@ -1,12 +0,0 @@ ---- ./src/usyslog.c.orig 2012-09-11 00:06:32.000000000 +0200 -+++ ./src/usyslog.c 2013-07-24 16:56:29.401473882 +0200 -@@ -20,7 +20,9 @@ - #include - #include - #include -+#ifndef __FreeBSD__ - #include -+#endif - #include - #include - diff --git a/sysutils/fusefs-unionfs/files/patch-src_usyslog.c b/sysutils/fusefs-unionfs/files/patch-src_usyslog.c new file mode 100644 index 0000000..42f8ec6 --- /dev/null +++ b/sysutils/fusefs-unionfs/files/patch-src_usyslog.c @@ -0,0 +1,11 @@ +--- src/usyslog.c.orig 2015-01-14 10:08:20 UTC ++++ src/usyslog.c +@@ -23,7 +23,7 @@ + + #if __APPLE__ + #include +-#else ++#elif !defined(__FreeBSD__) + #include + #endif + diff --git a/sysutils/fusefs-unionfs/files/patch-test.py b/sysutils/fusefs-unionfs/files/patch-test.py new file mode 100644 index 0000000..170904c --- /dev/null +++ b/sysutils/fusefs-unionfs/files/patch-test.py @@ -0,0 +1,27 @@ +--- test.py.orig 2015-01-14 10:08:20 UTC ++++ test.py +@@ -5,6 +5,7 @@ import subprocess + import os + import shutil + import time ++import sys + + + def call(cmd): +@@ -51,7 +52,7 @@ class Common: + # if it fails for someone, let's find the race and fix it! + #time.sleep(1) + +- call('fusermount -u union') ++ call('umount union') + + for d in self._dirs: + shutil.rmtree(d) +@@ -238,6 +239,7 @@ class IOCTL_TestCase(Common, unittest.Te + call('src/unionfs rw1=rw:ro1=ro union') + #enddef + ++ @unittest.skipUnless(sys.platform.startswith('linux'), "Linux-only ioctl") + def test_debug(self): + # TODO: this is not safe, use some temporary filename or something + if os.path.exists('/tmp/test_debug.log'): diff --git a/sysutils/fusefs-unionfs/pkg-descr b/sysutils/fusefs-unionfs/pkg-descr index 767af71..761c324 100644 --- a/sysutils/fusefs-unionfs/pkg-descr +++ b/sysutils/fusefs-unionfs/pkg-descr @@ -1,6 +1,4 @@ -This is my effort to create a unionfs filesystem implementation which -is probably slower but way more flexible than the current in-kernel -unionfs solution. Currently it's almost fully usable, the only problem -is new file/directory creation which I will fix soon... +This is an effort to create a unionfs filesystem implementation which is way +more flexible than the current in-kernel unionfs solution. -WWW: http://podgorny.cz/moin/UnionFsFuse +WWW: https://github.com/rpodgorny/unionfs-fuse