diff options
Diffstat (limited to 'filesystems/simple-mtpfs')
-rw-r--r-- | filesystems/simple-mtpfs/Makefile | 46 | ||||
-rw-r--r-- | filesystems/simple-mtpfs/distinfo | 3 | ||||
-rw-r--r-- | filesystems/simple-mtpfs/files/patch-src__simple-mtpfs-fuse.cpp | 32 | ||||
-rw-r--r-- | filesystems/simple-mtpfs/files/special_simple-mtpfs.in | 18 | ||||
-rw-r--r-- | filesystems/simple-mtpfs/pkg-descr | 6 |
5 files changed, 105 insertions, 0 deletions
diff --git a/filesystems/simple-mtpfs/Makefile b/filesystems/simple-mtpfs/Makefile new file mode 100644 index 000000000000..2c04141d0886 --- /dev/null +++ b/filesystems/simple-mtpfs/Makefile @@ -0,0 +1,46 @@ +PORTNAME= simple-mtpfs +DISTVERSIONPREFIX= v +DISTVERSION= 0.4.0 +PORTREVISION= 1 +CATEGORIES= filesystems +PKGNAMEPREFIX= fusefs- + +MAINTAINER= ports@FreeBSD.org +COMMENT= Simple MTP fuse filesystem driver +WWW= https://github.com/phatina/simple-mtpfs + +LICENSE= GPLv2+ + +BUILD_DEPENDS= autoconf-archive>0.2017:devel/autoconf-archive +LIB_DEPENDS= libmtp.so:multimedia/libmtp + +USE_GITHUB= yes +GH_ACCOUNT= phatina + +USES= autoreconf compiler:c++17-lang fuse localbase pkgconfig +GNU_CONFIGURE= yes +GNU_CONFIGURE_MANPREFIX=${PREFIX}/share +MAKEFILE= makefile +INSTALL_TARGET= install-strip +PLIST_FILES= bin/${PORTNAME} \ + share/man/man1/${PORTNAME}.1.gz +PORTDOCS= AUTHORS NEWS README.md + +OPTIONS_DEFINE= DOCS + +# XXX move to PREFIX when bug 193596 lands +.if exists(/etc/autofs) +PLIST_FILES+= /etc/autofs/special_${PORTNAME} +SUB_FILES+= special_${PORTNAME} +.endif + +post-install: + (cd ${WRKSRC} && ${COPYTREE_SHARE} \ + "${PORTDOCS}" ${STAGEDIR}${DOCSDIR}) +.if exists(/etc/autofs) + @${MKDIR} ${STAGEDIR}/etc/autofs + ${INSTALL_SCRIPT} ${WRKDIR}/special_${PORTNAME} \ + ${STAGEDIR}/etc/autofs +.endif + +.include <bsd.port.mk> diff --git a/filesystems/simple-mtpfs/distinfo b/filesystems/simple-mtpfs/distinfo new file mode 100644 index 000000000000..d9a8c2d015ab --- /dev/null +++ b/filesystems/simple-mtpfs/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1595446039 +SHA256 (phatina-simple-mtpfs-v0.4.0_GH0.tar.gz) = 1d011df3fa09ad0a5c09d48d84c03e6cddf86390af9eb4e0c178193f32f0e2fc +SIZE (phatina-simple-mtpfs-v0.4.0_GH0.tar.gz) = 36234 diff --git a/filesystems/simple-mtpfs/files/patch-src__simple-mtpfs-fuse.cpp b/filesystems/simple-mtpfs/files/patch-src__simple-mtpfs-fuse.cpp new file mode 100644 index 000000000000..d1dbca44fbe2 --- /dev/null +++ b/filesystems/simple-mtpfs/files/patch-src__simple-mtpfs-fuse.cpp @@ -0,0 +1,32 @@ +# Allow fake device file to use with fstab(5) + +--- src/simple-mtpfs-fuse.cpp.orig 2015-08-24 11:34:39 UTC ++++ src/simple-mtpfs-fuse.cpp +@@ -309,12 +309,6 @@ bool SMTPFileSystem::parseOptions(int ar + + --m_options.m_device_no; + +- // device file and -- device are mutually exclusive, fail if both set +- if (m_options.m_device_no && m_options.m_device_file) { +- m_options.m_good = false; +- return false; +- } +- + m_options.m_good = true; + return true; + } +@@ -379,11 +373,9 @@ bool SMTPFileSystem::exec() + return false; + } + +- if (m_options.m_device_file) { +- // Try to use device file first, if provided +- if (!m_device.connect(m_options.m_device_file)) +- return false; +- } else { ++ // Try to use device file first, ignore otherwise ++ if (!m_options.m_device_file || ++ !m_device.connect(m_options.m_device_file)) { + // Connect to MTP device by order number, if no device file supplied + if (!m_device.connect(m_options.m_device_no)) + return false; diff --git a/filesystems/simple-mtpfs/files/special_simple-mtpfs.in b/filesystems/simple-mtpfs/files/special_simple-mtpfs.in new file mode 100644 index 000000000000..7f45b8649e53 --- /dev/null +++ b/filesystems/simple-mtpfs/files/special_simple-mtpfs.in @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Intended for use with /etc/auto_master containing +# /mtp -simple-mtpfs -allow_other +# + +out=$(%%PREFIX%%/bin/simple-mtpfs --list-devices) +[ $? -eq 0 ] || exit 1 + +if [ $# -eq 0 ]; then + echo "$out" | sed 's/[^:]*: //' | sort -u + exit 0 +fi + +devno=$(echo "$out" | (fgrep "$1" || echo 0) | sed 's/:.*//') +[ $devno -gt 0 ] || exit 1 + +echo "/ -fstype=none,--device=$devno,mountprog=%%PREFIX%%/bin/simple-mtpfs :none" diff --git a/filesystems/simple-mtpfs/pkg-descr b/filesystems/simple-mtpfs/pkg-descr new file mode 100644 index 000000000000..4b44f0a90134 --- /dev/null +++ b/filesystems/simple-mtpfs/pkg-descr @@ -0,0 +1,6 @@ +Simple FUSE filesystem for reading from and writing to MTP devices. + +SIMPLE-MTPFS (Simple Media Transfer Protocol FileSystem) is a file system for +Linux (and other operating systems with a FUSE implementation, such as Mac OS X +or FreeBSD) capable of operating on files on MTP devices attached via USB to +local machine. |