summaryrefslogtreecommitdiff
path: root/pcr/bison++/PKGBUILD
blob: 502c3297a46b21c8b782846c0671ef01efdbc8a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Contributor (Arch): Antonio Garcia-Dominguez <antonio.garciadominguez@uca.es>
# Maintainer : Parabola GNU / Linux-libre Aurelien Desbrieres <aurelien@cwb.io>

pkgname=bison++
pkgver=1.21.11
pkgrel=1
pkgdesc="Parser generator in C or C++ from BNF notation"
arch=('i686' 'x86_64' 'mips64el')
url="http://packages.debian.org/bison++"
license=('GPL')
source=('http://ftp.de.debian.org/debian/pool/main/b/bison++/bison++_1.21.11.orig.tar.gz' 'http://ftp.de.debian.org/debian/pool/main/b/bison++/bison++_1.21.11-3.diff.gz')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  # Apply the Debian patch
  patch -p1 < ../*.diff

  # Fix the broken Makefile.am script
  sed -e '
    s/datadir/DESTDIR\)\$(datadir/
    s/bindir/DESTDIR\)\$(bindir/
    /^pkgdata_DATA/s/ Example$//
    /install\-exec\-hook/i\install-data-hook:\
\tcp -r $(srcdir)/Example $(DESTDIR)$(pkgdatadir)\
' -i Makefile.am

  # Bootstrap the autotools and compile
  aclocal
  automake --add-missing
  autoreconf
  ./configure --prefix=/usr
  make
}

check() {
  cd "$srcdir/$pkgname-$pkgver"
  make -k check
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install

  # Remove or rename files that could conflict with regular Bison
  rm "$pkgdir/usr/bin/bison"
  mv "$pkgdir/usr/share/info/"{bison,bison++}.info
  rm "$pkgdir/usr/share/man/man1/bison.1"
}

# vim:set ts=2 sw=2 et: