summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 34caf5c8f9b9133247797665ee354d3f007e484e (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# $Id$
# Maintainer: Thomas Hipp <thomashipp at gmail dot com>
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgbase="sqlite-replication"
pkgname=('sqlite-replication' 'sqlite-replication-tcl' 'sqlite-replication-doc' 'sqlite-replication-analyzer')
_srcver=3260000
_docver=${_srcver}
#_docver=3080001
pkgver=3.26.0
pkgrel=1
pkgdesc="A C library that implements an SQL database engine"
arch=('x86_64')
license=('custom:Public Domain')
url="http://www.sqlite.org/"
makedepends=('tcl' 'readline' 'zlib')
source=(https://www.sqlite.org/2018/sqlite-src-${_srcver}.zip
        https://www.sqlite.org/2018/sqlite-doc-${_docver}.zip
        license.txt
        replication.patch)
options=('!emptydirs' '!makeflags') # json extensions breaks parallel build
sha1sums=('a05429d6a8337d60ddc7c6381b49941059a55f68'
          '13c48e0396d15f3f4978214e144445031a23d509'
          'f34f6daa4ab3073d74e774aad21d66878cf26853'
          '163f9030b71267e08fdc63749de18b4e7d204ea5')

prepare() {
  cd sqlite-src-$_srcver
#  autoreconf -vfi
  patch -p1 < ../replication.patch
}

build() {
  export CPPFLAGS="$CPPFLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1 \
                             -DSQLITE_ENABLE_UNLOCK_NOTIFY \
                             -DSQLITE_ENABLE_DBSTAT_VTAB=1 \
                             -DSQLITE_ENABLE_FTS3_TOKENIZER=1 \
                             -DSQLITE_SECURE_DELETE \
                             -DSQLITE_MAX_VARIABLE_NUMBER=250000 \
                             -DSQLITE_MAX_EXPR_DEPTH=10000"

  # build sqlite
  cd sqlite-src-$_srcver
  ./configure --prefix=/usr \
	--disable-static \
	--disable-amalgamation \
	--enable-fts3 \
	--enable-fts4 \
	--enable-fts5 \
	--enable-rtree \
	--enable-json1 \
	--enable-replication \
	TCLLIBDIR=/usr/lib/sqlite$pkgver
  make
  # build additional tools
  make showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
}

package_sqlite-replication() {

 pkgdesc="A C library that implements an SQL database engine"
 depends=('readline' 'zlib')
 provides=("sqlite=$pkgver" "sqlite3=$pkgver")
 replaces=("sqlite3")
 conflicts=("sqlite")

  cd sqlite-src-$_srcver
  make DESTDIR=${pkgdir} install

  install -m755 showdb showjournal showstat4 showwal sqldiff ${pkgdir}/usr/bin/

  # install manpage
  install -m755 -d ${pkgdir}/usr/share/man/man1
  install -m644 sqlite3.1 ${pkgdir}/usr/share/man/man1/

  # license - no linking required because pkgbase=pkgname
  install -D -m644 ${srcdir}/license.txt ${pkgdir}/usr/share/licenses/${pkgbase}/license.txt

  # split out tcl extension
  mkdir $srcdir/tcl
  mv $pkgdir/usr/lib/sqlite* $srcdir/tcl
}

package_sqlite-replication-tcl() {

 pkgdesc="sqlite Tcl Extension Architecture (TEA)"
 depends=('sqlite')
 provides=("sqlite-tcl=$pkgver" "sqlite3-tcl=$pkgver")
 replaces=("sqlite3-tcl")
 conflicts=("sqlite-tcl")

  install -m755 -d ${pkgdir}/usr/lib
  mv $srcdir/tcl/* ${pkgdir}/usr/lib

  # install manpage
  install -m755 -d ${pkgdir}/usr/share/man/mann
  install -m644 ${srcdir}/sqlite-src-$_srcver/autoconf/tea/doc/sqlite3.n ${pkgdir}/usr/share/man/mann/

  # link license
  install -m755 -d ${pkgdir}/usr/share/licenses
  ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
}

package_sqlite-replication-analyzer() {

 pkgdesc="An analysis program for sqlite3 database files"
 depends=('sqlite' 'tcl')
 provides=("sqlite-analyzer=$pkgver")
 conflicts=("sqlite-analyzer")

  cd sqlite-src-$_srcver
  install -m755 -d ${pkgdir}/usr/bin
  install -m755 sqlite3_analyzer ${pkgdir}/usr/bin/
}

package_sqlite-replication-doc() {

 pkgdesc="most of the static HTML files that comprise this website, including all of the SQL Syntax and the C/C++ interface specs and other miscellaneous documentation"
 #arch=('any') - not yet supported
 provides=("sqlite-doc=$pkgver" "sqlite3-doc=$pkgver")
 replaces=("sqlite3-doc")
 conflicts=("sqlite-doc")

  cd sqlite-doc-${_docver}
  mkdir -p ${pkgdir}/usr/share/doc/${pkgbase}
  cp -R *  ${pkgdir}/usr/share/doc/${pkgbase}/
}