summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8512d4c7444b6dc7cda1cfc889a7ce87a88ae544 (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
# Maintainer: Daniel Bermond < gmail-com: danielbermond >

pkgname=libumem-git
_srcname=portableumem
pkgver=1.0.r15.g3fc772c
pkgrel=5
pkgdesc='A port of the Solaris libumem memory allocator'
arch=('x86_64')
url='https://github.com/omniti-labs/portableumem/'
license=('custom')
depends=('glibc')
makedepends=('git')
provides=('libumem')
conflicts=('libumem')
source=('git+https://github.com/omniti-labs/portableumem.git'
        'portableumem-various-cleanups.diff')
sha256sums=('SKIP'
            '78688c528903a154edb956e9058e37144a9f2b0e0818b3167d94d3a643ee2ccf')

prepare() {
    cd "$_srcname"
    
    git apply --index "${srcdir}/portableumem-various-cleanups.diff"
    
    ./autogen.sh
}

pkgver() {
    cd "$_srcname"
    
    local _version
    local _revision
    local _shorthash
    
    _version="$(git tag | grep '[[0-9]*\.]*[0-9]*' | sort -r | head -n1)"
    _revision="$(git rev-list "${_version}..HEAD" --count)"
    _shorthash="$(git rev-parse --short HEAD)"
    
    printf '%s.r%s.g%s' "$_version" "$_revision" "$_shorthash"
}

build() {
    cd "$_srcname"
    
    ./configure \
        --prefix='/usr' \
        --enable-shared='yes' \
        --enable-static='no' \
        --with-pic='yes'
        
    make
}

check() {
    cd "$_srcname"
    
    make check
}

package() {
    cd "$_srcname"
    
    make DESTDIR="$pkgdir" install
    
    install -D -m644 COPYRIGHT           -t "${pkgdir}/usr/share/licenses/${pkgname}"
    install -D -m644 OPENSOLARIS.LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}