scripts/rpmbuild-glpk
changeset 2237 5674a5983e1e
child 2484 51995c1f1093
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/rpmbuild-glpk	Thu Oct 12 10:56:26 2006 +0000
     1.3 @@ -0,0 +1,98 @@
     1.4 +#!/bin/bash
     1.5 +
     1.6 +case $# in
     1.7 +    1)
     1.8 +	RELEASE=1
     1.9 +	;;
    1.10 +    2)
    1.11 +	RELEASE=$2
    1.12 +	;;
    1.13 +    *)
    1.14 +	echo "Usage: rpmbuild-glpk tarfile [release]"
    1.15 +	;;	
    1.16 +esac
    1.17 +
    1.18 +
    1.19 +ORIGTAR=$1
    1.20 +VERSION=`echo ${ORIGTAR/.tar.gz}|tr - ' '|awk '{print $(NF)}'`
    1.21 +
    1.22 +echo "GLPK VERSION: $VERSION"
    1.23 +echo "     RELEASE: $RELEASE"
    1.24 +
    1.25 +
    1.26 +set -e
    1.27 +
    1.28 +function make-dir () {
    1.29 +    if [ ! -d $1 ]; then
    1.30 +	mkdir $1
    1.31 +    fi
    1.32 +}
    1.33 +
    1.34 +rm -rf glpk-tmp
    1.35 +make-dir glpk-tmp
    1.36 +
    1.37 +cd glpk-tmp
    1.38 +
    1.39 +tar xzf $ORIGTAR
    1.40 +
    1.41 +echo 'Summary: GNU Linear Programming toolKit
    1.42 +Name: glpk
    1.43 +Version: '${VERSION}'
    1.44 +Release: '${RELEASE}'
    1.45 +License: GPL
    1.46 +URL: http://www.gnu.org/software/glpk/glpk.html
    1.47 +Source0: %{name}-%{version}.tar.gz
    1.48 +Group: Development/Libraries
    1.49 +BuildRoot: %{_tmppath}/%{name}-root
    1.50 +Provides: glpk = '${VERSION}-${RELEASE}'
    1.51 +Provides: glpk-devel = '${VERSION}-${RELEASE}'
    1.52 +
    1.53 +%description
    1.54 +The GLPK package is a set of routines written in ANSI C and organized
    1.55 +in the form of a callable library. This package is intended for solving
    1.56 +large-scale linear programming (LP), mixed integer linear programming
    1.57 +(MIP), and other related problems.
    1.58 +
    1.59 +The GLPK package includes the following main components:
    1.60 +
    1.61 +* implementation of the simplex method;
    1.62 +* implementation of the primal-dual interior-point method;
    1.63 +* implementation of the branch-and-bound method;
    1.64 +* application program interface (API);
    1.65 +* GNU MathProg modeling language (a subset of AMPL);
    1.66 +* GLPSOL, a stand-alone LP/MIP solver.
    1.67 +
    1.68 +See GLPK webpage <http://www.gnu.org/software/glpk/glpk.html>.
    1.69 +
    1.70 +%prep
    1.71 +%setup -q
    1.72 +
    1.73 +%build
    1.74 +%configure
    1.75 +make
    1.76 +
    1.77 +%install
    1.78 +rm -rf $RPM_BUILD_ROOT
    1.79 +make DESTDIR=$RPM_BUILD_ROOT install
    1.80 +
    1.81 +%clean
    1.82 +rm -rf $RPM_BUILD_ROOT
    1.83 +
    1.84 +%post -p /sbin/ldconfig
    1.85 +
    1.86 +%postun -p /sbin/ldconfig
    1.87 +
    1.88 +%files
    1.89 +%defattr(-,root,root)
    1.90 +%{_bindir}/glpsol
    1.91 +%{_bindir}/tspsol
    1.92 +%{_includedir}
    1.93 +%{_libdir}/lib*
    1.94 +%doc AUTHORS COPYING NEWS README
    1.95 +'>glpk-${VERSION}/glpk.spec
    1.96 +
    1.97 +tar czf glpk-${VERSION}.tar.gz glpk-${VERSION}
    1.98 +rpmbuild -ta glpk-${VERSION}.tar.gz
    1.99 +
   1.100 +cd ..
   1.101 +rm -rf glpk-tmp