updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / dmd2-bin / PKGBUILD
blob736198aabac66c2efe77026255a581dec4e624f5
1 # Maintainer: Mihail Strashun <m.strashun@gmail.com> aka Volfram
2 pkgname=dmd2-bin
3 pkgver=2.052
4 pkgrel=3
5 pkgdesc="The Digital Mars D compiler (D2 version)"
6 arch=('i686' 'x86_64')
7 url="http://www.digitalmars.com/d/2.0/"
8 source=(http://ftp.digitalmars.com/dmd.$pkgver.zip)
9 md5sums=('133e80a929eaeddc9fe8964bbfa4cc4f' )
10 provides=('d-compiler='$pkgver 'dmd2='$pkgver)
11 license=('custom')
12 options=('!strip' 'docs')
13 depends=('gcc-libs')
14 optdepends=('libphobos2: Standard D language library & runtime')
16 if [ $CARCH = 'x86_64' ]
17 then
18         archstr="64"
21 if [ $CARCH = 'i686' ]
22 then 
23         archstr="32"
26 build() {
27    # Copy the license.
28    install -Dm644 $srcdir/dmd2/license.txt $pkgdir/usr/share/licenses/dmd/COPYING
30    # Copy binaries
31    install -Dm755 $srcdir/dmd2/linux/bin/dmd $pkgdir/usr/bin/dmd
32    install -Dm755 $srcdir/dmd2/linux/bin/dumpobj $pkgdir/usr/bin/dumpobj
33    install -Dm755 $srcdir/dmd2/linux/bin/obj2asm $pkgdir/usr/bin/obj2asm
34    install -Dm755 $srcdir/dmd2/linux/bin/rdmd $pkgdir/usr/bin/rdmd
35    echo -e "[Environment]\nDFLAGS=-m$archstr -I/usr/include/d -I/usr/include/d/druntime/import -L-L/usr/lib -L-lrt" > $startdir/dmd.conf
36    install -Dm644 $startdir/dmd.conf $pkgdir/etc/dmd.conf 
38    for x in $srcdir/dmd2/man/man1/*.1; do
39        install -Dm644 $x "$pkgdir/usr/share/man/man1/$(basename $x)"
40    done
42    for x in $srcdir/dmd2/man/man1/*.5; do
43        install -Dm644 $x "$pkgdir/usr/share/man/man5/$(basename $x)"
44    done
46    # Copy documentation
47    mkdir -p $pkgdir/usr/share/doc/d/phobos
48    docs="$srcdir/dmd2/html/d"
49    for x in $(find $docs/*.html $docs/*.gif $docs/*.ico $docs/*.jpg $docs/*.css); do
50        install -Dm644 $x "$pkgdir/usr/share/doc/d/$(basename $x)"
51    done
53    for x in $(find $docs/phobos/*.html $docs/phobos/*.gif $docs/phobos/*.css); do
54        install -Dm644 $x "$pkgdir/usr/share/doc/d/phobos/$(basename $x)"
55    done