scripts/rpmbuild-glpk
author deba
Sun, 25 Nov 2007 22:56:44 +0000
changeset 2521 05c0ba99cc27
parent 2237 5674a5983e1e
permissions -rwxr-xr-x
Bugfix: using read-write map instead reference map
alpar@2237
     1
#!/bin/bash
alpar@2237
     2
alpar@2237
     3
case $# in
alpar@2237
     4
    1)
alpar@2237
     5
	RELEASE=1
alpar@2237
     6
	;;
alpar@2237
     7
    2)
alpar@2237
     8
	RELEASE=$2
alpar@2237
     9
	;;
alpar@2237
    10
    *)
alpar@2237
    11
	echo "Usage: rpmbuild-glpk tarfile [release]"
alpar@2237
    12
	;;	
alpar@2237
    13
esac
alpar@2237
    14
alpar@2237
    15
alpar@2237
    16
ORIGTAR=$1
alpar@2237
    17
VERSION=`echo ${ORIGTAR/.tar.gz}|tr - ' '|awk '{print $(NF)}'`
alpar@2237
    18
alpar@2237
    19
echo "GLPK VERSION: $VERSION"
alpar@2237
    20
echo "     RELEASE: $RELEASE"
alpar@2237
    21
alpar@2237
    22
alpar@2237
    23
set -e
alpar@2237
    24
alpar@2237
    25
function make-dir () {
alpar@2237
    26
    if [ ! -d $1 ]; then
alpar@2237
    27
	mkdir $1
alpar@2237
    28
    fi
alpar@2237
    29
}
alpar@2237
    30
alpar@2237
    31
rm -rf glpk-tmp
alpar@2237
    32
make-dir glpk-tmp
alpar@2237
    33
alpar@2237
    34
cd glpk-tmp
alpar@2237
    35
alpar@2237
    36
tar xzf $ORIGTAR
alpar@2237
    37
alpar@2237
    38
echo 'Summary: GNU Linear Programming toolKit
alpar@2237
    39
Name: glpk
alpar@2237
    40
Version: '${VERSION}'
alpar@2237
    41
Release: '${RELEASE}'
alpar@2237
    42
License: GPL
alpar@2237
    43
URL: http://www.gnu.org/software/glpk/glpk.html
alpar@2237
    44
Source0: %{name}-%{version}.tar.gz
alpar@2237
    45
Group: Development/Libraries
alpar@2237
    46
BuildRoot: %{_tmppath}/%{name}-root
alpar@2237
    47
Provides: glpk = '${VERSION}-${RELEASE}'
alpar@2237
    48
Provides: glpk-devel = '${VERSION}-${RELEASE}'
alpar@2237
    49
alpar@2237
    50
%description
alpar@2237
    51
The GLPK package is a set of routines written in ANSI C and organized
alpar@2237
    52
in the form of a callable library. This package is intended for solving
alpar@2237
    53
large-scale linear programming (LP), mixed integer linear programming
alpar@2237
    54
(MIP), and other related problems.
alpar@2237
    55
alpar@2237
    56
The GLPK package includes the following main components:
alpar@2237
    57
alpar@2237
    58
* implementation of the simplex method;
alpar@2237
    59
* implementation of the primal-dual interior-point method;
alpar@2237
    60
* implementation of the branch-and-bound method;
alpar@2237
    61
* application program interface (API);
alpar@2237
    62
* GNU MathProg modeling language (a subset of AMPL);
alpar@2237
    63
* GLPSOL, a stand-alone LP/MIP solver.
alpar@2237
    64
alpar@2237
    65
See GLPK webpage <http://www.gnu.org/software/glpk/glpk.html>.
alpar@2237
    66
alpar@2237
    67
%prep
alpar@2237
    68
%setup -q
alpar@2237
    69
alpar@2237
    70
%build
alpar@2237
    71
%configure
alpar@2237
    72
make
alpar@2237
    73
alpar@2237
    74
%install
alpar@2237
    75
rm -rf $RPM_BUILD_ROOT
alpar@2237
    76
make DESTDIR=$RPM_BUILD_ROOT install
alpar@2237
    77
alpar@2237
    78
%clean
alpar@2237
    79
rm -rf $RPM_BUILD_ROOT
alpar@2237
    80
alpar@2237
    81
%post -p /sbin/ldconfig
alpar@2237
    82
alpar@2237
    83
%postun -p /sbin/ldconfig
alpar@2237
    84
alpar@2237
    85
%files
alpar@2237
    86
%defattr(-,root,root)
alpar@2237
    87
%{_bindir}/glpsol
alpar@2237
    88
%{_includedir}
alpar@2237
    89
%{_libdir}/lib*
alpar@2237
    90
%doc AUTHORS COPYING NEWS README
alpar@2237
    91
'>glpk-${VERSION}/glpk.spec
alpar@2237
    92
alpar@2237
    93
tar czf glpk-${VERSION}.tar.gz glpk-${VERSION}
alpar@2237
    94
rpmbuild -ta glpk-${VERSION}.tar.gz
alpar@2237
    95
alpar@2237
    96
cd ..
alpar@2237
    97
rm -rf glpk-tmp