summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eb085484e42bc070298f26d83611b5b51dd76151 (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
# Maintainer: Justin Dray <justin@dray.be>
# Previous maintainer: bobpaul (bobpaul on archlinux forumsBoohbah <boohbah at gmail.com>)
# Contributor: Mikeserv

_gitname=bcache-tools
pkgname=${_gitname}-git
pkgver=1.0.8.r0.ga73679b
pkgrel=1
pkgdesc="Userspace tools for bcache until bcache merges with either dm or md"
changelog=bcache-tools-git.changelog
arch=('i686' 'x86_64')
url="http://bcache.evilpiepirate.org/"
license=('GPL')
depends=('util-linux')
makedepends=('git')
provides=('bcache-tools')
conflicts=('bcache-tools')
install="${pkgname}.install"
source=("git+https://github.com/g2p/${_gitname}.git"
        'crc64.patch'
        'initcpio-arch.patch')
md5sums=('SKIP'
         '265f3d6ad0bd1596eac8a2c3512f2d87'
         '208d7024340b8db3cf21325df40b6267')

# set _gitrev to a git revision (man gitrevisions) like a tag, a commit sha1
# hash or a branch name to build from this tree instead of master

# _gitrev=""
#_gitrev="89f11b135d1"

pkgver() {
	cd "${srcdir}/${_gitname}"
	[[ -n $_gitrev ]] && git reset --hard "$_gitrev"
	git describe --long --tags | sed -E 's/([^-]*-g)/r\1/;s/-/./g;s/^v//'
}

prepare() {
	cd "${srcdir}/${_gitname}"
	patch -Np1 -i "${srcdir}/initcpio-arch.patch"
	patch -Np1 -i "${srcdir}/crc64.patch"
}

build() {
	cd "${srcdir}/${_gitname}"
	make
}

package() {
	cd "${srcdir}/${_gitname}"
	mkdir -p "${pkgdir}/usr/bin"
	mkdir -p "${pkgdir}/usr/lib/udev/rules.d"
	mkdir -p "${pkgdir}/usr/share/man/man8"
	mkdir -p "${pkgdir}/usr/lib/initcpio/install"

	make DESTDIR="${pkgdir}" install
}