aboutsummaryrefslogtreecommitdiffstats
path: root/main/targetcli/APKBUILD
blob: 846ceaf2770508bc51b74e407685ab37e8bf1118 (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
68
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=targetcli
pkgver=2.1_p26
_ver=${pkgver/_rc/rc}
_ver=${_ver/_p/.fb}
pkgrel=0
pkgdesc="An administration shell for storage targets"
url="https://github.com/agrover/targetcli-fb"
arch="noarch"
license="AGPLv3"
depends="python py-configobj py-configshell py-ethtool py-ipaddr py-rtslib
        py-simpleparse"
depends_dev=
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc"
source="https://github.com/agrover/targetcli-fb/archive/v${_ver}.tar.gz"

_giturl="git://github.com/agrover/targetcli-fb.git"
_gittag=v$_ver

_builddir="$srcdir"/${pkgname}-fb-${_ver}

snapshot() {
	mkdir -p "$srcdir"
	cd "${SRCDEST:-$srcdir}"
	if ! [ -d targetcli-fb.git ]; then
		git clone --bare  $_giturl || return 1
		cd targetcli-fb.git
	else
		cd targetcli-fb.git
		git fetch || return 1
	fi
	git archive --prefix=$pkgname/ -o "$SRCDEST"/$pkgname-$_ver.tar.gz $_gittag
	scp "$SRCDEST"/$pkgname-$_ver.tar.gz dev.alpinelinux.org:/archive/$pkgname/
}


prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	python setup.py build
	gzip targetcli.8
}

package() {
	cd "$_builddir"
	python setup.py install --root="$pkgdir"
	mkdir -p "$pkgdir"/var/lib/target/fabric
	mkdir -p "$pkgdir"/etc/target
	install -D -m644 $pkgname.8.gz "$pkgdir"/usr/share/man/man8/$pkgname.8.gz
	install -D -m755 ../../$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -D -m644 ../../$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

md5sums="ee4d654ef8071db696229bf817b18f98  v2.1.fb26.tar.gz"
sha256sums="9886e622ea6bc64439bc39521ca85830fa103d1e99f63fff19b13e54daa4e183  v2.1.fb26.tar.gz"
sha512sums="ad8c2415f89409ccae30a73fe406a28aeb034dfae1ba1bf27b9437df66180a45cfe7c6ee279216998e71fb8b1764c68e9dd936c5bb0f7a36a9582b48dc978807  v2.1.fb26.tar.gz"