Initial commit
This commit is contained in:
93
davfs2/MINI_HOWTO
Normal file
93
davfs2/MINI_HOWTO
Normal file
@@ -0,0 +1,93 @@
|
||||
HOW TO CONNECT WITH A WEBDAV SERVER WITH THE DAVF2 APPLICATION
|
||||
|
||||
In this HOWTO, the user is named "chris"
|
||||
Amend as required for your choice of username.
|
||||
|
||||
1. Login as root
|
||||
|
||||
2. Define a davfs2 group and user:
|
||||
|
||||
# groupadd -g 230 davfs2
|
||||
# useradd -u 230 -d /var/cache/davfs2 -g davfs2 -s /bin/false davfs2
|
||||
|
||||
3. Build and install davfs2 as usual.
|
||||
|
||||
4. Add the user if not already defined. My user shall be called chris, so:
|
||||
|
||||
# adduser chris
|
||||
|
||||
Read the Slackbook for more details on adduser, choose default settings BUT:
|
||||
with the default group list add also davfs2:
|
||||
|
||||
Press ENTER to continue without adding any additional groups
|
||||
Or press the UP arrow to add/select/edit additional groups
|
||||
: audio cdrom floppy plugdev video power netdev lp scanner davfs2
|
||||
|
||||
If the user was already defined, then add davfs2 to the groups:
|
||||
|
||||
# usermod -aG davfs2 chris
|
||||
|
||||
5. Edit /etc/fstab with the following line:
|
||||
WEBDAV_SERVER_URL mount_point davfs noauto,user 0 0
|
||||
|
||||
For example:
|
||||
https://example.org/chris /home/chris/mnt/dav davfs noauto,user 0 0
|
||||
|
||||
6. logout
|
||||
|
||||
7. Login again as your davfs user ("chris" in my case).
|
||||
|
||||
8. $ mkdir -p $HOME/.davfs2/certs/private/ $HOME/mnt/dav
|
||||
|
||||
9. Move the certificate to $HOME/davfs2/certs/private and restrict the permission to rw-------:
|
||||
For example:
|
||||
|
||||
$ mv CERTIFICATE.PFX $HOME/.davfs2/certs/private/
|
||||
$ chmod 600 $HOME/.davfs2/certs/private/CERIFICATE.PFX
|
||||
|
||||
10. Optionally: Copy the system configuration file. There are a lot of
|
||||
interesting comments in these files that might be helpful.
|
||||
|
||||
$ cp /usr/share/davfs2/* $HOME/.davfs2/
|
||||
|
||||
11. Edit $HOME/.davfs2/davfs2.conf with the following line:
|
||||
|
||||
clientcert ~/.davfs2/certs/private/CERTIFICATE.PFX
|
||||
|
||||
Read:
|
||||
|
||||
$ man davfs2.conf
|
||||
|
||||
for all the details and options. Tests have shown that you might need more
|
||||
than the line above, so you may want to read about other interesting
|
||||
parameters, e.g.:
|
||||
|
||||
add_header Translate F
|
||||
|
||||
12. Edit $HOME/.davfs2/secrets with the following 2 lines:
|
||||
|
||||
/home/chris/mnt/dav username password
|
||||
CERTIFICATE.PFX passphrase
|
||||
|
||||
The username and password are relevant to the Webdav server, not for the
|
||||
local account.
|
||||
passphrase is the password for the PFX certificate
|
||||
You should obtain all these from the Webdav server Administrator
|
||||
|
||||
13. Restrict permssion for $HOME/.davfs2/secrets to rw-------:
|
||||
|
||||
$ chmod 600 $HOME/.davfs2/secrets
|
||||
|
||||
14. Mount the davfs service on $HOME/mnt/dav
|
||||
|
||||
$ mount $HOME/mnt/dav
|
||||
|
||||
You should be able to see your WEBDAV server on $HOME/mnt/dav/
|
||||
|
||||
15. When you would like to disconnect:
|
||||
|
||||
$ umount $HOME/mnt/dav
|
||||
|
||||
You should get a similar response (the pid number is random):
|
||||
|
||||
/sbin/umount.davfs: waiting while mount.davfs (pid 5700) synchronizes the cache .. OK
|
||||
11
davfs2/README
Normal file
11
davfs2/README
Normal file
@@ -0,0 +1,11 @@
|
||||
Web Distributed Authoring and Versioning (WebDAV), an extension to the HTTP-
|
||||
protocol, allows authoring of resources on a remote web server. davfs2
|
||||
provides the ability to access such resources like a typical filesystem,
|
||||
allowing for use by standard applications with no built-in support for WebDAV.
|
||||
|
||||
Before running this SlackBuild, define a davfs2 group and a davfs2 user. The
|
||||
davfs2 user shall have davfs2 as its initial login group, shall not have no
|
||||
shell and the home directory shall be /var/cache/davfs. Examples:
|
||||
|
||||
# groupadd -g 230 davfs2
|
||||
# useradd -u 230 -d /var/cache/davfs2 -g davfs2 -s /bin/false davfs2
|
||||
133
davfs2/davfs2.SlackBuild
Normal file
133
davfs2/davfs2.SlackBuild
Normal file
@@ -0,0 +1,133 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Slackware build script for davfs2
|
||||
|
||||
# Copyright (c) 2008, Justin H Haynes <justin@justinhaynes.com>
|
||||
# Copyright (c) 2012 Chris Abela, Malta
|
||||
# Copyright 2014 Ryan P.C. McQuen, WA, ryanpcmcquen@member.fsf.org
|
||||
# Copyright 2014, 2016 Chris Abela, Malta
|
||||
# Copyright 2022 Sergei Fedosoff <eleksir@gmail.com>
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# Modified by Robby Workman <rworkman@slackbuilds.org>
|
||||
|
||||
PRGNAM=davfs2
|
||||
VERSION=${VERSION:-1.6.1}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_EXs}
|
||||
|
||||
DAVFS2_USER=${DAVFS2_USER:-davfs2}
|
||||
DAVFS2_GROUP=${DAVFS2_GROUP:-davfs2}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i586 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
CWD=$(pwd)
|
||||
TMP=${TMP:-/tmp/EXs}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
# davfs2 user & group *MUST* exist before package creation
|
||||
# See http://slackbuilds.org/uid_gid.txt for current recomendations.
|
||||
|
||||
if ! grep -q "^$DAVFS2_GROUP:" /etc/group; then
|
||||
echo "$0: Error: DAVFS2 group ($DAVFS2_GROUP) doesn't exist."
|
||||
echo "$0: Try creating one with: \
|
||||
# groupadd -g 230 $DAVFS2_GROUP"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -q "^$DAVFS2_USER:" /etc/passwd; then
|
||||
echo "$0: Error: DAVFS2 user ($DAVFS2_USER) doesn't exist."
|
||||
echo "$0: Try creating one with: \
|
||||
# useradd -u 230 -d /var/cache/davfs2 -g $DAVFS2_GROUP -s /bin/false $DAVFS2_USER"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$ARCH" = "i586" ]; then
|
||||
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "i686" ]; then
|
||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xf $CWD/$PRGNAM-$VERSION.tar.gz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find -L . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
||||
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
||||
|
||||
dav_user=$DAVFS2_USER \
|
||||
dav_group=$DAVFS2_GROUP \
|
||||
CFLAGS="-g $SLKFLAGS -flto -rdynamic" \
|
||||
LDFLAGS="-flto -rdynamic -Wl,--export-dynamic -Wl,-E -Wl,--no-as-needed -Wl,-O2" \
|
||||
CXXFLAGS="$CFLAGS" \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
||||
--sysconfdir=/etc \
|
||||
--mandir=/usr/man \
|
||||
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
||||
--build=$ARCH-slackware-linux
|
||||
|
||||
make -j$(nproc)
|
||||
make install DESTDIR=$PKG
|
||||
|
||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
|
||||
# Let's not clobber the system config files
|
||||
mv $PKG/etc/davfs2/davfs2.conf $PKG/etc/davfs2/davfs2.conf.new
|
||||
mv $PKG/etc/davfs2/secrets $PKG/etc/davfs2/secrets.new
|
||||
|
||||
cp -a ABOUT-NLS $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
# davfs2 autobuild places mount.davfs and umount.davfs in /usr/sbin
|
||||
# and places symlinks in /sbin. In Slackware, our mount backends
|
||||
# only belong in /sbin, so let's put them there and adjust the links
|
||||
( cd $PKG/usr/sbin
|
||||
for i in * ; do
|
||||
mv $i ../../sbin
|
||||
ln -s ../../sbin/$i $i
|
||||
done
|
||||
)
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
||||
16
davfs2/davfs2.info
Normal file
16
davfs2/davfs2.info
Normal file
@@ -0,0 +1,16 @@
|
||||
PRGNAM="davfs2"
|
||||
VERSION="1.6.1"
|
||||
HOMEPAGE="http://savannah.nongnu.org/projects/davfs2"
|
||||
DOWNLOAD="http://download.savannah.nongnu.org/releases/davfs2/davfs2-1.6.1.tar.gz"
|
||||
MD5SUM="04c82c25663f7dae5931002aa8ffea06"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES=""
|
||||
GROUP="davfs2"
|
||||
GID="230"
|
||||
USER="davfs2"
|
||||
UID="230"
|
||||
USER_SHELL="/bin/false"
|
||||
USER_HOME="/var/cache/davfs2"
|
||||
MAINTAINER="Sergei Fedosoff"
|
||||
EMAIL="eleksir@gmail.com"
|
||||
15
davfs2/doinst.sh
Normal file
15
davfs2/doinst.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
config() {
|
||||
NEW="$1"
|
||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
||||
# If there's no config file by that name, mv it over:
|
||||
if [ ! -r $OLD ]; then
|
||||
mv $NEW $OLD
|
||||
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
|
||||
# toss the redundant copy
|
||||
rm $NEW
|
||||
fi
|
||||
# Otherwise, we leave the .new copy for the admin to consider...
|
||||
}
|
||||
|
||||
config etc/davfs2/davfs2.conf.new
|
||||
config etc/davfs2/secrets.new
|
||||
19
davfs2/slack-desc
Normal file
19
davfs2/slack-desc
Normal file
@@ -0,0 +1,19 @@
|
||||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
davfs2: davfs2 (virtual filesystem driver for WebDAV)
|
||||
davfs2:
|
||||
davfs2: Web Distributed Authoring and Versioning (WebDAV), an extension to the
|
||||
davfs2: HTTP-protocol, allows authoring of resources on a remote web server.
|
||||
davfs2: davfs2 provides the ability to access such resources like a typical
|
||||
davfs2: filesystem, allowing for use by standard applications with no built-in
|
||||
davfs2: support for WebDAV.
|
||||
davfs2:
|
||||
davfs2: Homepage: http://savannah.nongnu.org/projects/davfs2
|
||||
davfs2:
|
||||
davfs2:
|
||||
Reference in New Issue
Block a user