Group :: Networking/Other
RPM: nbd
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
%def_disable debug
%def_enable syslog
%def_enable lfs
%def_disable sdp
%def_with gznbd
%def_with static_client
%define Name NBD
Name: nbd
Version: 2.9.9
Release: alt1
Summary: Tools for using the Network Block Device
License: GPL
Group: Networking/Other
URL: http://%name.sourceforge.net/
Source0: %name-%version.tar.bz2
Source1: %name.init
Patch0: %name-types.patch
Patch1: %name-2.9.6-gznbd.patch
BuildRequires: glib2-devel >= 2.6.0
%{?_with_gznbd:BuildRequires: zlib-devel}
%{?_with_static_client:BuildRequires: dietlibc}
%description
%Name contains the tools needed to export a network block device and to
use a network block device. The %name module is part of the 2.2 kernels
and higher.
You can use the network block device to swap over the net, which is
particularly useful for diskless workstations.
%package doc
Summary: %Name docs
Group: Documentation
%description doc
%Name docs.
%package server
Summary: %Name server
Group: Networking/Other
%description server
%Name server needed to export a network block device.
%package client
Summary: %Name client
Group: Networking/Other
%description client
%Name client needed to use a network block device.
You can use the network block device to swap over the net, which is
particularly useful for diskless workstations.
%if_with static_client
%package client-static
Summary: %Name client
Group: Networking/Other
%description client-static
%Name client needed to use a network block device.
You can use the network block device to swap over the net, which is
particularly useful for diskless workstations.
This package contains static %name-client (can be used for initrd).
%endif
%prep
%setup
%patch0 -p1
%patch1 -p1
%build
%configure \
%{subst_enable debug} \
%{subst_enable syslog} \
%{subst_enable lfs} \
%{subst_enable sdp}
%if_with static_client
%make_build CC="diet %__cc" %name-client
mv %name-client{,.static}
%make_build clean
%endif
%make_build
%{?_with_gznbd:%make_build -C gznbd CFLAGS="%optflags -DMY_NAME='\"gznbd\"'"}
%install
install -d %buildroot%_sysconfdir/%name-server
touch %buildroot%_sysconfdir/%name-server/config
%make_install DESTDIR=%buildroot install
%{?_with_static_client:install -m 0755 %name-client.static %buildroot%_sbindir/}
%{?_with_gznbd:install -m 0755 gznbd/gznbd %buildroot%_bindir/}
install -D -m 0755 %SOURCE1 %buildroot%_initdir/%name
%post -n %name-server
%post_service %name ||:
%preun -n %name-server
%preun_service %name ||:
%files doc
%doc README simple_test
%files server
%_bindir/*
%dir %_sysconfdir/%name-server
%config(noreplace) %_sysconfdir/%name-server/config
%_man1dir/*
%_man5dir/*
%_initdir/*
%files client
%_sbindir/%name-client
%_man8dir/*
%if_with static_client
%files client-static
%_sbindir/%name-client.static
%endif
%changelog
…
Full changelog you can see here
%def_enable syslog
%def_enable lfs
%def_disable sdp
%def_with gznbd
%def_with static_client
%define Name NBD
Name: nbd
Version: 2.9.9
Release: alt1
Summary: Tools for using the Network Block Device
License: GPL
Group: Networking/Other
URL: http://%name.sourceforge.net/
Source0: %name-%version.tar.bz2
Source1: %name.init
Patch0: %name-types.patch
Patch1: %name-2.9.6-gznbd.patch
BuildRequires: glib2-devel >= 2.6.0
%{?_with_gznbd:BuildRequires: zlib-devel}
%{?_with_static_client:BuildRequires: dietlibc}
%description
%Name contains the tools needed to export a network block device and to
use a network block device. The %name module is part of the 2.2 kernels
and higher.
You can use the network block device to swap over the net, which is
particularly useful for diskless workstations.
%package doc
Summary: %Name docs
Group: Documentation
%description doc
%Name docs.
%package server
Summary: %Name server
Group: Networking/Other
%description server
%Name server needed to export a network block device.
%package client
Summary: %Name client
Group: Networking/Other
%description client
%Name client needed to use a network block device.
You can use the network block device to swap over the net, which is
particularly useful for diskless workstations.
%if_with static_client
%package client-static
Summary: %Name client
Group: Networking/Other
%description client-static
%Name client needed to use a network block device.
You can use the network block device to swap over the net, which is
particularly useful for diskless workstations.
This package contains static %name-client (can be used for initrd).
%endif
%prep
%setup
%patch0 -p1
%patch1 -p1
%build
%configure \
%{subst_enable debug} \
%{subst_enable syslog} \
%{subst_enable lfs} \
%{subst_enable sdp}
%if_with static_client
%make_build CC="diet %__cc" %name-client
mv %name-client{,.static}
%make_build clean
%endif
%make_build
%{?_with_gznbd:%make_build -C gznbd CFLAGS="%optflags -DMY_NAME='\"gznbd\"'"}
%install
install -d %buildroot%_sysconfdir/%name-server
touch %buildroot%_sysconfdir/%name-server/config
%make_install DESTDIR=%buildroot install
%{?_with_static_client:install -m 0755 %name-client.static %buildroot%_sbindir/}
%{?_with_gznbd:install -m 0755 gznbd/gznbd %buildroot%_bindir/}
install -D -m 0755 %SOURCE1 %buildroot%_initdir/%name
%post -n %name-server
%post_service %name ||:
%preun -n %name-server
%preun_service %name ||:
%files doc
%doc README simple_test
%files server
%_bindir/*
%dir %_sysconfdir/%name-server
%config(noreplace) %_sysconfdir/%name-server/config
%_man1dir/*
%_man5dir/*
%_initdir/*
%files client
%_sbindir/%name-client
%_man8dir/*
%if_with static_client
%files client-static
%_sbindir/%name-client.static
%endif
%changelog
…
Full changelog you can see here