summaryrefslogtreecommitdiff
path: root/community/libsieve/PKGBUILD
blob: 245294222c957fd48428a95404bba3eb0ef4145a (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# $Id: PKGBUILD 96725 2013-09-03 13:55:48Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=libsieve
pkgver=2.3.1
pkgrel=3
pkgdesc="sieve interpretator lib"
arch=(i686 x86_64)
url="http://libsieve.sourceforge.net/"
license=('GPL')
options=('!libtool')
source=("https://github.com/downloads/sodabrew/libsieve/libsieve-$pkgver.tar.gz"
	"glibc-regex.patch"
	"crash-fix.patch")
md5sums=('bb48eecf877cc7fdb2b0dfe757b48d7a'
         '0d98d9e8f0583857616b2ba98f1833fa'
         '05ce47217ced05fd32a3ae41dc37f07e')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"
  rm -rf src/sv_regex
  rm -f src/sv_parser/{addr,header,sieve}.{c,h}
  rm -f src/sv_parser/{addr,header,sieve}-lex.{c,h}
  patch -p1 <$srcdir/glibc-regex.patch
  patch -p1 <$srcdir/crash-fix.patch
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  aclocal
  automake
  autoconf
#  export CFLAGS="-g -O2"
#  export LDFLAGS="-g -O2"
  ./configure --prefix=/usr
  (cd src/sv_parser && for i in `ls -1 *.l | sed 's|\.l||'`; do flex --header-file=$i.h -o $i.c $i.l; done)
  make
}

check() {
  cd "$srcdir/$pkgname-$pkgver/src/sv_test"
  export LD_LIBRARY_PATH=$srcdir/libsieve-$pkgver/src/.libs:$LD_LIBRARY_PATH
  ls -1 script* | while read script; do
    ls -1 message* | while read msg; do
      if [ "$script" == "script22.sv" ]; then
        # script22.sv: syntax errors check
        msg "checking !$script $msg"
        ./example $script $msg && false || true
      else
        if [ "$script" == "script23.sv" ]; then
          # script23.sv: enotify looks unsupported or I don't know how to use it - skip it
          msg "skipping $script $msg"
          true
        else
          msg "checking $script $msg"
          ./example $script $msg
        fi
      fi
    done
  done
}

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