#!/bin/bash # # mosquitto.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. # # mosquitto.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="mosquitto" PACKAGE_EXT="gz" VERSION=${VERSION:=1.4.15} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="http://mosquitto.org/files/source/$SRC" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION # For WITH_SRV you need the c-ares library. make WITH_SRV=no make WITH_SRV=no DESTDIR=$PKG prefix=/usr mandir=/usr/man LIB_SUFFIX=$LIBDIRSUFFIX install # Make a home directory for mosquitto mkdir -p $PKG/var/lib/mosquitto chown 308:308 $PKG/var/lib/mosquitto # Add init and setup scripts. mkdir -p $PKG/var/log/setup $PKG/etc/rc.d/init.d cp $CWD/setup.mosquitto $PKG/var/log/setup chmod 755 $PKG/var/log/setup/setup.mosquitto cp $CWD/init.mosquitto $PKG/etc/rc.d/init.d/mosquitto chmod 755 $PKG/etc/rc.d/init.d/mosquitto mkdir -p $DOCS cp -a *.txt $DOCS fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi