From owner-svn-ports-head@freebsd.org Sun Mar 17 13:29:00 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2F5B153A744; Sun, 17 Mar 2019 13:28:59 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 775CB77E02; Sun, 17 Mar 2019 13:28:59 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 520CBA713; Sun, 17 Mar 2019 13:28:59 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2HDSxT1072582; Sun, 17 Mar 2019 13:28:59 GMT (envelope-from pi@FreeBSD.org) Received: (from pi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2HDSvxp072573; Sun, 17 Mar 2019 13:28:57 GMT (envelope-from pi@FreeBSD.org) Message-Id: <201903171328.x2HDSvxp072573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pi set sender to pi@FreeBSD.org using -f From: Kurt Jaeger Date: Sun, 17 Mar 2019 13:28:57 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r496060 - in head/net: . onedrive onedrive/files X-SVN-Group: ports-head X-SVN-Commit-Author: pi X-SVN-Commit-Paths: in head/net: . onedrive onedrive/files X-SVN-Commit-Revision: 496060 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 775CB77E02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Mar 2019 13:29:00 -0000 Author: pi Date: Sun Mar 17 13:28:57 2019 New Revision: 496060 URL: https://svnweb.freebsd.org/changeset/ports/496060 Log: New port: net/onedrive: Microsoft OneDrive client A complete tool to interact with OneDrive on Linux. Built following the UNIX philosophy. Features: State caching Real-Time file monitoring with Inotify Resumable uploads Support OneDrive for Business (part of Office 365) Shared folders (not Business) What's missing: While local changes are uploaded right away, remote changes are delayed No GUI WWW: https://github.com/skilion/onedrive PR: 236573 Submitted by: Hiroo Ono Added: head/net/onedrive/ head/net/onedrive/Makefile (contents, props changed) head/net/onedrive/distinfo (contents, props changed) head/net/onedrive/files/ head/net/onedrive/files/freebsd_inotify.d (contents, props changed) head/net/onedrive/files/patch-Makefile (contents, props changed) head/net/onedrive/files/patch-src_monitor.d (contents, props changed) head/net/onedrive/files/version (contents, props changed) head/net/onedrive/pkg-descr (contents, props changed) head/net/onedrive/pkg-plist (contents, props changed) Modified: head/net/Makefile Modified: head/net/Makefile ============================================================================== --- head/net/Makefile Sun Mar 17 13:14:52 2019 (r496059) +++ head/net/Makefile Sun Mar 17 13:28:57 2019 (r496060) @@ -545,6 +545,7 @@ SUBDIR += ocserv SUBDIR += olsrd SUBDIR += omnitty + SUBDIR += onedrive SUBDIR += onenetd SUBDIR += onioncat SUBDIR += opal Added: head/net/onedrive/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/onedrive/Makefile Sun Mar 17 13:28:57 2019 (r496060) @@ -0,0 +1,45 @@ +# $FreeBSD$ + +PORTNAME= onedrive +DISTVERSIONPREFIX= v +DISTVERSION= 1.1.3 +CATEGORIES= net + +MAINTAINER= hiroo.ono+freebsd@gmail.com +COMMENT= Microsoft OneDrive client + +LICENSE= GPLv3 + +BUILD_DEPENDS= ldmd2:lang/ldc +LIB_DEPENDS= libcurl.so:ftp/curl \ + libinotify.so:devel/libinotify + +USES= sqlite +USE_GITHUB= yes +GH_ACCOUNT= skilion + +OPTIONS_DEFAULT= LDC +OPTIONS_SINGLE= DLANG +OPTIONS_SINGLE_DLANG= DMD1 DMD2 LDC + +DMD1_DESC= Use lang/dmd1 as D compiler +DMD2_DESC= Use lang/dmd2 as D compiler +LDC_DESC= Use lang/ldc as D compiler + +DMD1_MAKE_ARGS= DC=dmd1 +DMD2_MAKE_ARGS= DC=dmd +LDC_MAKE_ARGS= DC=ldmd2 + +.include + +post-extract: + ${CP} ${FILESDIR}/freebsd_inotify.d ${WRKSRC}/src + ${CP} ${FILESDIR}/version ${WRKSRC} + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/onedrive ${STAGEDIR}${PREFIX}/bin + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/config ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} + +.include Added: head/net/onedrive/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/onedrive/distinfo Sun Mar 17 13:28:57 2019 (r496060) @@ -0,0 +1,3 @@ +TIMESTAMP = 1552643961 +SHA256 (skilion-onedrive-v1.1.3_GH0.tar.gz) = fb12235a73919b3374b8f27785b834a690fba1c6e70c6e6f1f5da3e51eb471a0 +SIZE (skilion-onedrive-v1.1.3_GH0.tar.gz) = 35281 Added: head/net/onedrive/files/freebsd_inotify.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/onedrive/files/freebsd_inotify.d Sun Mar 17 13:28:57 2019 (r496060) @@ -0,0 +1,67 @@ +/** + * D header file for libinotify (incomplete) + */ + +module freebsd_inotify; + +import core.stdc.stdint; + +struct inotify_event +{ + int wd; /* Watch descriptor. */ + uint32_t mask; /* Watch mask. */ + uint32_t cookie; /* Cookie to synchronize two events. */ + uint32_t len; /* Length (including NULLs) of name. */ + char[] name; /* Name. */ +}; + + +/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. */ +enum IN_ACCESS = 0x00000001; /* File was accessed. */ +enum IN_MODIFY = 0x00000002; /* File was modified. */ +enum IN_ATTRIB = 0x00000004; /* Metadata changed. */ +enum IN_CLOSE_WRITE = 0x00000008; /* Writtable file was closed. */ +enum IN_CLOSE_NOWRITE = 0x00000010; /* Unwrittable file closed. */ +enum IN_CLOSE = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE); /* Close. */ +enum IN_OPEN = 0x00000020; /* File was opened. */ +enum IN_MOVED_FROM = 0x00000040; /* File was moved from X. */ +enum IN_MOVED_TO = 0x00000080; /* File was moved to Y. */ +enum IN_MOVE = (IN_MOVED_FROM | IN_MOVED_TO); /* Moves. */ +enum IN_CREATE = 0x00000100; /* Subfile was created. */ +enum IN_DELETE = 0x00000200; /* Subfile was deleted. */ +enum IN_DELETE_SELF = 0x00000400; /* Self was deleted. */ +enum IN_MOVE_SELF = 0x00000800; /* Self was moved. */ + +/* Additional events and flags. Some of these flags are unsupported, + but still should be present */ +enum IN_UNMOUNT = 0x00002000; /* Backing fs was unmounted. */ +enum IN_Q_OVERFLOW = 0x00004000; /* Event queued overflowed. */ +enum IN_IGNORED = 0x00008000; /* File was ignored. */ + +enum IN_ONLYDIR = 0x01000000; /* Only watch the path if it is a + directory. */ +enum IN_DONT_FOLLOW = 0x02000000; /* Do not follow a sym link. */ +enum IN_EXCL_UNLINK = 0x04000000; /* Exclude events on unlinked + objects. */ +enum IN_MASK_ADD = 0x20000000; /* Add to the mask of an already + existing watch. */ +enum IN_ISDIR = 0x40000000; /* Event occurred against dir. */ +enum IN_ONESHOT = 0x80000000; /* Only send event once. */ + + +/* Create and initialize inotify-kqueue instance. */ +extern (C) int inotify_init (); + +/* Create and initialize inotify-kqueue instance. */ +extern (C) int inotify_init1 (int flags); + +/* Add watch of object NAME to inotify-kqueue instance FD. Notify about + events specified by MASK. */ +extern (C) int inotify_add_watch (int fd, const char *name, uint32_t mask); + +/* Remove the watch specified by WD from the inotify instance FD. */ +extern (C) int inotify_rm_watch (int fd, int wd); + +/* Libinotify specific. Set inotify instance parameter. */ +extern (C) int inotify_set_param (int fd, int param, intptr_t value); + Added: head/net/onedrive/files/patch-Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/onedrive/files/patch-Makefile Sun Mar 17 13:28:57 2019 (r496060) @@ -0,0 +1,43 @@ +--- Makefile.orig 2018-09-09 20:14:01 UTC ++++ Makefile +@@ -1,5 +1,5 @@ + DC = dmd +-DFLAGS = -g -ofonedrive -O -L-lcurl -L-lsqlite3 -L-ldl -J. ++DFLAGS = -g -ofonedrive -O -L-lcurl -L-lsqlite3 -L-ldl -L-linotify -J. + PREFIX = /usr/local + + SOURCES = \ +@@ -14,26 +14,19 @@ SOURCES = \ + src/sqlite.d \ + src/sync.d \ + src/upload.d \ +- src/util.d ++ src/util.d \ ++ src/freebsd_inotify.d + +-all: onedrive onedrive.service ++all: onedrive + + clean: +- rm -f onedrive onedrive.o onedrive.service ++ rm -f onedrive onedrive.o + +-install: all +- install -D onedrive $(DESTDIR)$(PREFIX)/bin/onedrive +- install -D -m 644 onedrive.service $(DESTDIR)/usr/lib/systemd/user/onedrive.service ++# install: all ++# install -D onedrive $(DESTDIR)$(PREFIX)/bin/onedrive + + onedrive: version $(SOURCES) + $(DC) $(DFLAGS) $(SOURCES) + +-onedrive.service: +- sed "s|@PREFIX@|$(PREFIX)|g" onedrive.service.in > onedrive.service +- + uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/onedrive +- rm -f $(DESTDIR)/usr/lib/systemd/user/onedrive.service +- +-version: .git/HEAD .git/index +- echo $(shell git describe --tags) >version +\ No newline at end of file Added: head/net/onedrive/files/patch-src_monitor.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/onedrive/files/patch-src_monitor.d Sun Mar 17 13:28:57 2019 (r496060) @@ -0,0 +1,15 @@ +--- src/monitor.d.orig 2019-03-16 11:55:35 UTC ++++ src/monitor.d +@@ -1,10 +1,11 @@ +-import core.sys.linux.sys.inotify; ++// import core.sys.linux.sys.inotify; + import core.stdc.errno; + import core.sys.posix.poll, core.sys.posix.unistd; + import std.exception, std.file, std.path, std.regex, std.stdio, std.string; + import config; + import selective; + import util; ++import freebsd_inotify; + static import log; + + // relevant inotify events Added: head/net/onedrive/files/version ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/onedrive/files/version Sun Mar 17 13:28:57 2019 (r496060) @@ -0,0 +1 @@ +1.1.3 Added: head/net/onedrive/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/onedrive/pkg-descr Sun Mar 17 13:28:57 2019 (r496060) @@ -0,0 +1,15 @@ +A complete tool to interact with OneDrive on Linux. +Built following the UNIX philosophy. + +Features: + State caching + Real-Time file monitoring with Inotify + Resumable uploads + Support OneDrive for Business (part of Office 365) + Shared folders (not Business) + +What's missing: + While local changes are uploaded right away, remote changes are delayed + No GUI + +WWW: https://github.com/skilion/onedrive Added: head/net/onedrive/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/onedrive/pkg-plist Sun Mar 17 13:28:57 2019 (r496060) @@ -0,0 +1,3 @@ +bin/onedrive +%%DOCSDIR%%/README.md +%%EXAMPLESDIR%%/config