#!/bin/bash # # avahi.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # avahi.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="avahi" PACKAGE_EXT="lz" VERSION=${VERSION:-$(echo $PACKAGE-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} BUILD=${BUILD:=1} SRC=${SRC:-$(echo avahi-*.tar.$PACKAGE_EXT)} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required # # check avahi accounts # if [ -z "`grep ^avahi: /etc/group`" ]; then groupadd -g 214 avahi fi if [ -z "`grep ^avahi: /etc/passwd`" ]; then useradd -u 214 -g 214 -d /no/where -s /bin/false -c "Avahi Daemon" avahi USERAVAHI="yes" fi unpack_source $SRC $PACKAGE-$VERSION # Adjust for our netconfig, thanks to rworkman: cat $CWD/fixup_avahi-dnsconfd.action.patch | patch -p1 --verbose || exit 1 # Configure, build, and install: if [ ! -r configure ]; then if [ -x ./autogen.sh ]; then NOCONFIGURE=1 ./autogen.sh else autoreconf -vif fi fi #export PYTHON=python3 CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/usr/doc/$PACKAGE-$VERSION \ --with-systemdsystemunitdir=no \ --enable-tests \ --disable-static \ --disable-mono \ --disable-monodoc \ --disable-autoipd \ --disable-libsystemd \ --enable-compat-libdns_sd \ --enable-python-dbus \ --enable-glib \ --enable-dbus \ --enable-python \ --disable-gtk \ --disable-gtk3 \ --disable-qt5 \ --disable-qt3 \ --enable-qt4 \ --enable-core-docs \ --with-dbus-sys=/usr/share/dbus-1/system.d \ --with-avahi-user=avahi \ --with-avahi-group=avahi \ --with-avahi-priv-access-group=netdev \ --with-distro=slackware \ --program-prefix= \ --program-suffix= \ --build=$ARCH-slackware-linux || exit 1 make ${NUMJOBS} || exit 2 make DESTDIR=$PKG install # 20220414 bkw: if this dir is empty, it doesn't need to be included # in the package. rmdir $PKG/run &> /dev/null || true # Install these files as .new: mv $PKG/etc/rc.d/rc.avahidaemon $PKG/etc/rc.d/rc.avahidaemon.new mv $PKG/etc/rc.d/rc.avahidnsconfd $PKG/etc/rc.d/rc.avahidnsconfd.new mv $PKG/etc/avahi/avahi-daemon.conf $PKG/etc/avahi/avahi-daemon.conf.new # Fix python3 shebangs: sed -i "s|#!python3|#!/usr/bin/python3|g" $PKG/usr/bin/avahi-{discover,bookmarks} # avahi-set-host-name can only be used by root mv $PKG/usr/bin/avahi-set-host-name $PKG/usr/sbin mkdir -p $DOCS cp -a docs/* $DOCS # Prevent overwrite: mv $DOCS/README $DOCS/README.too cp -a LICENSE* README* $DOCS fixup_package $PKG # If we made accounts for package building, remove them again. set +u if [ ! -z "$USERAVAHI" ]; then userdel avahi fi if [ ! -z "$USERAUTOIPD" ]; then userdel avahi-autoipd fi # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi