APKBUILD 1.91 KB
Newer Older
Leonardo Arena's avatar
Leonardo Arena committed
1 2 3
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=targetcli
4
pkgver=2.1_p35
Leonardo Arena's avatar
Leonardo Arena committed
5 6
_ver=${pkgver/_rc/rc}
_ver=${_ver/_p/.fb}
7
pkgrel=0
Leonardo Arena's avatar
Leonardo Arena committed
8 9 10 11 12 13 14 15 16
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=""
17
subpackages="$pkgname-doc"
18
source="https://github.com/agrover/targetcli-fb/archive/v${_ver}.tar.gz"
Leonardo Arena's avatar
Leonardo Arena committed
19 20 21 22

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

23
_builddir="$srcdir"/${pkgname}-fb-${_ver}
Leonardo Arena's avatar
Leonardo Arena committed
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

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"
52 53
	python setup.py build
	gzip targetcli.8
Leonardo Arena's avatar
Leonardo Arena committed
54 55 56 57 58
}

package() {
	cd "$_builddir"
	python setup.py install --root="$pkgdir"
59
	mkdir -p "$pkgdir"/var/lib/target/fabric
60
	mkdir -p "$pkgdir"/etc/target
61 62
	install -D -m644 $pkgname.8.gz "$pkgdir"/usr/share/man/man8/$pkgname.8.gz
	install -D -m755 ../../$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
63
	install -D -m644 ../../$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
Leonardo Arena's avatar
Leonardo Arena committed
64 65
}

66 67 68
md5sums="4d662f860755dacbf0371db93ed73ada  v2.1.fb35.tar.gz"
sha256sums="e81d74a801a50f6d397e83479a423e443fd65dbaf33f29cdbc3ce957d753b825  v2.1.fb35.tar.gz"
sha512sums="df67cf33c820e4c979c1bd8791b77a468d6fed3225bf0c49d56ca6d6d7b5c88290a0b66ccdc4ce2b11d4df7dd4d42b929ff760ce703d31e134e35a0d3996223a  v2.1.fb35.tar.gz"