archrelease: copy trunk to extra-x86_64
[arch-packages.git] / clucene / trunk / PKGBUILD
blobc79b1beabf2cd86e044b395227e954ee77a1646d
1 # Maintainer: AndyRTR <andyrtr@archlinux.org>
2 # Contributor: Alexander Rødseth
3 # Contributor: Alois Nespor <alois.nespor@gmail.com>
4 # Contributor: Tobias Powalowski <tpowa@archlinux.org>
6 pkgname=clucene
7 pkgver=2.3.3.4
8 pkgrel=14
9 pkgdesc="C++ port of the high-performance text search engine Lucene"
10 arch=('x86_64')
11 url="http://clucene.sourceforge.net/"
12 license=('APACHE' 'LGPL')
13 depends=('gcc-libs>=4.7.1-5' 'zlib')
14 makedepends=('cmake' 'boost>=1.54.0')
15 source=(https://downloads.sourceforge.net/$pkgname/$pkgname-core-$pkgver.tar.gz
16         # Fedora patches
17         clucene-core-2.3.3.4-pkgconfig.patch
18         clucene-core-2.3.3.4-install_contribs_lib.patch
19         0001-Fix-missing-include-time.h.patch
20         # upstream patch
21         fix_zlib_detections.diff
22         # LibreOffice patches
23         clucene-warnings.patch
24         clucene-gcc-atomics.patch
25         clucene-debug.patch
26         clucene-narrowing-conversions.patch
27         clucene-multimap-put.patch)
28 sha512sums=('1c9da9077edcebd46563bd9e47d330518e0b30061016650a759cfe051e9748fdad8932a472b1cca53a6adafed5f41656527271fc5f55ddfcefb558f0d83286b4'
29             'b357cb5a1c5d66219f3168724a71af3ebf5c45c752a612d3a69c170b739acc065dc17c261c3a730298ea6c637fe820637a100f73ab03d931734f80bb598fbf55'
30             '0aa92635949089196e4e7c579e78761e8751987ef5036320a161a4aaa67da3c63756398c903419c76ea0fbdc8a949e871fcb65be98179a9853a24a5a4cacfde3'
31             'f606481b3bae44487a05e81da1e19dfa0bc5db8b10832d5b84c4e269fecb99ad010b90c5132e618c300f32b8c5bf28cfd0038c4ca2ddb4870c5a3f5113a18e64'
32             '883cdd389a1f6f9483250cf55030b944f5a0b5e82607f9a71ead0abaa2a9a0f08bc339ffe0518c78b65ad543e659a9eee35555a7bd9abbdae9d5204499ac039f'
33             'd74c3e4cccbb05b576c063c8e25a67546b70c5bc59f2ee62be8a7095ae90020278709df79316b0f233153a76968abf465d933a81706ee2e68583f6bf921e6604'
34             'c2ed8a7e7612a47e1f49266f0ea07a2a29a9d5db2b7d6f5079c031cd6edef7f39b0d771ee6f88665957d798be05ff83fd8a93cc9a84b414d84ed3344034bd0de'
35             'd1de3ffba0ec3f5cf54c86339182355809be28e43245e49b3f78b43e8e8572fa6e7ca5ed174c22cc6792a678157a61f30773e3c2243f199d5178b6929f34bd41'
36             'f39f36b385f09722026a7759ee49b89ec6b5f06db0d56b472628cc68fd9badd35cc6b977122eb8e6ae108fa71b075315377ee83e9fc85e2d1722c434cfdc18b4'
37             '07c8b496045e5d9d4256ad854734d6228abb67455f2349b20173d42fc733cb0663559818542c257ef2cdd84e6d08f673bfea38591087498e2e2466f555af3b04')
39 prepare() {
40   cd "$srcdir"/$pkgname-core-$pkgver
42   # add missing contrib-libs needed by LibO 3.6, patch by FC
43   patch -Np1 -i "${srcdir}"/clucene-core-2.3.3.4-install_contribs_lib.patch
44   # pkgconfig file is missing clucene-shared (upstream ID: 3461512), patch by FC
45   patch -Np1 -i "${srcdir}"/clucene-core-2.3.3.4-pkgconfig.patch
46   # one upstream postrelease commit for proper zlib detection
47   patch -Np1 -i "${srcdir}"/fix_zlib_detections.diff
48   # LibreOffice patches http://cgit.freedesktop.org/libreoffice/core/tree/clucene/patches
49   patch -Np0 -i "${srcdir}"/clucene-warnings.patch
50   patch -Np0 -i "${srcdir}"/clucene-gcc-atomics.patch
51   patch -Np0 -i "${srcdir}"/clucene-debug.patch
52   patch -Np0 -i "${srcdir}"/clucene-narrowing-conversions.patch
53   patch -Np0 -i "${srcdir}"/clucene-multimap-put.patch
55   # FS#77036 / https://sourceforge.net/p/clucene/bugs/235/ 
56   patch -Np1 -i ../0001-Fix-missing-include-time.h.patch
58   # nuke bundled code
59   rm -rfv src/ext/{boost/,zlib/}
61   mkdir build
64 build() {
65   cd "$srcdir"/$pkgname-core-$pkgver
66   pushd build
67   cmake .. \
68     -DCMAKE_BUILD_TYPE=Release \
69     -DCMAKE_INSTALL_PREFIX=/usr \
70     -DENABLE_ASCII_MODE=OFF \
71     -DENABLE_PACKAGING=OFF \
72     -DBUILD_CONTRIBS_LIB:BOOL=ON \
73     -DLIB_DESTINATION:PATH=/usr/lib \
74     -DLUCENE_SYS_INCLUDES:PATH=/usr/lib \
75     -DDISABLE_MULTITHREADING=OFF
76   popd
77   make -C build
80 #check() {
81 #  cd $srcdir/$pkgname-core-$pkgver
82 #  make cl_test -C build
83 #  make test -C build || /bin/true # currently fails the tests as expected (see FC comment)
86 package() {
87   cd "$srcdir"/$pkgname-core-$pkgver
88   make DESTDIR="$pkgdir" install -C build
89   rm -rfv "$pkgdir"/usr/lib/CLuceneConfig.cmake
90   
91   cd "$pkgdir"/usr/include//CLucene
92   ln -s /usr/lib/CLucene/clucene-config.h .