#!/bin/bash # # ragel.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. # # ragel.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="ragel" PACKAGE_EXT="gz" VERSION=${VERSION:=6.10} 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://www.colm.net/files/ragel/$SRC" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION # Fix hardcoded default CXXFLAGS sed -i "s|^CXXFLAGS=\"-g|CXXFLAGS=\"$SLKCFLAGS|" configure sed -i "s|\ compare| this->compare|" \ aapl/{avlcommon,bstcommon,bubblesort,mergesort}.h sed -i "s| compare| this->compare|" aapl/{avl,bst}common.h # ragel requires itself to build its parsers :/ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=$DOCS \ --disable-manual \ --build=$ARCH-slackware-linux make -j5 install -m 0755 -D ragel/ragel $PKG/usr/bin/ragel make clean sed -i "s|=no|=yes|" DIST PATH=$PATH:$PKG/usr/bin CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/$DOCS \ --disable-manual \ --build=$ARCH-slackware-linux sed -i "s|^CXXFLAGS.*|CXXFLAGS = $SLKCFLAGS|" {Makefile,ragel/Makefile} make -j5 make install DESTDIR=$PKG mkdir -p $DOCS cp -a AUTHORS COPYING README TODO $DOCS mv $PKG/tmp/package-ragel/usr/doc/ragel-${VERSION}/* $DOCS rm -rf $PKG/tmp fixup_package $PKG set +u # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi