djmount: add debian patches: manpage and fstab support.

This commit is contained in:
Juan RP 2013-09-24 15:22:45 +02:00
parent 8b066915bf
commit b94bee6819
4 changed files with 239 additions and 2 deletions

View file

@ -0,0 +1,105 @@
#
# Description: Adds djmount.1 manpage which isn't included in original sources.
# Forwarded: http://sourceforge.net/tracker/index.php?func=detail&aid=2834139&group_id=142039&atid=751320
# Author: Dario Minnucci <midget@debian.org>
# Last-Update: 2010-01-24
#
--- djmount.1 1970-01-01 01:00:00.000000000 +0100
+++ djmount.1 2009-08-31 19:38:36.289425318 +0200
@@ -0,0 +1,96 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH DJMOUNT 1 "August 31, 2009"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+djmount \- file system client for mounting network media servers
+.SH SYNOPSIS
+.B djmount
+.RI [ options ] " mountpoint"
+.br
+.SH DESCRIPTION
+This manual page describes briefly the
+.B djmount
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+This package provides a client for Universal Plug'n'Play (UPnP) Audio-Visual MediaServers. It discovers all compatible UPnP AV devices on the network automatically and mounts their media content as a file system using FUSE.
+
+.SH OPTIONS
+This program follows the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+For a complete description, see the Info files.
+
+.TP
+.B \-d[levels]
+enable debug output (implies \-f)
+
+.TP
+.B \-f
+foreground operation (default: daemonized)
+
+.TP
+.B \-h, \-\-help
+print this help, then exit
+
+.TP
+.B \-\-version
+print version number, then exit
+
+.TP
+.B \-o [options]
+mount options (see below)
+
+
+.TP
+Mount options (one or more comma separated options):
+
+ iocharset=<charset> filenames encoding (default: from environment)
+ playlists use playlists for AV files, instead of plain files
+ search_history=<size> number of remembered searches (default: 100)
+ (set to 0 to disable search)
+
+.TP
+See FUSE documentation for the following mount options:
+
+ default_permissions enable permission checking by kernel
+ allow_other allow access to other users
+ allow_root allow access to root
+ kernel_cache cache files in kernel
+ nonempty allow mounts over non-empty file/dir
+ fsname=NAME set filesystem name in mtab
+
+
+.TP
+Debug levels are one or more comma separated words:
+
+ upnperr, upnpall: increasing level of UPnP traces
+ error, warn, info, debug: increasing level of djmount traces
+ fuse: activates FUSE traces
+ leak, leakfull: enable talloc leak reports at exit
+ '\-d' alone defaults to 'upnpall, debug, fuse, leak' which is all traces.
+
+
+.SH SEE ALSO
+.BR fusermount (1)
+.SH AUTHOR
+djmount was written by Rémi Turboult <r3mi@users.sourceforge.net>.
+.PP
+This manual page was written by Dario Minnucci <midget@debian.org>,
+for the Debian project (and may be used by others).

View file

