2.9.7-alt2
[nbd.git] / nbd.spec
blob98d22632c34f2c2313f50da0c03185f1d5b567fb
1 %def_disable debug
2 %def_enable syslog
3 %def_enable lfs
4 %def_with gznbd
5 %def_with static_client
7 %define Name NBD
8 Name: nbd
9 Version: 2.9.7
10 Release: alt2
11 Summary: Tools for using the Network Block Device
12 License: GPL
13 Group: Networking/Other
14 URL: http://%name.sourceforge.net/
15 Source: %name-%version.tar.bz2
16 Patch0: %name-types.patch
17 Patch1: %name-2.9.6-gznbd.patch
18 Patch2: %name-2.9.7-prerun.patch
19 BuildRequires: glib2-devel >= 2.6.0
20 %{?_with_gznbd:BuildRequires: zlib-devel}
21 %{?_with_static_client:BuildRequires: dietlibc}
23 %description
24 %Name contains the tools needed to export a network block device and to
25 use a network block device. The nbd module is part of the 2.2 kernels
26 and higher.
27 If you have a kernel patched for it, you can use the network block
28 device to swap over the net, which is particularly useful for diskless
29 workstations.
32 %package doc
33 Summary: %Name docs
34 Group: Documentation
36 %description doc
37 %Name docs.
40 %package server
41 Summary: %Name server
42 Group: Networking/Other
44 %description server
45 %Name server needed to export a network block device.
48 %package client
49 Summary: %Name client
50 Group: Networking/Other
52 %description client
53 %Name client needed to use a network block device.
54 You can use the network block device to swap over the net, which is
55 particularly useful for diskless workstations.
58 %if_with static_client
59 %package client-static
60 Summary: %Name client
61 Group: Networking/Other
63 %description client-static
64 %Name client needed to use a network block device.
65 You can use the network block device to swap over the net, which is
66 particularly useful for diskless workstations.
68 This package contains static %name-client (can be used for initrd).
69 %endif
72 %prep
73 %setup -q
74 %patch0 -p1
75 %patch1 -p1
76 %patch2 -p1
79 %build
80 %configure \
81 %{subst_enable debug} \
82 %{subst_enable syslog} \
83 %{subst_enable lfs}
84 %if_with static_client
85 %make_build CC="diet -Os %__cc" %name-client
86 mv %name-client{,.static}
87 %make_build clean
88 %endif
89 %make_build
90 %{?_with_gznbd:%make_build -C gznbd CFLAGS="%optflags -DMY_NAME='\"gznbd\"'"}
93 %install
94 install -d %buildroot%_sysconfdir/%name-server
95 %make_install DESTDIR=%buildroot install
96 %{?_with_static_client:install -m 0755 %name-client.static %buildroot%_sbindir/}
97 %{?_with_gznbd:install -m 0755 gznbd/gznbd %buildroot/%_bindir/}
100 %files doc
101 %doc README
104 %files server
105 %_bindir/*
106 %dir %_sysconfdir/nbd-server
107 %_man1dir/*
108 %_man5dir/*
111 %files client
112 %_sbindir/%name-client
113 %_man8dir/*
116 %if_with static_client
117 %files client-static
118 %_sbindir/%name-client.static
119 %endif
122 %changelog
123 * Sun Oct 14 2007 Led <led@altlinux.ru> 2.9.7-alt2
124 - added %name-client.static
125 - added %name-2.9.7-prerun.patch
127 * Fri Sep 21 2007 Led <led@altlinux.ru> 2.9.7-alt1
128 - 2.9.7
130 * Mon Aug 06 2007 Led <led@altlinux.ru> 2.9.6-alt1
131 - 2.9.6
132 - updated %name-2.9.6-gznbd.patch
134 * Sat Jun 16 2007 Led <led@altlinux.ru> 2.9.3-alt1
135 - 2.9.3
137 * Fri Mar 16 2007 Led <led@altlinux.ru> 2.9.0-alt0.1
138 - initial build