2007-01-15 23:26:31 +00:00
|
|
|
#
|
2011-02-25 14:28:32 +00:00
|
|
|
# spec file for package nbd
|
2007-01-15 23:26:31 +00:00
|
|
|
#
|
2014-11-10 10:16:19 +00:00
|
|
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-01-15 23:26:31 +00:00
|
|
|
#
|
2008-08-21 23:01:54 +00:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2007-01-15 23:26:31 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2008-08-21 23:01:54 +00:00
|
|
|
|
2007-01-15 23:26:31 +00:00
|
|
|
Name: nbd
|
2012-05-18 20:35:32 +00:00
|
|
|
BuildRequires: doxygen
|
|
|
|
BuildRequires: glib2-devel >= 2.26.0
|
2007-11-08 23:37:09 +00:00
|
|
|
PreReq: %insserv_prereq coreutils
|
2013-04-19 14:48:36 +00:00
|
|
|
Version: 3.3
|
2012-05-18 20:35:32 +00:00
|
|
|
Release: 0
|
2013-04-19 14:48:36 +00:00
|
|
|
Source: http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.bz2
|
2007-01-15 23:26:31 +00:00
|
|
|
Source2: init.nbd-server
|
2012-01-08 11:31:13 +00:00
|
|
|
Patch2: nbd-2.9.25-close.diff
|
|
|
|
Patch3: nbd-2.9.25-doxyfile.diff
|
2007-01-15 23:26:31 +00:00
|
|
|
Summary: Network Block Device Server and Client Utilities
|
2012-05-18 20:35:32 +00:00
|
|
|
License: GPL-2.0+
|
|
|
|
Group: Productivity/Networking/Other
|
2007-11-08 23:37:09 +00:00
|
|
|
Url: http://nbd.sourceforge.net/
|
2007-01-15 23:26:31 +00:00
|
|
|
Prefix: /usr
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2007-11-08 23:37:09 +00:00
|
|
|
Suggests: nbd-doc
|
2007-01-15 23:26:31 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
This package contains nbd-server. It is the server backend for the nbd
|
|
|
|
network block device driver that's in the Linux kernel.
|
|
|
|
|
|
|
|
nbd can be used to have a filesystem stored on another machine. It does
|
|
|
|
provide a block device, not a file system; so unless you put a
|
|
|
|
clustering filesystem on top of it, you can't access it simultaneously
|
|
|
|
from more than one client. Use NFS or a real cluster FS (such as
|
|
|
|
ocfs2) if you want to do this. nbd-server can export a file (which may
|
|
|
|
contain a filesystem image) or a partition. Swapping over nbd is
|
|
|
|
possible as well, though it's said not to be safe against OOM and
|
|
|
|
should not be used for that case. nbd-server also has a copy-on-write
|
|
|
|
mode where changes are saved to a separate file and thrown away when
|
|
|
|
the connection closes.
|
|
|
|
|
|
|
|
The package also contains the nbd-client tools, which you need to
|
|
|
|
configure the nbd devices on the client side.
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-11-08 23:37:09 +00:00
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Wouter Verhelst <wouter@debian.org>
|
|
|
|
Anton Altaparmakov <aia21@cam.ac.uk>
|
|
|
|
Pavel Machek <pavel@ucw.cz>
|
|
|
|
Paul Clements <Paul.Clements@steeleye.com>
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Network Block Device Server and Client Utilities
|
|
|
|
Group: Productivity/Networking/Other
|
|
|
|
Requires: nbd = %{version}
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
This package contains the HTML documentation for the network block
|
|
|
|
device (nbd) utilities.
|
|
|
|
|
|
|
|
nbd can be used to have a filesystem stored on another machine. It does
|
|
|
|
provide a block device, not a file system; so unless you put a
|
|
|
|
clustering filesystem on top of it, you can't access it simultaneously
|
|
|
|
from more than one client. Use NFS or a real cluster FS (such as
|
|
|
|
ocfs2) if you want to do this. nbd-server can export a file (which may
|
|
|
|
contain a filesystem image) or a partition. Swapping over nbd is
|
|
|
|
possible as well, though it's said not to be safe against OOM and
|
|
|
|
should not be used for that case. nbd-server also has a copy-on-write
|
|
|
|
mode where changes are saved to a separate file and thrown away when
|
|
|
|
the connection closes.
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-15 23:26:31 +00:00
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Wouter Verhelst <wouter@debian.org>
|
|
|
|
Anton Altaparmakov <aia21@cam.ac.uk>
|
|
|
|
Pavel Machek <pavel@ucw.cz>
|
|
|
|
Paul Clements <Paul.Clements@steeleye.com>
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup
|
2007-07-30 20:44:38 +00:00
|
|
|
%patch2 -p1
|
2011-04-04 15:30:59 +00:00
|
|
|
%patch3 -p1
|
2007-01-15 23:26:31 +00:00
|
|
|
|
|
|
|
%build
|
2012-03-01 03:04:16 +00:00
|
|
|
export CFLAGS="$RPM_OPT_FLAGS -fstack-protector -fno-strict-aliasing"
|
2007-01-15 23:26:31 +00:00
|
|
|
./configure --with-gnu-ld --prefix=/usr --mandir=%{_mandir} \
|
|
|
|
--infodir=%{_infodir} --libdir=%{_libdir} --libexecdir=%{_libdir} \
|
2007-07-30 20:44:38 +00:00
|
|
|
--program-prefix="" --sysconfdir=/etc --build=%{_target_cpu}-suse-linux
|
2007-01-15 23:26:31 +00:00
|
|
|
make
|
2012-01-08 11:31:13 +00:00
|
|
|
doxygen doc/Doxyfile.in
|
2007-01-15 23:26:31 +00:00
|
|
|
|
|
|
|
%install
|
2012-01-08 11:31:13 +00:00
|
|
|
make install DESTDIR=$RPM_BUILD_ROOT man_MANS='nbd-client.8 nbd-server.1 nbd-server.5 nbd-trdump.1'
|
2007-01-15 23:26:31 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
|
|
|
install %SOURCE2 $RPM_BUILD_ROOT/etc/init.d/nbd-server
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
|
|
|
ln -s ../../etc/init.d/nbd-server $RPM_BUILD_ROOT/usr/bin/rcnbd-server
|
2007-07-30 20:44:38 +00:00
|
|
|
#echo "#Port file options" > $RPM_BUILD_ROOT/etc/nbd-server.conf
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/nbd-server
|
|
|
|
touch $RPM_BUILD_ROOT/etc/nbd-server/config
|
|
|
|
touch $RPM_BUILD_ROOT/etc/nbd-server/allow
|
|
|
|
grep -A16 -B1 '^\[generic\]' README > $RPM_BUILD_ROOT/etc/nbd-server/config.example
|
2007-01-15 23:26:31 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%attr(0755,root,root) /usr/sbin/nbd-client
|
|
|
|
%attr(0755,root,root) /usr/bin/nbd-server
|
2012-01-08 11:31:13 +00:00
|
|
|
%attr(0755,root,root) /usr/bin/nbd-trdump
|
2007-01-15 23:26:31 +00:00
|
|
|
%attr(0755,root,root) /etc/init.d/nbd-server
|
|
|
|
%attr(0755,root,root) /usr/bin/rcnbd-server
|
|
|
|
%{_mandir}/man1/nbd-server.1.gz
|
2012-01-08 11:31:13 +00:00
|
|
|
%{_mandir}/man1/nbd-trdump.1.gz
|
2011-04-28 14:33:31 +00:00
|
|
|
%{_mandir}/man5/nbd-server.5.gz
|
2007-01-15 23:26:31 +00:00
|
|
|
%{_mandir}/man8/nbd-client.8.gz
|
|
|
|
%doc README
|
2012-01-08 11:31:13 +00:00
|
|
|
#%%config(noreplace) /etc/nbd-server.conf
|
2007-07-30 20:44:38 +00:00
|
|
|
%dir /etc/nbd-server
|
|
|
|
%ghost %config(noreplace) /etc/nbd-server/config
|
|
|
|
%ghost %config(noreplace) /etc/nbd-server/allow
|
2008-08-21 23:01:54 +00:00
|
|
|
%config /etc/nbd-server/config.example
|
2007-01-15 23:26:31 +00:00
|
|
|
|
2007-11-08 23:37:09 +00:00
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc doc/html
|
|
|
|
|
2007-01-15 23:26:31 +00:00
|
|
|
%post
|
|
|
|
%{fillup_and_insserv -f nbd-server}
|
2007-07-30 20:44:38 +00:00
|
|
|
if test -e /etc/nbd-server.conf; then
|
|
|
|
# Do we have to create a generic section?
|
|
|
|
unset generic
|
|
|
|
if test -e /etc/nbd-server/config; then generic=1; fi
|
2014-11-10 10:16:19 +00:00
|
|
|
grep -vE '^(#|[[:blank:]]*$)' /etc/nbd-server.conf |
|
2007-07-30 20:44:38 +00:00
|
|
|
while read port file opts; do
|
|
|
|
if test -z "$generic"; then
|
2014-11-10 10:16:19 +00:00
|
|
|
echo > /etc/nbd-server/config
|
|
|
|
echo "[generic]" >> /etc/nbd-server/config
|
|
|
|
echo " # No generic options yet" >> /etc/nbd-server/config
|
|
|
|
echo >> /etc/nbd-server/config
|
2007-07-30 20:44:38 +00:00
|
|
|
generic=1
|
|
|
|
fi
|
|
|
|
FN=${file%/*}
|
|
|
|
nm="cvt.$port.${FN##*/}.${file##*/}"
|
|
|
|
echo " ... convert $port $file $opts -> $nm"
|
|
|
|
/usr/bin/nbd-server $port $file $opts -o "$nm" >> /etc/nbd-server/config
|
2014-11-10 10:16:19 +00:00
|
|
|
done
|
2007-07-30 20:44:38 +00:00
|
|
|
mv /etc/nbd-server.conf /etc/nbd-server.conf.converted
|
|
|
|
fi
|
2007-01-15 23:26:31 +00:00
|
|
|
|
|
|
|
%postun
|
|
|
|
%{insserv_cleanup}
|
2012-07-10 09:07:57 +00:00
|
|
|
%restart_on_update nbd-server
|
2007-01-15 23:26:31 +00:00
|
|
|
|
2007-11-08 23:37:09 +00:00
|
|
|
%preun
|
|
|
|
%{stop_on_removal nbd-server}
|
2009-07-09 11:57:14 +00:00
|
|
|
|
2007-03-12 23:59:39 +00:00
|
|
|
%changelog
|