diff options
-rw-r--r-- | academic/lpsolve/README | 3 | ||||
-rw-r--r-- | academic/lpsolve/cflags.patch | 25 | ||||
-rw-r--r-- | academic/lpsolve/doinst.sh | 9 | ||||
-rw-r--r-- | academic/lpsolve/lpsolve.SlackBuild | 102 | ||||
-rw-r--r-- | academic/lpsolve/lpsolve.info | 10 | ||||
-rw-r--r-- | academic/lpsolve/slack-desc | 19 |
6 files changed, 168 insertions, 0 deletions
diff --git a/academic/lpsolve/README b/academic/lpsolve/README new file mode 100644 index 0000000000..af76613877 --- /dev/null +++ b/academic/lpsolve/README @@ -0,0 +1,3 @@ +lp_solve is a free (see LGPL for the GNU lesser general public license) +linear (integer) programming solver based on the revised simplex method +and the Branch-and-bound method for the integers. diff --git a/academic/lpsolve/cflags.patch b/academic/lpsolve/cflags.patch new file mode 100644 index 0000000000..8e8804cb8c --- /dev/null +++ b/academic/lpsolve/cflags.patch @@ -0,0 +1,25 @@ +diff -ru lp_solve_5.5.orig/lp_solve/ccc lp_solve_5.5/lp_solve/ccc +--- lp_solve_5.5.orig/lp_solve/ccc 2009-02-23 16:31:18.000000000 +0000 ++++ lp_solve_5.5/lp_solve/ccc 2009-02-23 16:31:29.000000000 +0000 +@@ -28,7 +28,7 @@ + fi + rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 + +-opts='-O3' ++opts=$CFLAGS + + def= + if [ "$PLATFORM" = "SCO_UNIX" ] +diff -ru lp_solve_5.5.orig/lpsolve55/ccc lp_solve_5.5/lpsolve55/ccc +--- lp_solve_5.5.orig/lpsolve55/ccc 2009-02-23 16:31:18.000000000 +0000 ++++ lp_solve_5.5/lpsolve55/ccc 2009-02-23 16:31:29.000000000 +0000 +@@ -35,7 +35,7 @@ + so=y + fi + +-opts='-O3' ++opts=$CFLAGS + + $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src + ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` + diff --git a/academic/lpsolve/doinst.sh b/academic/lpsolve/doinst.sh new file mode 100644 index 0000000000..3e5691a052 --- /dev/null +++ b/academic/lpsolve/doinst.sh @@ -0,0 +1,9 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/academic/lpsolve/lpsolve.SlackBuild b/academic/lpsolve/lpsolve.SlackBuild new file mode 100644 index 0000000000..803aee77d6 --- /dev/null +++ b/academic/lpsolve/lpsolve.SlackBuild @@ -0,0 +1,102 @@ +#!/bin/sh + +# Slackware build script for lp_solve + +# Copyright 2014 R. S. Ananda Murthy, Mysore, India +# 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 this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "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 AUTHOR 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. + +PRGNAM=lpsolve +VERSION=${VERSION:-5.5.2.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf lp_solve_5.5 +tar xvf $CWD/lp_solve_5.5.2.0_source.tar.gz +cd lp_solve_5.5 +patch -Np1 -i $CWD/cflags.patch + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +CFLAGS="$SLKCFLAGS" +CXXFLAGS="$SLKCFLAGS" + +# taken from Fedora spec +cd lpsolve55 +sh -x ccc +rm bin/ux*/liblpsolve55.a +cd ../lp_solve +sh -x ccc + +install -dm755 ${PKG}/usr/{bin,lib${LIBDIRSUFFIX},include/lpsolve} +install -m755 $TMP/lp_solve_5.5/lp_solve/bin/ux*/lp_solve ${PKG}/usr/bin/ +install -m755 $TMP/lp_solve_5.5/lpsolve55/bin/ux*/liblpsolve55.so ${PKG}/usr/lib${LIBDIRSUFFIX}/ +install -m644 $TMP/lp_solve_5.5/lp*.h ${PKG}/usr/include/lpsolve/ + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cd $TMP/lp_solve_5.5 +cp -a README.txt $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/doinst.sh > $PKG/install/doinst.sh +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/academic/lpsolve/lpsolve.info b/academic/lpsolve/lpsolve.info new file mode 100644 index 0000000000..2626a68ee0 --- /dev/null +++ b/academic/lpsolve/lpsolve.info @@ -0,0 +1,10 @@ +PRGNAM="lpsolve" +VERSION="5.5.2.0" +HOMEPAGE="http://lpsolve.sourceforge.net/" +DOWNLOAD="http://downloads.sourceforge.net/project/lpsolve/lpsolve/5.5.2.0/lp_solve_5.5.2.0_source.tar.gz" +MD5SUM="167c0fb4ab178e0b7ab50bf0a635a836" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="R. S. Ananda Murthy" +EMAIL="rsamurti@gmail.com" diff --git a/academic/lpsolve/slack-desc b/academic/lpsolve/slack-desc new file mode 100644 index 0000000000..2b4c9df2ce --- /dev/null +++ b/academic/lpsolve/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +lpsolve: lpsolve (A free linear programming solver) +lpsolve: +lpsolve: This is a linear (integer) programming solver based on the revised +lpsolve: simplex method and the Branch-and-bound method for the integers. +lpsolve: +lpsolve: +lpsolve: +lpsolve: +lpsolve: +lpsolve: +lpsolve: |