1 # Contributor: Francois Charette <firmicus at gmx dot net>
7 pkgdesc="The Berkeley DB embeddable XML database with XQuery-based access"
10 url="http://www.oracle.com/technology/products/berkeley-db/xml/index.html"
11 depends=('db' 'perl' 'xerces-c')
13 options=('!libtool' '!emptydirs')
14 source=("http://download-uk.oracle.com/berkeley-db/dbxml-$pkgver.tar.gz" \
15 "http://download-uk.oracle.com/berkeley-db/db-${_dbver}.tar.gz" \
16 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.1' \
17 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.2' \
18 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.3' \
19 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.4' \
20 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.5' \
21 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.6' \
22 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.7' \
23 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.8' \
24 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.9' \
25 'http://www.oracle.com/technology/products/berkeley-db/xml/update/2.3.10/patch.2.3.10.10' \
26 'os_clock.patch' 'perlfix.patch')
28 install=(dbxml.install)
29 md5sums=('7c4ae3239050b111e2263064ed0c86c3'
30 '718082e7e35fc48478a2334b0bc4cd11'
31 '57abfcf66d70691144980a6108a6ba40'
32 'ef53e9562c9df814ced9d7b28383734f'
33 '00c68513b80032b74a1956170dc371be'
34 'd09fb9af985e99985295a8ca5641d832'
35 'de531b5f524db240cbbbd30965dcec05'
36 '40152f5bca3871b81b5dc15e6bf42520'
37 '4758cb9c985ab3acea5655f474bb6aad'
38 'a5d5b0a9eaada76ff12d33a7f4427040'
39 '4e78e05338033cdc8a8b37aba6406801'
40 '715c28c2b8e79c33e9103c8322e4a99f'
41 'd5db85c0b45b13ef761e402428e6872d'
42 '2ea05323447c8684f388ab54aae1b475')
45 echo ">> replacing included db version 4.5.20 by ver 4.6.21"
46 rm -rf dbxml-$pkgver/db-4.5.20
47 mv db-${_dbver} dbxml-$pkgver/
48 echo ">> applying upstream patches"
49 for i in 1 2 3 4 5 6 7 8 9 10 ; do
50 patch -p0 <patch.$pkgver.$i || return 1
52 echo ">> Additional patches"
53 patch -p0 < os_clock.patch || return 1
54 patch -p0 < perlfix.patch || return 1
55 ## the easy way would be:
56 #chmod a+x buildall.sh
57 #./buildall.sh --prefix=$startdir/pkg/usr --enable-perl
58 ## but that would lead to conflict with db and xerces-c pkgs
59 ## so instead we do it all by hand
60 echo ">> Building (dummy) Berkeley db <<"
61 cd $startdir/src/$pkgname-$pkgver/db-${_dbver}/build_unix
63 ../dist/configure --prefix=$startdir/src/$pkgname-$pkgver/db-${_dbver}/install \
64 --enable-java --enable-cxx || return 1
66 make install || return 1
68 echo ">> Building (dummy) xerces-c libraries <<"
69 XERCESCROOT=$startdir/src/$pkgname-$pkgver/xerces-c-src
71 XERCES_INSTALL_DIR=$XERCESCROOT/install
72 mkdir $XERCES_INSTALL_DIR
73 cd $XERCESCROOT/src/xercesc
74 ./runConfigure -plinux -b32 -P$XERCES_INSTALL_DIR || return 1
76 make install || return 1
78 echo ">> Building xqilla libraries <<"
79 cd $startdir/src/$pkgname-$pkgver/xqilla/
82 ../configure --prefix=$startdir/pkg/usr \
83 --with-xerces=$XERCESCROOT || return 1
85 make install || return 1
87 echo ">> Building dbxml <<"
88 cd $startdir/src/$pkgname-$pkgver/dbxml/build_unix
89 ../dist/configure --prefix=$startdir/pkg/usr \
91 --with-xqilla=$startdir/pkg/usr \
92 --with-xerces=$XERCES_INSTALL_DIR \
93 --with-berkeleydb=$startdir/src/$pkgname-$pkgver/db-${_dbver} \
94 --with-dbbuild=../../db-${_dbver} || return 1
96 make install || return 1
98 echo ">> Building perl library <<"
99 cd $startdir/src/$pkgname-$pkgver/dbxml/src/perl
100 # we must change BDB_LIB_PATH and BDB_LIB_INCLUDE to /usr/lib and /usr/include
101 sed -e 's|^BDB_LIB_PATH.\+$|BDB_LIB_PATH = /usr/lib|' \
102 -e 's|^BDB_INC_PATH.\+$|BDB_INC_PATH = /usr/include|' -i config
103 perl Makefile.PL INSTALLDIRS=vendor || return 1
104 make MAN1EXT=1p MAN3EXT=3pm || return 1
105 make MAN1EXT=1p MAN3EXT=3pm DESTDIR=$startdir/pkg install
106 find $startdir/pkg -name '.packlist' -delete
107 find $startdir/pkg -name '*.pod' -delete
109 # echo ">> Building python library"
110 # cd $startdir/src/$pkgname-$pkgver/dbxml/src/python
111 # python setup.py build >> THIS BREAKS!
112 # python setup.py install
114 # PHP bindings: see .../dbxml/src/PHP/README
117 rm -rf $startdir/pkg/usr/docs
118 # install java driver for db
119 install -m644 ${startdir}/src/${pkgname}-${pkgver}/db-${_dbver}/install/lib/db.jar ${startdir}/pkg/usr/lib/
120 mkdir -p ${startdir}/pkg/usr/share/licenses/${pkgname}
121 install -m644 ${startdir}/src/${pkgname}-${pkgver}/dbxml/LICENSE ${startdir}/pkg/usr/share/licenses/${pkgname}/LICENSE
122 install -m644 ${startdir}/src/${pkgname}-${pkgver}/xqilla/LICENSE ${startdir}/pkg/usr/share/licenses/${pkgname}/LICENSE.xqilla
123 install -m644 ${startdir}/src/${pkgname}-${pkgver}/xqilla/LICENSE.*.txt ${startdir}/pkg/usr/share/licenses/${pkgname}/