summaryrefslogtreecommitdiff
path: root/community/smbnetfs
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/smbnetfs
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/smbnetfs')
-rw-r--r--community/smbnetfs/PKGBUILD42
-rw-r--r--community/smbnetfs/conf-smbnetfs1
-rw-r--r--community/smbnetfs/rc-smbnetfs52
-rw-r--r--community/smbnetfs/smbnetfs.install24
4 files changed, 119 insertions, 0 deletions
diff --git a/community/smbnetfs/PKGBUILD b/community/smbnetfs/PKGBUILD
new file mode 100644
index 000000000..d03000d33
--- /dev/null
+++ b/community/smbnetfs/PKGBUILD
@@ -0,0 +1,42 @@
+# $Id: PKGBUILD 38375 2011-01-26 10:26:56Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
+
+pkgname=smbnetfs
+pkgver=0.5.3a
+pkgrel=3
+pkgdesc="small C program that mounts Microsoft network neighborhood in single directory."
+arch=('i686' 'x86_64')
+url="http://smbnetfs.sourceforge.net/"
+license=('GPL')
+depends=('fuse' 'smbclient')
+backup=(etc/smbnetfs/.smb/smb.conf \
+ etc/smbnetfs/.smb/smbnetfs.conf \
+ etc/smbnetfs/.smb/smbnetfs.auth \
+ etc/smbnetfs/.smb/smbnetfs.host)
+install=smbnetfs.install
+options=(force docs)
+source=(http://downloads.sourceforge.net/smbnetfs/$pkgname-$pkgver.tar.bz2 \
+ rc-smbnetfs \
+ conf-smbnetfs)
+md5sums=('66d1477ca981f5a07b4b21c6bdbdc442'
+ '68c824ba670aa9173382d17eae574e8f'
+ 'e150c4cd894cc6ade11b94c95cf17ec4')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ [ $NOEXTRACT -eq 1 ] || ./configure --prefix=/usr --docdir=/usr/share/doc/smbnetfs --with-gnome-keyring=no
+ make
+ make DESTDIR=$pkgdir install
+
+ mv $pkgdir/usr/share/doc/smbnetfs* $pkgdir/usr/share/doc/smbnetfs
+
+ mkdir -p $pkgdir/etc/smbnetfs/.smb && \
+ install -D -m 0644 $srcdir/$pkgname-$pkgver/conf/* $pkgdir/etc/smbnetfs/.smb/
+# install -D -m 0644 $srcdir/$pkgname-$pkgver/doc/INSTALL $pkgdir/usr/share/doc/smbnetfs/INSTALL
+ install -D -m 0644 $srcdir/$pkgname-$pkgver/README $pkgdir/usr/share/doc/smbnetfs/README
+ install -D -m 0755 $srcdir/rc-smbnetfs $pkgdir/etc/rc.d/smbnetfs
+ install -D -m 0644 $srcdir/conf-smbnetfs $pkgdir/etc/conf.d/smbnetfs
+ touch $pkgdir/etc/smbnetfs/.smb/smb.conf
+}
diff --git a/community/smbnetfs/conf-smbnetfs b/community/smbnetfs/conf-smbnetfs
new file mode 100644
index 000000000..1d45606e7
--- /dev/null
+++ b/community/smbnetfs/conf-smbnetfs
@@ -0,0 +1 @@
+SMBNETFS_MOUNT_POINT=/mnt/smbnet
diff --git a/community/smbnetfs/rc-smbnetfs b/community/smbnetfs/rc-smbnetfs
new file mode 100644
index 000000000..3b79d6d5f
--- /dev/null
+++ b/community/smbnetfs/rc-smbnetfs
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+. /etc/conf.d/smbnetfs
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+get_pid() {
+ echo `pidof smbnetfs`
+}
+
+case "$1" in
+ start)
+ stat_busy "Starting smbnetfs"
+
+ [ -f /var/run/smbnetfs.pid ] && rm -f /var/run/smbnetfs.pid
+ PID=`get_pid`
+ if [ -z "$PID" ]; then
+ cd /tmp && \
+ [ -d $SMBNETFS_MOUNT_POINT ] && \
+ su - nobody -s /bin/bash -c "HOME=/etc/smbnetfs exec smbnetfs -o allow_other $SMBNETFS_MOUNT_POINT" &>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ echo `get_pid` > /var/run/smbnetfs.pid
+ add_daemon smbnetfs
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping smbnetfs daemon"
+
+ fusermount -u $SMBNETFS_MOUNT_POINT &> /dev/null
+ rm -f /var/run/smbnetfs.pid &> /dev/null
+ rm_daemon smbnetfs
+ stat_done
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/community/smbnetfs/smbnetfs.install b/community/smbnetfs/smbnetfs.install
new file mode 100644
index 000000000..d1c87406f
--- /dev/null
+++ b/community/smbnetfs/smbnetfs.install
@@ -0,0 +1,24 @@
+post_install() {
+ echo "-- To use rc-script you should:"
+ echo "-- * set user_allow_other option in /etc/fuse.conf"
+
+ chown -R nobody.nobody /etc/smbnetfs/.smb && \
+ mkdir -p /mnt/smbnet && \
+ chown nobody.nobody /mnt/smbnet && \
+ chmod 0777 /mnt/smbnet
+}
+
+pre_upgrade() {
+ /etc/rc.d/smbnetfs stop 2>/dev/null 1>/dev/null
+ /bin/true
+}
+
+post_upgrade() {
+ echo "-- You should set user_allow_other option in /etc/fuse.conf to use rc-script"
+ echo "-- * set user_allow_other option in /etc/fuse.conf"
+
+ chown -R nobody.nobody /etc/smbnetfs/.smb && \
+ mkdir -p /mnt/smbnet && \
+ chown nobody.nobody /mnt/smbnet && \
+ chmod 0777 /mnt/smbnet
+}