Want more features on Pastebin? Sign Up, it's FREE!
Guest

AUR: ziboptsuite-2.1.1-2 PKGBUILD

By: a guest on Mar 13th, 2012  |  syntax: Bash  |  size: 4.44 KB  |  views: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: Johannes Schlatow <johannes.schlatow@googlemail.com>
  2. # Contributor: Stephan Friedrichs <deduktionstheorem@googlemail.com>
  3.  
  4. pkgbase='ziboptsuite'
  5. pkgver='2.1.1'
  6. pkgname=("${pkgbase}" "${pkgbase}-docs")
  7. pkgrel=2
  8. pkgdesc='The ZIB Optimization Suite is a tool for generating and solving mixed integer programs. Consists of ZIMPL, SoPlex and SCIP.'
  9. arch=('i686' 'x86_64')
  10. url='http://zibopt.zib.de/'
  11. license=('LGPL3' 'custom:ZIB Academic License')
  12. depends=('zlib' 'gmp' 'readline')
  13. makedepends=('chrpath' 'doxygen' 'graphviz')
  14. provides=('scip=2.1.1' 'soplex=1.6.0' 'zimpl=3.2.0')
  15. source=(
  16.         "http://zibopt.zib.de/download/${pkgbase}-${pkgver}.tgz"
  17.         'fileio.c.patch'
  18.         )
  19. sha256sums=(
  20.         'f17e78634140c3e903299e22817ad21011ce1bbee44e9bbff858ba95c4bda11a'
  21.         'f89f79036152edfac142ff5edebb4a56626aa67cd212c085551329e1685eedd9'
  22.         )
  23.  
  24. build() {
  25.         # Extract directory names from the $provides array.
  26.         local _scip="${provides[0]//=/-}"
  27.         local _soplex="${provides[1]//=/-}"
  28.         local _zimpl="${provides[2]//=/-}"
  29.  
  30.         cd "${srcdir}/${pkgbase}-${pkgver}"
  31.  
  32.         # Fix compiler error in fileio.c, reported by Tuxe.
  33.         # @FIXME: Remove this in the next version
  34.         if [ ! -d `pwd`/${_scip} ] ; then
  35.                 make `pwd`/${_scip}
  36.                 patch -i "${srcdir}/fileio.c.patch" ${_scip}/src/scip/fileio.c
  37.         fi
  38.  
  39.         make
  40.  
  41.         # A local RPATH is set, get rid of it.
  42.         chrpath --delete ${_scip}/bin/scip
  43.         chrpath --delete ${_soplex}/bin/soplex
  44.  
  45.         cd "${srcdir}/${pkgbase}-${pkgver}/${_scip}"
  46.         make doc
  47.  
  48.         cd "${srcdir}/${pkgbase}-${pkgver}/${_soplex}"
  49.         make doc
  50.  
  51.         # Some files have permission 640.
  52.         # @FIXME: Future versions might not require this line.
  53.         chmod -R a+r "${srcdir}/${pkgbase}-${pkgver}"
  54. }
  55.  
  56. check() {
  57.         cd "${srcdir}/${pkgbase}-${pkgver}"
  58.         make test
  59. }
  60.  
  61. package_ziboptsuite() {
  62.         # Extract directory names from the $provides array
  63.         local _scip="${provides[0]//=/-}"
  64.         local _soplex="${provides[1]//=/-}"
  65.         local _zimpl="${provides[2]//=/-}"
  66.  
  67.         # Note that, at least in ziboptsuite-2.1.0, the install targets of the
  68.         # scip/soplex/zimpl projects are utterly broken; manually copying
  69.         # everything where it belongs is absolutely necessary.
  70.         # @FIXME: Maybe make install will just work in future releases...
  71.  
  72.         cd "${srcdir}/${pkgbase}-${pkgver}"
  73.  
  74.         #
  75.         # Binaries
  76.         #
  77.         install -D -m755 ${_scip}/bin/scip "${pkgdir}/usr/bin/scip"
  78.         install -D -m755 ${_soplex}/bin/soplex "${pkgdir}/usr/bin/soplex"
  79.         install -D -m755 ${_zimpl}/bin/zimpl "${pkgdir}/usr/bin/zimpl"
  80.  
  81.         #
  82.         # Includes
  83.         #
  84.         for dir in blockmemshell dijkstra nlpi objscip scip tclique xml; do
  85.                 mkdir -p "${pkgdir}/usr/include/scip/${dir}"
  86.                 cp ${_scip}/src/${dir}/*.h "${pkgdir}/usr/include/scip/${dir}"
  87.         done
  88.  
  89.         mkdir -p "${pkgdir}/usr/include/"{soplex,zimpl}
  90.         cp ${_soplex}/src/*.h "${pkgdir}/usr/include/soplex"
  91.         cp ${_zimpl}/src/*.h "${pkgdir}/usr/include/zimpl"
  92.  
  93.         #
  94.         # Libraries
  95.         #
  96.         mkdir -p "${pkgdir}/usr/lib"
  97.         cp -d ${_scip}/lib/liblpispx* "${pkgdir}/usr/lib"
  98.         cp -d ${_scip}/lib/libnlpi* "${pkgdir}/usr/lib"
  99.         cp -d ${_scip}/lib/libobjscip* "${pkgdir}/usr/lib"
  100.         cp -d ${_scip}/lib/libscip* "${pkgdir}/usr/lib"
  101.         cp -d ${_soplex}/lib/* "${pkgdir}/usr/lib"
  102.         cp -d ${_zimpl}/lib/* "${pkgdir}/usr/lib"
  103.  
  104.         # Repair "missing links"
  105.         # @FIXME: I hope this is not necessary in future versions!
  106.         cd "${pkgdir}/usr/lib"
  107.         ln -s -T libzimpl-* libzimpl.a
  108.         cd "${srcdir}/${pkgbase}-${pkgver}"
  109.  
  110.         #
  111.         # License
  112.         #
  113.         install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  114. }
  115.  
  116. package_ziboptsuite-docs() {
  117.         # Extract directory names from the $provides array.
  118.         local _scip="${provides[0]//=/-}"
  119.         local _soplex="${provides[1]//=/-}"
  120.         local _zimpl="${provides[2]//=/-}"
  121.  
  122.         # All global PKGBUILD variables are set according to the main
  123.         # package, ziboptsuite. Override those that differ for the
  124.         # documentation, ziboptsuite-docs:
  125.         pkgdesc='The ZIB Optimization Suite documentation.'
  126.         arch=('any')
  127.         depends=()
  128.         provides=()
  129.  
  130.         cd "${srcdir}/${pkgbase}-${pkgver}"
  131.  
  132.         #
  133.         # Documentation
  134.         #
  135.         mkdir -p "${pkgdir}/usr/share/doc/${pkgbase}/"{scip,soplex,zimpl}
  136.         cp -r ${_scip}/{CHANGELOG,release-notes,doc/html} "${pkgdir}/usr/share/doc/${pkgbase}/scip/"
  137.         cp -r ${_soplex}/{CHANGELOG,doc/html} "${pkgdir}/usr/share/doc/${pkgbase}/soplex/"
  138.         install -m644 ${_soplex}/src/simpleexample.cpp "${pkgdir}/usr/share/doc/${pkgbase}/soplex/"
  139.         cp -r ${_zimpl}/{CHANGELOG,README,doc,example} "${pkgdir}/usr/share/doc/${pkgbase}/zimpl/"
  140.  
  141.         #
  142.         # License
  143.         #
  144.         install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  145. }
clone this paste RAW Paste Data