summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c73e12f1450d1a954c616405b1683a9511a14b9f (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
# Maintainer: Nikolay Korotkiy <sikmir@gmail.com>
_orgname=huzheng001
_pkgname=stardict-3
_basever=3.0.6
pkgname=stardict-tools-git
pkgver=3.0.6.r661.8c5c269
pkgrel=1
pkgdesc='Stardict tools'
arch=('i686' 'x86_64')
url='http://www.huzheng.org/stardict/'
license=('GPLv3')
depends=('gtk3' 'glib2' 'libmariadbclient')
makedepends=('git' 'intltool')
provides=("${pkgname//-git}=${pkgver}")
conflicts=(${pkgname//-git})
source=("${_pkgname}::git://github.com/${_orgname}/${_pkgname}.git")
sha256sums=('SKIP')

pkgver() {
  cd ${_pkgname}

  count="$(git rev-list --count HEAD)"
  head="$(git rev-parse --short HEAD)"

  printf "%s.r%s.%s" "${_basever}" "${count}" "${head}"
}

prepare() {
  cd ${_pkgname}/tools/src

  sed -i 's/noinst_PROGRAMS =/bin_PROGRAMS =/' Makefile.am
  sed -i 's/MYSQL_PORT/0/' wikipediaImage.cpp
}

build() {
  cd ${_pkgname}

  ./autogen.sh
  ./configure --prefix=/usr --disable-dict
  make
}

package() {
  cd ${_pkgname}

  make DESTDIR=$pkgdir/ install
  find $pkgdir/usr/bin/ -not -name 'stardict-*' -type f | \
    sed 'p;s#bin/#bin/stardict-#' | xargs -n2 mv
}