* add nbd

This commit is contained in:
Alexander Baldeck 2019-03-26 22:49:17 +00:00
parent a317452a5b
commit adb2d6515e
4 changed files with 89 additions and 0 deletions

55
nbd/PKGBUILD Normal file
View File

@ -0,0 +1,55 @@
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Gerhard Brauer <gerbra@archlinux.de>
pkgname=nbd
pkgver=3.19
pkgrel=1
pkgdesc='tools for network block devices, allowing you to use remote block devices over TCP/IP'
arch=(x86_64 powerpc64le)
url='https://nbd.sourceforge.io/'
license=('GPL')
depends=('glib2' 'gnutls')
backup=('etc/nbd-server/config')
source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.xz"
'config'
'nbd.service'
'sysusers_nbd.conf')
sha256sums=('b4466412f13e057659f25d35e1e8e181afd62c7179bff22a6add81445ecb8690'
'ee2e9fbbeb8a8b9b71d16b6f32eb41788f6def9d00cc4a47897ed3cb97cdde7c'
'1b1add55d82d7623eabf7ff3dfec15c1fbe3c340fa74160df3d60e91eb1c71ba'
'3fd98fe87d0b31b82126dc669f00355865f58fae81af3fccbc0d06504baef6cd')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--sysconfdir=/etc \
--enable-syslog
make
}
# checks still fail...
#check() {
# cd "${srcdir}/${pkgname}-${pkgver}"
#
# make check
#}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
install -D -m0644 systemd/nbd@.service "${pkgdir}"/usr/lib/systemd/system/nbd@.service
install -D -m0644 "${srcdir}"/config "${pkgdir}"/etc/nbd-server/config
install -D -m0644 "${srcdir}"/nbd.service "${pkgdir}"/usr/lib/systemd/system/nbd.service
install -D -m0644 "${srcdir}"/sysusers_nbd.conf "${pkgdir}"/usr/lib/sysusers.d/nbd.conf
install -D -m0644 doc/README "${pkgdir}"/usr/share/doc/nbd/README
}

21
nbd/config Normal file
View File

@ -0,0 +1,21 @@
[generic]
# The [generic] section is required, even if nothing is specified
# there.
# When either of these options are specified, nbd-server drops
# privileges to the given user and group after opening ports, but
# _before_ opening files.
user = nbd
group = nbd
[export1]
exportname = /export/nbd/export1-file
authfile = /export/nbd/export1-authfile
timeout = 30
filesize = 10000000
readonly = false
multifile = false
copyonwrite = false
prerun = dd if=/dev/zero of=%s bs=1k count=500
postrun = rm -f %s
[otherexport]
exportname = /export/nbd/experiment
# The other options are all optional.

12
nbd/nbd.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=Network Block Device Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/nbd-server
ProtectSystem=full
ProtectHome=on
[Install]
WantedBy=multi-user.target

1
nbd/sysusers_nbd.conf Normal file
View File

@ -0,0 +1 @@
u nbd - "Network Block Device" /var/empty