summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5449c8cb3ee11910dcab6c51769f6fcfee02ec0f (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
# Maintainer: NĂ­colas F. R. A. Prado <n at nfraprado dot net>
pkgname=lei-git
pkgver=1.7.0.r32.f1e4e14793d1
pkgrel=1
pkgdesc='The "local email interface" from public-inbox'
arch=('any')
url="https://public-inbox.org"
license=('AGPL')
depends=(perl perl-inline-c perl-dbd-sqlite perl-search-xapian perl-uri)
makedepends=('git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}" public-inbox-git public-inbox)
options=('!emptydirs' purge)
source=("${pkgname%-git}::git+https://public-inbox.org/")
sha256sums=('SKIP')

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

	printf "%s" "$(
			git describe --long | sed \
			-e 's/\([^-]*-\)g/r\1/;s/-/./g' \
			-e 's/^v//'
	)"
}

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

	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
	/usr/bin/perl Makefile.PL
	make
}

check() {
	cd "$srcdir/${pkgname%-git}"

	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	export PERL_MM_USE_DEFAULT=1
	make check
}

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

	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	make DESTDIR="$pkgdir/" install
	# There's currently no way to build/install only lei in the public-inbox
	# Makefile, so we need to manually delete the public-inbox binaries and
	# manpages.
	rm "$pkgdir/usr/bin/site_perl/public-inbox"*
	rm "$pkgdir/usr/share/man/"*"/public-inbox"*
}