summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 11cc4f84619e26f6cc30924e58eedb7cc6b4e78c (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
# $Id$
# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Roman Kyrylych <roman@archlinux.org>
# Contributor: Aurelien Foret <orelien@chez.com>

_gitname=gnokii
pkgname=${_gitname}-git
pkgver=r5011.ae49546c
pkgrel=1
pkgdesc="Tools and user space driver for use with mobile phones"
arch=('i686' 'x86_64')
url="http://www.gnokii.org/"
license=('GPL')
depends=('libusb-compat' 'libxpm' 'bluez-libs' 'libical' 'sqlite')
makedepends=('git' 'gtk2' 'libmariadbclient' 'postgresql-libs' 'intltool')
optdepends=('dialog: sendsms tool'
            'gtk2: xgnokii GUI'
            'libmariadbclient: smsd mysql backend'
            'postgresql-libs: smsd postgresql backend')
conflicts=('gnokii')
backup=('etc/gnokiirc')
install="${_gitname}.install"
source=("${_gitname}::git://git.savannah.nongnu.org/${_gitname}.git"
        'codeset.m4::https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=m4/codeset.m4'
        'gnokii-config.patch'
        'gnokii-lock.patch'
        'gnokii-gcc5.patch')
md5sums=('SKIP'
         '47adaa4476f249a93ad19713a29a4df7'
         'b2961b52ac1f770c4704ccc50b64fde2'
         '17b629db85a6bb2b98ca59941aa95295'
         'e32f023dfd59e13ef7741118239c2145')

pkgver() {
  cd "${srcdir}/${_gitname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd ${_gitname}

  cp "${srcdir}/codeset.m4" "m4/"

  # Set bindir location
  patch -Np1 -i "${srcdir}/gnokii-config.patch"

  # Set lock path
  patch -Np1 -i "${srcdir}/gnokii-lock.patch"

  # Fix build with GCC 5 (Fedora patch)
  patch -Np1 -i "$srcdir/gnokii-gcc5.patch"
}

build() {
  cd ${_gitname}

  libtoolize -c -f
  glib-gettextize -f
  intltoolize --force --copy --automake
  aclocal -I m4
  autoheader -I m4
  automake --add-missing
  autoconf

  ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin \
              --disable-static --enable-security
  make
  pushd xgnokii
  make
  popd
}

package() {
  cd ${_gitname}

  make DESTDIR="${pkgdir}" install
  pushd xgnokii
  make DESTDIR="${pkgdir}" install
  popd

  # Install inital config file
  install -Dm644 Docs/sample/gnokiirc "${pkgdir}/etc/gnokiirc"

  # Fix file permission
  chmod 755 "${pkgdir}/usr/bin/sendsms"
}