@ -0,0 +1,31 @@
#
# Description: Update libupnp API for 1.6.x.
# Between libupnp2 and libupnp3 (pupnp 1.4.x and 1.6.x) the function
# SetLogFileNames was renamed to UpnpSetLogFileNames.
# Author: nick@leverton.org
# Bug-Debian: 581879
#
--- djmount/fuse_main.c 2010-05-16 21:40:56.000000000 +0100
+++ djmount/fuse_main.c 2010-05-16 21:43:55.000000000 +0100
@@ -616,7 +616,7 @@
}
Log_Colorize (true);
#if UPNP_HAVE_DEBUG
- SetLogFileNames ("/dev/null", "/dev/null");
+ UpnpSetLogFileNames ("/dev/null", "/dev/null");
#endif
/*
@@ -710,10 +710,10 @@
Log_SetMaxLevel (LOG_ERROR);
#if UPNP_HAVE_DEBUG
} else if (strcmp (s, "upnperr") == 0) {
- SetLogFileNames ("/dev/stdout",
+ UpnpSetLogFileNames ("/dev/stdout",
"/dev/null");
} else if (strcmp (s, "upnpall") == 0) {
- SetLogFileNames ("/dev/stdout",
+ UpnpSetLogFileNames ("/dev/stdout",
"/dev/stdout");
#endif
} else {

View file

@ -0,0 +1,96 @@
Description: Support /etc/fstab mounting
Forwarded: https://sourceforge.net/tracker/?func=detail&aid=3514280&group_id=142039&atid=751317
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=660098
Author: Kevin Vargo <vargok@yahoo.com>
Last-Update: 2012-04-02
--- djmount/fuse_main.c 2006-08-27 16:12:20.000000000 -0400
+++ djmount/fuse_main.c 2011-12-23 15:39:29.000000000 -0500
@@ -529,6 +529,7 @@
" --version print version number, then exit\n"
" -o [options] mount options (see below)\n"
" -d[levels] enable debug output (implies -f)\n"
+ " -s sloppy -- ignore unknown options\n"
" -f foreground operation (default: daemonized)\n"
"\n"
"Mount options (one or more comma separated options) :\n"
@@ -538,6 +539,7 @@
" playlists use playlists for AV files, instead of plain files\n"
" search_history=<size> number of remembered searches (default: %d)\n"
" (set to 0 to disable search)\n"
+ " sloppy ignore unknown options (e.g., for /etc/fstab)\n"
"\n", DEFAULT_SEARCH_HISTORY_SIZE);
fprintf
(stream,
@@ -635,6 +637,9 @@
Log_Printf (LOG_DEBUG, " Fuse option = %s", fuse_argv[fuse_argc]); \
fuse_argc++
+ //Ignore unknown options "sloppy" -- mount -s
+ bool options_sloppy = false;
+
int opt = 1;
char* o;
while ((o = argv[opt++])) {
@@ -646,6 +651,9 @@
} else if (strcmp(o, "-f") == 0) {
background = false;
+
+ } else if (strcmp(o, "-s") == 0) {
+ options_sloppy = true;
} else if (*o != '-') {
// mount point
@@ -657,6 +665,10 @@
char* options_copy = strdup (options);
char* tokptr = 0;
char* s;
+
+ char** unknown_options = talloc_size(tmp_ctx, sizeof(char) * strlen(options_copy));
+ int unknown_ptr = -1;
+
for (s = strtok_r (options_copy, ",", &tokptr);
s != NULL;
s = strtok_r (NULL, ",", &tokptr)) {
@@ -669,16 +681,39 @@
} else if (strncmp(s, "search_history=", 15)
== 0) {
search_history_size = atoi (s+15);
+ //check for '-s|-o sloppy' -- ignore unknown options
+ } else if (strncmp(s, "sloppy", 15) == 0 ||
+ (strlen(s) == 1 && strncmp(s, "s", 1) == 0)) {
+ options_sloppy = true;
} else if (strncmp(s, "fsname=", 7) == 0 ||
strstr (FUSE_ALLOWED_OPTIONS, s)) {
FUSE_ARG ("-o");
FUSE_ARG (talloc_strdup (tmp_ctx, s));
} else {
+ //Record unknown options for analysis, after we're sure
+ //we don't see '-o sloppy'
+ unknown_options[++unknown_ptr] = strdup(s);
+ }
+ }
+
+ //Now, we should know if we have invalid option(s), or can
+ //ignore:
+ if (unknown_ptr >= 0) {
+ //If debug...
+ int i = 0;
+ for (i = 0; i <= unknown_ptr; i++) {
+ Log_Printf (LOG_WARNING, "Found unknown option = %s%s",
+ unknown_options[i], (options_sloppy ? "; ignoring" : ""));
+ }
+ //If 'sloppy' is not enabled...
+ if (! options_sloppy) {
bad_usage (argv[0],
- "unknown mount option '%s'",
- s); // ---------->
+ "unknown mount option '%s' (and [-s|-o sloppy] not provided)",
+ unknown_options[0]); // ---------->
}
}
+ talloc_free(unknown_options);
+
free (options_copy);
Log_Printf (LOG_INFO, " Mount options = %s", options);

View file

@ -1,11 +1,11 @@
# Template file for 'djmount'
pkgname=djmount
version=0.71
revision=1
revision=2
build_style=gnu-configure
configure_args="--with-external-libupnp --with-external-talloc"
hostmakedepends="pkg-config"
makedepends="fuse-devel talloc-devel libupnp-devel"
makedepends="fuse-devel talloc-devel libupnp-devel readline-devel"
short_desc="Mount MediaServers content as a Linux file system"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-2"
@ -19,6 +19,11 @@ long_desc="
tree. All shared files (e.g. Audio or Video files) are directly visible and
can be played using your favorite media player."
do_install() {
vinstall djmount/djmount 755 usr/bin
vinstall djmount.1 644 usr/share/man/man1
}
djmount_package() {
pkg_install() {
vmove all