summaryrefslogtreecommitdiffstats
path: root/source/n
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2024-05-24 19:58:32 +0000
committer Eric Hameleers <alien@slackware.com>2024-05-24 22:29:19 +0200
commit7aefbd4988cd3ac2c2efbb7434752eb22c09a8af (patch)
tree219492535c02b862020f3f42df5e6e22ecdf999e /source/n
parent983b468de98dc068ca697028895969cccfce8ede (diff)
downloadcurrent-7aefbd4988cd3ac2c2efbb7434752eb22c09a8af.tar.gz
current-7aefbd4988cd3ac2c2efbb7434752eb22c09a8af.tar.xz
Fri May 24 19:58:32 UTC 202420240524195832
ap/sqlite-3.46.0-x86_64-1.txz: Upgraded. l/gvfs-1.54.1-x86_64-1.txz: Upgraded. l/python-requests-2.32.2-x86_64-1.txz: Upgraded. n/c-ares-1.29.0-x86_64-1.txz: Upgraded. n/dhcpcd-10.0.8-x86_64-1.txz: Upgraded. n/wsdd2-1.8.7-x86_64-1.txz: Added. Needed by Samba to enable share discovery. Thanks to mistfire and Tim Dickson.
Diffstat (limited to '')
-rw-r--r--source/n/wsdd2/doinst.sh26
-rw-r--r--source/n/wsdd2/rc.wsdd240
-rw-r--r--source/n/wsdd2/slack-desc19
-rwxr-xr-xsource/n/wsdd2/wsdd2.SlackBuild128
-rw-r--r--source/n/wsdd2/wsdd2.nowarn.optional.smb.conf.options.patch11
-rw-r--r--source/n/wsdd2/wsdd2.url1
6 files changed, 225 insertions, 0 deletions
diff --git a/source/n/wsdd2/doinst.sh b/source/n/wsdd2/doinst.sh
new file mode 100644
index 000000000..194630ea2
--- /dev/null
+++ b/source/n/wsdd2/doinst.sh
@@ -0,0 +1,26 @@
+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
+ chmod +x $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...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.wsdd2.new
diff --git a/source/n/wsdd2/rc.wsdd2 b/source/n/wsdd2/rc.wsdd2
new file mode 100644
index 000000000..6e2a6b838
--- /dev/null
+++ b/source/n/wsdd2/rc.wsdd2
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# /etc/rc.d/rc.wsdd2
+#
+# start/stop/restart the wsdd2 daemon.
+#
+# This init script ships as executable, and will start automatically if Samba
+# is configured to start.
+
+wsdd2_start() {
+ if [ -r /etc/samba/smb.conf -a -x /etc/rc.d/rc.samba -a -x /usr/sbin/wsdd2 ]; then
+ echo "Starting wsdd2: /usr/bin/wsdd2 -d"
+ /usr/sbin/wsdd2 -d
+ fi
+}
+
+wsdd2_stop() {
+ killall --ns $$ -TERM wsdd2 2> /dev/null
+}
+
+wsdd2_restart() {
+ wsdd2_stop
+ sleep 1
+ wsdd2_start
+}
+
+case "$1" in
+'start')
+ # We don't want to run this more than once, so just use restart to start it:
+ wsdd2_restart
+ ;;
+'stop')
+ wsdd2_stop
+ ;;
+'restart')
+ wsdd2_restart
+ ;;
+*)
+ wsdd2_start
+esac
diff --git a/source/n/wsdd2/slack-desc b/source/n/wsdd2/slack-desc
new file mode 100644
index 000000000..fcbdc69a0
--- /dev/null
+++ b/source/n/wsdd2/slack-desc
@@ -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 ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+wsdd2: wsdd2 (Web Services for Devices daemon)
+wsdd2:
+wsdd2: The primary purpose of this package is to enable WSD on Samba servers
+wsdd2: so that network shares hosted on a Linux box can appear in Windows
+wsdd2: File Explorer / Network.
+wsdd2: Don't forget to allow local ip6 connections in your smb.conf file,
+wsdd2: specifically: fc00::/7 fe80::/64 ::1
+wsdd2: Also, in your firewall, make sure ports 3702 and 5355 are open.
+wsdd2:
+wsdd2: Homepage: https://github.com/Netgear/wsdd2
+wsdd2:
diff --git a/source/n/wsdd2/wsdd2.SlackBuild b/source/n/wsdd2/wsdd2.SlackBuild
new file mode 100755
index 000000000..a15826132
--- /dev/null
+++ b/source/n/wsdd2/wsdd2.SlackBuild
@@ -0,0 +1,128 @@
+#!/bin/bash
+
+# Copyright 2020, 2022 Tim Dickson Scotland
+# Copyright 2024 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=wsdd2
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$(uname -m)" in
+ i?86) ARCH=i586 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$(uname -m) ;;
+ esac
+ export ARCH
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+# This doesn't contain enough source files for $NUMJOBS to matter.
+#NUMJOBS=${NUMJOBS:-" -j $(expr $(nproc) + 1) "}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
+cd $PKGNAM-$VERSION || exit 1
+
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \+ -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \+
+
+# Don't warn about missing optional config lines:
+cat $CWD/wsdd2.nowarn.optional.smb.conf.options.patch | patch -p1 --verbose || exit 1
+
+export CFLAGS="$SLKCFLAGS"
+export CXXFLAGS="$SLKCFLAGS"
+make || exit 1
+make install debug_W=-1 debug_L=-1 DESTDIR=$PKG MANDIR="/usr/man" INSTALLPREFIX="usr"
+
+# Add a compatibilty symlink for gvfs:
+ln -sf wsdd2 $PKG/usr/sbin/wsdd
+
+# Install the rc script:
+mkdir -p $PKG/etc/rc.d
+cp -a $CWD/rc.wsdd2 $PKG/etc/rc.d/rc.wsdd2.new
+chown root:root $PKG/etc/rc.d/rc.wsdd2.new
+chmod 755 $PKG/etc/rc.d/rc.wsdd2.new
+
+# Strip binaries:
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Compress manual pages:
+find $PKG/usr/man -type f -exec gzip -9 {} \+
+for i in $( find $PKG/usr/man -type l ) ; do
+ ln -s $( readlink $i ).gz $i.gz
+ rm $i
+done
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a \
+ LICENSE* README* \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+
+mkdir -p $PKG/install
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
diff --git a/source/n/wsdd2/wsdd2.nowarn.optional.smb.conf.options.patch b/source/n/wsdd2/wsdd2.nowarn.optional.smb.conf.options.patch
new file mode 100644
index 000000000..3de8e0975
--- /dev/null
+++ b/source/n/wsdd2/wsdd2.nowarn.optional.smb.conf.options.patch
@@ -0,0 +1,11 @@
+--- ./wsdd2.c.orig 2022-04-25 07:30:50.000000000 -0500
++++ ./wsdd2.c 2024-05-24 13:51:20.210623306 -0500
+@@ -601,7 +601,7 @@
+
+ char buf[PAGE_SIZE];
+ if (!fgets(buf, sizeof(buf), pp) || !buf[0] || buf[0] == '\n') {
+- DEBUG(0, W, "cannot read %s from testparm", name);
++ DEBUG(1, W, "cannot read %s from testparm", name);
+ result = strdup(_default);
+ } else { // trim whitespace
+ char *p;
diff --git a/source/n/wsdd2/wsdd2.url b/source/n/wsdd2/wsdd2.url
new file mode 100644
index 000000000..37ac6e2af
--- /dev/null
+++ b/source/n/wsdd2/wsdd2.url
@@ -0,0 +1 @@
+https://github.com/Netgear/wsdd2