summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7ca65460c52176eee4713f13bcc4a50563939383 (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
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Pierre Schmitz <pierre@archlinux.de> ([core] package)
# Contributor: Fran├žois Charette <firmicus@gmx.net>

pkgname=xz-git
pkgver=5.2.1.r25.gfbbb295
pkgrel=1
pkgdesc='Library and command line tools for XZ and LZMA compressed files - git checkout'
arch=('i686' 'x86_64')
url='http://tukaani.org/xz/'
license=('GPL' 'LGPL' 'custom')
depends=('sh')
makedepends=('git')
provides=('lzma' 'lzma-utils' 'xz-utils' "xz=${pkgver%%.r*}")
replaces=('lzma' 'lzma-utils' 'xz-utils')
conflicts=('lzma' 'lzma-utils' 'xz-utils' 'xz')
options=('!libtool')
source=('git+http://git.tukaani.org/xz.git')
sha256sums=('SKIP')

# keep an upgrade path for older installations
PKGEXT='.pkg.tar.gz'

pkgver() {
	cd xz/

	if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
		echo "$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG}).r$(git rev-list --count ${GITTAG}..).g$(git log -1 --format="%h")"
	else
		echo "0.r$(git rev-list --count master).g$(git log -1 --format="%h")"
	fi
}

build() {
	cd xz/

	./autogen.sh
	./configure --prefix=/usr \
		--disable-rpath \
		--enable-werror
	make
}

check() {
	cd xz/

	make check
}

package() {
	cd xz/

	make DESTDIR=${pkgdir} install
	install -d -m0755 ${pkgdir}/usr/share/licenses/xz/
	ln -sf /usr/share/doc/xz/COPYING ${pkgdir}/usr/share/licenses/xz/
	ln -sf /usr/share/licenses/common/GPL2/license.txt ${pkgdir}/usr/share/doc/xz/COPYING.GPLv2
}