summaryrefslogtreecommitdiff
path: root/libre/parabola-hackers/PKGBUILD
blob: ffad16eaa84e2ff67e3a5536fbefbc02d016f928 (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
# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>

pkgbase=parabola-hackers
pkgname=(parabola-hackers parabola-hackers-nshd)
pkgver=20170421
_gitver=a4f6795caea46360a1f8a2517778900b2d3cf41a
pkgdesc='Programs for doing magic with hackers.git'
url='https://projects.parabola.nu/packages/parabola-hackers.git/'
license=('GPL')

pkgrel=1
arch=('x86_64' 'i686')
makedepends=('go')
source=("https://repo.parabola.nu/other/$pkgbase/$pkgbase-$pkgver.tar.gz")
md5sums=('ac2e242e56adde3042bfc54d82d74bd6')

# Don't use mksource=(git://...) because we need --recursive
mksource() {
	cd "$srcdir"
	git clone --recursive git://git.parabola.nu/packages/parabola-hackers.git $pkgbase-$pkgver
	cd $pkgbase-$pkgver
	git checkout $_gitver
	make files.generate
}

build() {
	cd "$srcdir/$pkgbase-$pkgver"

	printf '%s\n' \
	    prefix='/usr' \
	    bindir='$(libexecdir)/$(PACKAGE)' \
	    libexecdir='$(libdir)' \
	    sysconfdir='/etc' \
	    >> config.mk

	make
}

package_parabola-hackers() {
	backup=(etc/$pkgbase.yml)
	depends=('ruby' 'colordiff')

	cd "$srcdir/$pkgbase-$pkgver"
	make DESTDIR="${pkgdir}" install
	find "$pkgdir" -type f \( -name 'nshd*' -o -name shadow \) -delete
	find "$pkgdir" -type d -empty -exec rmdir -p --ignore-fail-on-non-empty -- {} +
}

package_parabola-hackers-nshd() {
	pkgdesc='NSS and PAM integration for parabola-hackers'
	depends=("parabola-hackers=$pkgver" 'nss-pam-ldapd')
	backup=(etc/nshd/shadow)
	install=parabola-hackers-nshd.install
	replaces=(nshd)
	conflicts=(nshd)

	cd "$srcdir/$pkgbase-$pkgver"
	make DESTDIR="${pkgdir}" install
	find "$pkgdir" -type f -not \( -name 'nshd*' -o -name shadow \) -delete
	find "$pkgdir" -type d -empty -exec rmdir -p --ignore-fail-on-non-empty -- {} +
}