updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / minizinc-bin / PKGBUILD
blob6c29d7d0b7f0cb389be7485636fd0d7337236255
1 # $Id: PKGBUILD 307 2011-11-04 06:43:22Z shtrom $
2 # Contributor: Olivier Mehani <shtrom-aur@ssji.net>
3 _appname=minizinc
4 pkgname=${_appname}-bin
5 pkgver=1.4
6 pkgrel=1
7 pkgdesc="MiniZinc is a modelling language for constraint programming problems (upstream binaries)"
8 arch=(i686 x86_64)
9 url="http://www.g12.cs.mu.oz.au/minizinc/"
10 license=('custom:BSD-Nicta')
11 conflicts=(minizinc)
12 provides=(minizinc)
13 optdepends=('vim: a versatile editor (for which Zinc support files are provided)')
14 _targetspec=i686-pc-linux-gnu
15 md5sums=('237ecb8f4980f309563714ab83fbcef4')
16 if [ $CARCH = x86_64 ]; then
17   _targetspec=x86_64-unknown-linux-gnu
18 md5sums=('95baca944eca05073f00120cc89dc36c')
20 source=(http://www.g12.cs.mu.oz.au/minizinc/downloads/release-${pkgver}/${_appname}-${pkgver}-${_targetspec}.tar.gz)
22 build() {
23   mkdir -p ${pkgdir}/usr/{bin,lib,share/{vim/vimfiles/syntax/,doc/,{,licenses/}${_appname}/}}
25   find ${srcdir}/${_appname}-${pkgver}/bin -type f -exec install -D -m 0755 {} ${pkgdir}/usr/bin/ \;
26   cp -R ${srcdir}/${_appname}-${pkgver}/lib/minizinc/ ${pkgdir}/usr/lib/
27   cp -R ${srcdir}/${_appname}-${pkgver}/{benchmarks,examples,fcts,scripts,tests,xml} \
28     ${pkgdir}/usr/share/${_appname} 
29   cp -R ${srcdir}/${_appname}-${pkgver}/doc ${pkgdir}/usr/share/doc/${_appname}
30   mv ${pkgdir}/usr/bin/mzn2fzn ${pkgdir}/usr/bin/mzn2fzn-actual
31   mv ${pkgdir}/usr/share/doc/${_appname}/man/ ${pkgdir}/usr/
33   cat > ${pkgdir}/usr/bin/mzn2fzn << 'EOF'
34 #!/bin/sh
36 export MZN_STDLIB_DIR="/usr/lib/minizinc"
37 exec "/usr/bin/mzn2fzn-actual" "$@"
38 EOF
40   chmod a+x ${pkgdir}/usr/bin/mzn2fzn
41   chmod -R a+r ${pkgdir}
42   find ${pkgdir} -type d -exec chmod a+x {} \;
44   install -D -m 0644 ${srcdir}/${_appname}-${pkgver}/tools/vim/zinc.vim \
45     ${pkgdir}/usr/share/vim/vimfiles/syntax/
46   install -D -m 0644 ${srcdir}/${_appname}-${pkgver}/COPYING \
47     ${pkgdir}/usr/share/licenses/${_appname}/COPYING
50 # vim:set ts=2 sw=2 et: