#!/bin/sh # Slackware Package Build Script for fail2ban # Home Page http://www.fail2ban.org/wiki/index.php/Main_Page # Git Hub: https://github.com/fail2ban/fail2ban/ # Copyright (c) 2008-2011, Nishant Limbachia, Hoffman Estates, IL, 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 script must retain the above copyright notice, # this list of conditions and the following disclaimer. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "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 COPYRIGHT OWNER OR # CONTRIBUTORS 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. # default settings PACKAGE="fail2ban" PACKAGE_EXT="gz" VERSION=${VERSION:=0.9.4} BUILD=${BUILD:=2} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required SRC="${VERSION}-1.tar.$PACKAGE_EXT" URL="https://github.com/fail2ban/fail2ban/archive/debian/$SRC" get_source $SRC $URL unpack_source $SRC fail2ban-debian-${VERSION}-1 python setup.py install --root=$PKG # installing man pages mkdir -p $PKG/usr/man/man1 install -m 0644 man/fail2ban-client.1 man/fail2ban-regex.1 \ man/fail2ban-server.1 $PKG/usr/man/man1 # move config files to .new ( cd $PKG/etc/fail2ban for file in $(ls *.conf); do mv $file "$file.new" done ) # install startup script install -D -m 0644 $CWD/rc.fail2ban $PKG/etc/rc.d/rc.fail2ban.new # install logrotate script install -D -m 0644 $CWD/fail2ban.logrotate $PKG/etc/logrotate.d/fail2ban.new # make directory for socket and pid file mkdir -p $PKG/var/run/fail2ban mkdir -p $DOCS cp -a COPYING ChangeLog DEVELOP README* THANKS TODO $DOCS fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi