In gmane.os.openbsd.misc, you wrote:
> On Thu, Dec 15, 2016 at 07:24:24AM +0100, Carsten Kunze wrote:
>> So it would really be great to have an up-to-date EncFS...
>
> This might be a good opportunity for you to give ports development a go
> ;-)
>
> http://www.openbsd.org/faq/ports/index.html
>

Possibly not the best beginner task, here's a start at it, but it needs
more work (doesn't build).

? encfs.ii
Index: Makefile
===================================================================
RCS file: /cvs/ports/security/encfs/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile    1 Oct 2016 11:54:17 -0000       1.8
+++ Makefile    15 Dec 2016 12:14:55 -0000
@@ -1,12 +1,17 @@
 # $OpenBSD: Makefile,v 1.8 2016/10/01 11:54:17 naddy Exp $
 
-BROKEN-hppa =  configure: error: Could not link against 
boost_serialization-boost_serialization
+BROKEN-hppa =          configure: error: Could not link against 
boost_serialization-boost_serialization
 BROKEN-sparc64 =       configure: error: Could not link against 
boost_serialization-boost_serialization
+
 COMMENT =              fuse-based cryptographic filesystem
-DISTNAME =             encfs-1.7.4
-REVISION =             1
+
+V =                    1.9.1
+DISTNAME =             encfs-$V
+
 SHARED_LIBS =          encfs   0.0     # 6.1
+
 CATEGORIES =           security
+
 HOMEPAGE =             http://www.arg0.net/encfs
 
 # GPLv3
@@ -15,20 +20,18 @@ PERMIT_PACKAGE_CDROM =      Yes
 WANTLIB =              boost_filesystem boost_serialization boost_system c \
                        crypto fuse m pthread rlog ssl stdc++
 
-MASTER_SITES =         ${MASTER_SITE_GOOGLECODE:=encfs/}
-EXTRACT_SUFX =         .tgz
+MASTER_SITES =         https://github.com/vgough/encfs/releases/download/v$V/
+
+MODULES =              devel/cmake \
+                       gcc4
+MODGCC4_ARCHS =                *
+MODGCC4_LANGS =                c++
 
-MODULES =              devel/gettext
+BUILD_DEPENDS =                devel/gettext-tools
 LIB_DEPENDS =          devel/boost \
+                       devel/gettext \
                        devel/rlog
                        
-CONFIGURE_STYLE =      gnu
-CONFIGURE_ARGS +=      --with-boost-serialization=boost_serialization \
-                       --with-boost-filesystem=boost_filesystem \
-                       --with-boost-system=boost_system
-# TODO convert code to use utimensat() instead of lutimes()
-CONFIGURE_ENV +=       CPPFLAGS="-Dlutimes=utimes -D_DIRENT_HAVE_D_TYPE"
-
 do-test:
        ${WRKSRC}/encfs/test
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/security/encfs/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo    17 Jan 2014 10:10:58 -0000      1.1.1.1
+++ distinfo    15 Dec 2016 12:14:55 -0000
@@ -1,2 +1,2 @@
-SHA256 (encfs-1.7.4.tgz) = KC7w8E8t17o1J7RWIfq0hbfMUQws7uEWYA0DSNwhcKg=
-SIZE (encfs-1.7.4.tgz) = 931048
+SHA256 (encfs-1.9.1.tar.gz) = ZyA67/egbOe+g99JSNspa+iaAM/+EQigpByW10gRBqQ=
+SIZE (encfs-1.9.1.tar.gz) = 455910
Index: patches/patch-encfs_encfs_cpp
===================================================================
RCS file: patches/patch-encfs_encfs_cpp
diff -N patches/patch-encfs_encfs_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-encfs_encfs_cpp       15 Dec 2016 12:14:55 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- encfs/encfs.cpp.orig       Thu Dec 15 11:57:09 2016
++++ encfs/encfs.cpp    Thu Dec 15 11:59:59 2016
+@@ -497,7 +497,7 @@ int encfs_utime(const char *path, struct utimbuf *buf)
+ 
+ int _do_utimens(EncFS_Context *, const string &cyName,
+                 const struct timespec ts[2]) {
+-#ifdef HAVE_UTIMENSAT
++#if 1 /* ifdef HAVE_UTIMENSAT; cmake check fails */
+   int res = utimensat(AT_FDCWD, cyName.c_str(), ts, AT_SYMLINK_NOFOLLOW);
+ #else
+   struct timeval tv[2];
Index: patches/patch-encfs_encfssh
===================================================================
RCS file: patches/patch-encfs_encfssh
diff -N patches/patch-encfs_encfssh
--- patches/patch-encfs_encfssh 9 May 2015 12:18:58 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-encfs_encfssh,v 1.1 2015/05/09 12:18:58 jca Exp $
-
-- no fusermount(1) on OpenBSD, umount(8) is enough
-
---- encfs/encfssh.orig Sun Nov 29 23:04:12 2009
-+++ encfs/encfssh      Thu May  7 19:58:09 2015
-@@ -63,5 +63,5 @@ orig_dir=$(pwd)
- cd $unenc_dir
- 
- # Set the shell up
--exec /bin/sh -c "$SHELL ; cd $orig_dir ; fusermount -u $unenc_dir ; if ! 
$unenc_dir_given; then rmdir $unenc_dir; fi"
-+exec /bin/sh -c "$SHELL ; cd $orig_dir ; umount $unenc_dir ; if ! 
$unenc_dir_given; then rmdir $unenc_dir; fi"
- 
Index: patches/patch-encfs_main_cpp
===================================================================
RCS file: /cvs/ports/security/encfs/patches/patch-encfs_main_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-encfs_main_cpp
--- patches/patch-encfs_main_cpp        9 May 2015 12:18:24 -0000       1.3
+++ patches/patch-encfs_main_cpp        15 Dec 2016 12:14:55 -0000
@@ -1,37 +1,28 @@
 $OpenBSD: patch-encfs_main_cpp,v 1.3 2015/05/09 12:18:24 jca Exp $
---- encfs/main.cpp.orig        Sun Nov 29 23:04:12 2009
-+++ encfs/main.cpp     Thu May  7 19:19:29 2015
-@@ -28,6 +28,8 @@
- #include <cstdio>
- #include <unistd.h>
- #include <sys/time.h>
-+#include <sys/param.h>
-+#include <sys/mount.h>
- #include <cerrno>
- #include <cstring>
- 
-@@ -51,11 +53,6 @@
- 
+--- encfs/main.cpp.orig        Sun Sep 18 21:16:04 2016
++++ encfs/main.cpp     Thu Dec 15 11:49:06 2016
+@@ -43,11 +43,6 @@
+ #include "i18n.h"
  #include "openssl.h"
  
 -// Fuse version >= 26 requires another argument to fuse_unmount, which we
 -// don't have.  So use the backward compatible call instead..
 -extern "C" void fuse_unmount_compat22(const char *mountpoint);
--#    define fuse_unmount fuse_unmount_compat22
+-#define fuse_unmount fuse_unmount_compat22
 -
- #include <locale.h>
- 
- #include "i18n.h"
-@@ -756,7 +753,11 @@ static bool unmountFS(EncFS_Context *ctx)
-       // xgroup(diag)
-       rWarning(_("Unmounting filesystem %s due to inactivity"),
-               arg->mountPoint.c_str());
--      fuse_unmount( arg->mountPoint.c_str() );
-+      if (unmount( arg->mountPoint.c_str(), MNT_FORCE ) != 0)
-+      {
-+          rWarning(_("Unmounting filesystem %s failed: %s"),
-+              arg->mountPoint.c_str(), strerror(errno) );
-+      }
-       return true;
-     }
+ /* Arbitrary identifiers for long options that do
+  * not have a short version */
+ #define LONG_OPT_ANNOTATE 513
+@@ -770,7 +765,11 @@ static bool unmountFS(EncFS_Context *ctx) {
+     // Time to unmount!
+     RLOG(WARNING) << "Unmounting filesystem due to inactivity: "
+                   << arg->opts->mountPoint;
+-    fuse_unmount(arg->opts->mountPoint.c_str());
++    if (unmount( arg->mountPoint.c_str(), MNT_FORCE ) != 0)
++    {
++        rWarning(_("Unmounting filesystem %s failed: %s"),
++            arg->mountPoint.c_str(), strerror(errno) );
++    }
+     return true;
+   }
  }
Index: patches/patch-encfs_openssl_cpp
===================================================================
RCS file: patches/patch-encfs_openssl_cpp
diff -N patches/patch-encfs_openssl_cpp
--- patches/patch-encfs_openssl_cpp     17 Jan 2014 10:10:58 -0000      1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-encfs_openssl_cpp,v 1.1.1.1 2014/01/17 10:10:58 stsp Exp $
---- encfs/openssl.cpp.orig     Sun Nov 29 23:04:12 2009
-+++ encfs/openssl.cpp  Thu Jan 16 14:13:07 2014
-@@ -78,8 +78,10 @@ void openssl_init(bool threaded)
-     SSL_library_init();
- 
-     unsigned int randSeed = 0;
--    RAND_bytes( (unsigned char*)&randSeed, sizeof(randSeed) );
--    srand( randSeed );
-+    if (RAND_bytes( (unsigned char*)&randSeed, sizeof(randSeed)) == 1)
-+      srand( randSeed );
-+    else
-+      srand( arc4random() );
- 
- #ifndef OPENSSL_NO_ENGINE
-     /* Load all bundled ENGINEs into memory and make them visible */
Index: patches/patch-encfs_test_cpp
===================================================================
RCS file: patches/patch-encfs_test_cpp
diff -N patches/patch-encfs_test_cpp
--- patches/patch-encfs_test_cpp        17 Jan 2014 10:10:58 -0000      1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-$OpenBSD: patch-encfs_test_cpp,v 1.1.1.1 2014/01/17 10:10:58 stsp Exp $
---- encfs/test.cpp.orig        Thu Jan 16 14:11:17 2014
-+++ encfs/test.cpp     Thu Jan 16 14:11:44 2014
-@@ -65,7 +65,7 @@ int checkErrorPropogation( const shared_ptr<Cipher> &c
- 
-     for(int i=0; i<size; ++i)
-     {
--      unsigned char tmp = rand();
-+      unsigned char tmp = arc4random();
-       orig.data[i] = tmp;
-       data.data[i] = tmp;
-     }
-@@ -81,7 +81,7 @@ int checkErrorPropogation( const shared_ptr<Cipher> &c
-       unsigned char previousValue = data.data[byteToChange];
-       do
-       {
--          data.data[byteToChange] = rand();
-+          data.data[byteToChange] = arc4random();
-       } while(data.data[byteToChange] == previousValue);
-     }
- 
Index: patches/patch-internal_easylogging++_h
===================================================================
RCS file: patches/patch-internal_easylogging++_h
diff -N patches/patch-internal_easylogging++_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-internal_easylogging++_h      15 Dec 2016 12:14:55 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+--- internal/easylogging++.h.orig      Thu Dec 15 11:54:20 2016
++++ internal/easylogging++.h   Thu Dec 15 11:54:51 2016
+@@ -94,6 +94,11 @@
+ #else
+ #   define ELPP_OS_MAC 0
+ #endif
++#if (defined(__OpenBSD__))
++#   define ELPP_OS_OPENBSD 1
++#else
++#   define ELPP_OS_OPENBSD 0
++#endif
+ #if (defined(__FreeBSD__))
+ #   define ELPP_OS_FREEBSD 1
+ #else
+@@ -105,7 +110,7 @@
+ #   define ELPP_OS_SOLARIS 0
+ #endif
+ // Unix
+-#if ((ELPP_OS_LINUX || ELPP_OS_MAC || ELPP_OS_FREEBSD || ELPP_OS_SOLARIS) && 
(!ELPP_OS_WINDOWS))
++#if ((ELPP_OS_LINUX || ELPP_OS_MAC || ELPP_OS_FREEBSD || ELPP_OS_SOLARIS || 
ELPP_OS_OPENBSD) && (!ELPP_OS_WINDOWS))
+ #   define ELPP_OS_UNIX 1
+ #else
+ #   define ELPP_OS_UNIX 0

Reply via email to