#!/bin/bash # # rspamd.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. # # rspamd.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="rspamd" PACKAGE_EXT="gz" VERSION=${VERSION:=1.9.4} 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="https://github.com/vstakhov/rspamd/archive/${VERSION}.tar.gz" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION echo "compiling source code..." mkdir rspamd.build && cd rspamd.build cmake -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DNO_SHARED=ON \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCONFDIR=/etc/rspamd \ -DRUNDIR=/var/run/rspamd \ -DLIBDIR=/usr/lib${LIBDIRSUFFIX}/rspamd \ -DLOGDIR=/var/log/rspamd \ -DDBDIR=/var/lib/rspamd \ -DMANDIR=/usr/man \ -DWANT_SYSTEMD_UNITS=OFF \ -DENABLE_LUAJIT=ON \ -DRSPAMD_USER=310 \ .. make $NUMJOBS echo " rspamd compiled." make install DESTDIR=$PKG echo " rspamd program files installed." cd .. mkdir -p $PKG/etc/rc.d/init.d $PKG/etc/logrotate.d cat $CWD/rspamd.init > $PKG/etc/rc.d/init.d/rspamd chmod 755 $PKG/etc/rc.d/init.d/rspamd cat $CWD/rspamd.logrotate > $PKG/etc/logrotate.d/rspamd mkdir -p $PKG/var/lib/rspamd $PKG/var/log/rspamd $PKG/var/run/rspamd $PKG/etc/rspamd/override.d $PKG/etc/rspamd/local.d chown 310:310 $PKG/var/lib/rspamd $PKG/var/log/rspamd $PKG/var/run/rspamd mkdir -p $PKG/var/log/setup cp $CWD/rspamd.setup $PKG/var/log/setup/setup.rspamd chmod 755 $PKG/var/log/setup/setup.rspamd # Add docs to the proper location mkdir -p $DOCS cp -a *.md ChangeLog $DOCS fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi