#!/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="gz" VERSION=${VERSION:=0.7} BUILD=${BUILD:=1} 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 312 avahi fi if [ -z "`grep ^avahi: /etc/passwd`" ]; then useradd -u 312 -g 312 -d /no/where -s /bin/false -c "Avahi Daemon" avahi USERAVAHI="yes" fi if [ -z "`grep ^avahi-autoipd: /etc/group`" ]; then groupadd -g 313 avahi-autoipd fi if [ -z "`grep ^avahi-autoipd: /etc/passwd`" ]; then useradd -u 313 -g 313 -d /no/where -s /bin/false -c "Avahi IP Daemon" avahi-autoipd USERAUTOIPD="yes" fi SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="http://avahi.org/download/$SRC" URL="https://github.com/lathiat/avahi/releases/download/v${VERSION}/${SRC}" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION CFLAGS="$SLKCFLAGS" ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/man \ --localstatedir=/var \ --disable-static \ --disable-qt3 \ --disable-mono \ --disable-xmltoman \ --enable-autoipd \ --enable-compat-libdns_sd \ --enable-compat-howl \ --with-distro=slackware \ --with-avahi-user=avahi \ --with-avahi-group=avahi \ --with-autoipd-user=avahi-autoipd \ --with-autoipd-group=avahi-autoipd \ --with-avahi-priv-access-group=plugdev \ --build=$ARCH-slackware-linux || exit 1 make -j3 || exit 2 make DESTDIR=$PKG install # avahi-set-host-name can only be used by root mv $PKG/usr/bin/avahi-set-host-name $PKG/usr/sbin 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 sed -i 's|enable-wide-area=yes|enable-wide-area=no|' $PKG/etc/avahi/avahi-daemon.conf mv $PKG/etc/avahi/avahi-daemon.conf $PKG/etc/avahi/avahi-daemon.conf.new mv $PKG/etc/avahi/hosts $PKG/etc/avahi/hosts.new mv $PKG/etc/avahi/services/sftp-ssh.service $PKG/etc/avahi/services/sftp-ssh.service.new mv $PKG/etc/avahi/services/ssh.service $PKG/etc/avahi/services/ssh.service.new mv $PKG/etc/dbus-1/system.d/avahi-dbus.conf $PKG/etc/dbus-1/system.d/avahi-dbus.conf.new # Install a missing icon (stolen from 64studio). mkdir -p $PKG/usr/share/icons install -o root -g root -m 0644 $CWD/network-wired.xpm $PKG/usr/share/icons # Install dhcpcd support mkdir -p $PKG/etc/dhcpc install -o root -g root -m 0755 $CWD/dhcpcd.exe $PKG/etc/dhcpc/dhcpcd.exe.new mkdir -p $DOCS cp -a LICENSE docs/API-CHANGES-0.6 docs/AUTHORS docs/COMPAT-LAYERS docs/DBUS-API \ docs/HACKING docs/INSTALL docs/MALLOC docs/NEWS docs/README docs/TODO $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