summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fa432cef3ff4e7cc16467d74357c1512af323d3d (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
# Maintainer: Israël Hallé <isra017@gmail.com>
# Contributor: Marcell Meszaros < marcell.meszaros AT runbox.eu >

pkgname=malamute-git
epoch=1
pkgver=1.1.0.r3.g8c5e425
pkgrel=1
pkgdesc="The ZeroMQ Enterprise Messaging Broker"
arch=('x86_64')
depends=('zeromq' 'czmq')
makedepends=('git')
url="https://github.com/zeromq/malamute"
license=('MPL2')
source=(git+https://github.com/zeromq/malamute)
sha256sums=('SKIP')
provides=("${pkgname%-git}=${pkgver%.r*}"
          libmlm.so)
conflicts=("${pkgname%-git}")

pkgver() {
  cd "${pkgname%-git}"

  # Generate git tag based version. Count only proper (v)#.#* [#=number] tags.
  local _gitversion=$(git describe --long --tags --match '[v0-9][0-9.][0-9.]*' | sed -e 's|^v||' | tr '[:upper:]' '[:lower:]')

  # Format git tag based version for pkgver
  # Expected format: e.g. 1.5.0rc2.r521.g99982a1c
  echo "${_gitversion}" | sed \
      -e 's|^\([0-9][0-9.]*\)-\([a-zA-Z]\+\)|\1\2|' \
      -e 's|\([0-9]\+-g\)|r\1|' \
      -e 's|-|.|g'
}

build() {
  cd "${pkgname%-git}"

  msg2 'Building...'
  ./autogen.sh
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --libexecdir=/usr/lib/malamute \
    --sysconfdir=/etc \
    --sharedstatedir=/usr/share/malamute \
    --localstatedir=/var/lib/malamute \
    --with-gnu-ld
  make
}

package() {
  cd "${pkgname%-git}"

  msg2 'Installing license...'
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/malamute"

  msg2 'Installing...'
  make DESTDIR="$pkgdir" install

  msg2 'Cleaning up pkgdir...'
  find "$pkgdir" -type d -name .git -exec rm -r '{}' +
  find "$pkgdir" -type f -name .gitignore -exec rm -r '{}' +
}