summaryrefslogtreecommitdiff
path: root/community/nbd
diff options
context:
space:
mode:
Diffstat (limited to 'community/nbd')
-rw-r--r--community/nbd/PKGBUILD24
-rw-r--r--community/nbd/config24
-rw-r--r--community/nbd/nbd5
-rw-r--r--community/nbd/nbd.install13
4 files changed, 54 insertions, 12 deletions
diff --git a/community/nbd/PKGBUILD b/community/nbd/PKGBUILD
index 5a43aea69..f2cd3e776 100644
--- a/community/nbd/PKGBUILD
+++ b/community/nbd/PKGBUILD
@@ -1,27 +1,33 @@
-# $Id: PKGBUILD 48022 2011-05-27 15:14:57Z svenstaro $
+# $Id: PKGBUILD 48213 2011-05-30 08:16:09Z svenstaro $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
-# Contributor : Ionut Biru <ibiru@archlinux.org>
+# Contributor: Christian Hesse <mail@eworm.de>
+# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Gerhard Brauer <gerbra@archlinux.de>
+
pkgname=nbd
-pkgver=2.9.21a
+pkgver=2.9.22
pkgrel=1
pkgdesc="Tools for network block devices, allowing you to use remote block devices over TCP/IP."
arch=('i686' 'x86_64')
url="http://nbd.sourceforge.net"
license=('GPL')
source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2
- nbd.conf.d nbd)
+ config nbd)
+backup=('etc/nbd-server/config')
depends=('glib2')
-md5sums=('4028c77d52a13f16be5e9bf3d3bab27d'
- '6d746f377a28b92dd2c80f01176cb811'
- 'ab9c431881f5e3c98a8f6c04016f0e00')
+install=nbd.install
+md5sums=('ff79803165a349a84d526bfcea820b12'
+ '075be420c3d7d7fc9408def3cb8c470d'
+ 'e7b13a8b3369e11927d9917664557efa')
build(){
cd "${srcdir}/${pkgname}-${pkgver}"
- ./configure --prefix=/usr
+ ./configure --prefix=/usr --sysconfdir=/etc
make
make DESTDIR="${pkgdir}" install
- install -D -m644 "${srcdir}"/nbd.conf.d "${pkgdir}"/etc/conf.d/nbd
+ install -D -m644 "${srcdir}"/config "${pkgdir}"/etc/nbd-server/config
install -D -m755 "${srcdir}"/nbd "${pkgdir}"/etc/rc.d/nbd
+
+ install -D -m644 README "${pkgdir}"/usr/share/doc/nbd/README
}
diff --git a/community/nbd/config b/community/nbd/config
new file mode 100644
index 000000000..f90c36b23
--- /dev/null
+++ b/community/nbd/config
@@ -0,0 +1,24 @@
+# This is a comment
+[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
+ 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
+ port = 12346
+ # The other options are all optional.
diff --git a/community/nbd/nbd b/community/nbd/nbd
index b2643196b..76d16c779 100644
--- a/community/nbd/nbd
+++ b/community/nbd/nbd
@@ -2,15 +2,14 @@
. /etc/rc.conf
. /etc/rc.d/functions
-. /etc/conf.d/nbd
-PIDFILE="/var/run/nbd-server.$NBD_PORT.pid"
+PIDFILE="/var/run/nbd-server.pid"
PID=`cat $PIDFILE 2>/dev/null`
case "$1" in
start)
stat_busy "Starting Network Block Device Server"
if [ "$PID" = "" ]; then
- /usr/bin/nbd-server $NBD_PORT $NBD_DEV $NBD_ARGS
+ /usr/bin/nbd-server
fi
if [ "$PID" != "" -o $? -gt 0 ]; then
stat_fail
diff --git a/community/nbd/nbd.install b/community/nbd/nbd.install
new file mode 100644
index 000000000..9e7a01e98
--- /dev/null
+++ b/community/nbd/nbd.install
@@ -0,0 +1,13 @@
+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
+}