summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 756e59e8b893c522fe4d2e3f15d0cfbec2e9f925 (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
# Maintainer: Thomas Krug <t.krug@elektronenpumpe.de>
# Contributor: Thomas Krug <t.krug@elektronenpumpe.de>

pkgname=mosquitto-hg
_hgname=mosquitto
pkgver=r3142.16b70372e2c4
pkgrel=1
pkgdesc="An Open Source MQTT v3.1 Broker"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h')
url="http://mosquitto.org/"
depends=('openssl')
makedepends=('mercurial' 'python' 'docbook-xsl')
conflicts=('mosquitto')
provides=('mosquitto')
license=('BSD')
install=$pkgname.install
source=("$_hgname::hg+https://bitbucket.org/oojah/mosquitto#branch=1.2"
        'mosquitto.service'
        'docbook.patch'
        'usr_move.patch')
md5sums=('SKIP'
         'bac7f1ff5c13b9e04e82c875c5f2c422'
         '8f6f9ab9205f9cfd9148f5372a6dabc6'
         'b37551bbdccf751cdc5ea5b25afd2f5a')

pkgver() {
  cd "$srcdir/$_hgname"

  echo r$(hg identify -n).$(hg identify -i)
}

build() {
  cd "$srcdir/$_hgname"

  patch -p1 < ../docbook.patch
  patch -p1 < ../usr_move.patch

  make
}

package() {
  cd "$srcdir/$_hgname"

  make prefix=/usr DESTDIR="$pkgdir/" install

  # systemd service file
  install -Dm644 "$srcdir/mosquitto.service" "$pkgdir/usr/lib/systemd/system/mosquitto.service"
  echo 'pid_file /run/mosquitto.pid' >> "$pkgdir/etc/mosquitto/mosquitto.conf"

  # license files
  install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 LICENSE-3rd-party.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE-3rd-party"
}

# vim:set ts=2 sw=2 et: