blob: 022d48c95bf38d1364a200c68408c9b2bb4e88cb (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
# Maintainer: dreieck (https://aur.archlinux.org/account/dreieck)
# Contributor: Sven-Hendrik Haase
# Contributor: Thomas Weißschuh
_upstreamname=libnbd
_pkgname="${_upstreamname}-ocaml"
pkgname="${_pkgname}-git"
epoch=0
pkgver=1.21.6+1.r2261.20241024.f61a7446
# _majorver="$(awk -F. '{print $1}' <<< "${pkgver}")"
# _minorver="$(awk -F. '{print $2}' <<< "${pkgver}")"
# _nextminorver="$(awk '{print $1+1}' <<< "${_minorver}")"
pkgrel=1
pkgdesc="NBD client library in userspace. Compiled with OCaml bindings. Latest git checkout."
arch=(
'i686'
'x86_64'
)
url="https://gitlab.com/nbdkit/libnbd"
license=('LGPL2.1')
depends=(
'bash'
'glibc'
'gnutls'
'libxml2'
)
makedepends=(
'autoconf'
'cargo'
'fuse3'
'git'
'go'
'ocaml'
'perl'
'ubdsrv'
)
optdepends=(
'bash-completion: For bash completion support.'
'fuse3: For nbdfuse support.'
'ocaml: For OCaml bindings.'
'python>=3: For python bindings.'
'ubdsrv: For nbdublk.'
)
provides=(
"${_upstreamname}=${pkgver}"
"${_upstreamname}-git=${pkgver}"
"${_upstreamname}-bash-completion=${pkgver}"
# "cargo-nbd=${pkgver}"
# "golang-nbd=${pkgver}"
"ocaml-nbd=${pkgver}"
"python-nbd=${pkgver}"
)
conflicts=(
"${_upstreamname}"
"${_pkgname}"
)
source=(
"${_upstreamname}::git+${url}.git"
)
sha256sums=(
'SKIP'
)
# LTO breaks linking into OCaml library, e.g. with building the package `virt-v2v`.
options+=('!lto')
prepare() {
cd "${srcdir}/${_upstreamname}"
autoreconf -i
git log > git.log
}
pkgver() {
cd "${srcdir}/${_upstreamname}"
_ver="$(git describe --tags | sed 's|^v||' | sed 's|-[^-]*$||' | tr '-' '+')"
_rev="$(git rev-list --count HEAD)"
_date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
_hash="$(git rev-parse --short HEAD)"
if [ -z "${_ver}" ]; then
error "Version could not be determined."
return 1
else
printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
fi
}
build() {
cd "${srcdir}/${_upstreamname}"
export CARGO_HOME="${srcdir}/.cargo"
export GOPATH="${srcdir}/.go"
export GOBIN="${GOPATH}/bin"
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--enable-fuse \
--enable-ublk \
--disable-libfuzzer \
--enable-ocaml \
--enable-python \
--enable-golang \
--enable-rust \
--with-gnutls \
--with-libxml2
make
}
check() {
cd "${srcdir}/${_upstreamname}"
export CARGO_HOME="${srcdir}/.cargo"
export GOPATH="${srcdir}/.go"
export GOBIN="${GOPATH}/bin"
#make check
}
package() {
cd "${srcdir}/${_upstreamname}"
export CARGO_HOME="${srcdir}/.cargo"
export GOPATH="${srcdir}/.go"
export GOBIN="${GOPATH}/bin"
make DESTDIR="${pkgdir}" install
for _docfile in git.log README.md SECURITY TODO; do
install -Dvm644 "${_docfile}" "${pkgdir}/usr/share/doc/${_upstreamname}/${_docfile}"
done
for _licensefile in COPYING.LIB; do
install -Dvm644 "${_licensefile}" "${pkgdir}/usr/share/licenses/${pkgname}/${_licensefile}"
ln -svr "${pkgdir}/usr/share/licenses/${pkgname}/${_licensefile}" "${pkgdir}/usr/share/doc/${_upstreamname}/${_licensefile}"
done
}
|