Commit a117187b authored by Neophytos's avatar Neophytos

nbd 3.3

parent 1297f3fc
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# maintainer: Neophytos Kolokotronis <tetris4@gmail.com>
# contributions from Arch: https://www.archlinux.org/packages/community/x86_64/nbd/
pkgname=nbd
pkgver=2.9.21a
pkgver=3.3
pkgrel=1
pkgdesc="Tools for network block devices, allowing you to use remote block devices over TCP/IP."
arch=('i686' 'x86_64')
arch=('x86_64')
url="http://nbd.sourceforge.net"
license=('GPL')
source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2
nbd.conf.d nbd)
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2"
'config' 'nbd.service')
backup=('etc/nbd-server/config')
depends=('glib2')
md5sums=('4028c77d52a13f16be5e9bf3d3bab27d'
'6d746f377a28b92dd2c80f01176cb811'
'ab9c431881f5e3c98a8f6c04016f0e00')
install=nbd.install
md5sums=('cde8fe6e870b8a7459f12e5dcf572d86'
'2c43761cd261c9b002601bb78f7500a3'
'59a2a7c119919d8f9b384b5a783af62a')
build(){
cd "${srcdir}/${pkgname}-${pkgver}"
./configure --prefix=/usr
./configure --prefix=/usr --sysconfdir=/etc --enable-syslog
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
install -D -m644 "${srcdir}"/nbd.conf.d "${pkgdir}"/etc/conf.d/nbd
install -D -m755 "${srcdir}"/nbd "${pkgdir}"/etc/rc.d/nbd
install -D -m644 "${srcdir}"/config "${pkgdir}"/etc/nbd-server/config
install -D -m644 "${srcdir}"/nbd.service "${pkgdir}"/usr/lib/systemd/system/nbd.service
install -D -m644 README "${pkgdir}"/usr/share/doc/nbd/README
}
[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
# Since version 2.9.17, nbd-server will do exports on a name
# basis (the used name is the name of the section in which the
# export is specified). This however required an incompatible
# protocol change. To enable backwards-compatible port-based
# exports, uncomment the following line:
# oldstyle = true
[export1]
exportname = /export/nbd/export1-file
# The following line will be ignored unless the
# "oldstyle = true" line in the generic section above is
# enabled.
#port = 12345
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, except this one in case
# the oldstyle option is used in [generic]:
# port = 12346
\ No newline at end of file
post_install() {
getent group "nbd" &>/dev/null || groupadd -r -g 44 nbd 1>/dev/null
getent passwd "nbd" &>/dev/null || useradd -r -u 44 -g nbd -d "/var/empty" -s "/bin/false" nbd 1>/dev/null
}
post_upgrade() {
post_install
}
pre_remove() {
getent passwd "nbd" &>/dev/null && userdel nbd 1>/dev/null
getent group "nbd" &>/dev/null && groupdel nbd 1>/dev/null
}
\ No newline at end of file
[Unit]
Description=Network Block Device Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/nbd-server
[Install]
WantedBy=multi-user.target
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment