]> git.pld-linux.org Git - packages/drbd.git/blob - drbd.spec
4f6249aa04f3b4ea7f79671cdbbc8d2f92ab507e
[packages/drbd.git] / drbd.spec
1 #
2 # TODO:
3 #  - trigger to update drbd-8.2 config
4 #  - warning: Installed (but unpackaged) file(s) found:
5 #     /etc/xen/scripts/block-drbd
6 #     /usr/lib/ocf/resource.d/linbit/drbd
7 #
8 # Conditional build:
9 %bcond_without  dist_kernel     # allow non-distribution kernel
10 %bcond_without  kernel          # don't build kernel modules
11 %bcond_without  userspace       # don't build userspace module
12 %bcond_with     verbose         # verbose build (V=1)
13 %bcond_with     grsec_kernel    # build for kernel-grsecurity
14 #
15 %ifarch sparc
16 %undefine       with_smp
17 %endif
18
19 %if %{without kernel}
20 %undefine       with_dist_kernel
21 %endif
22 %if %{with kernel} && %{with dist_kernel} && %{with grsec_kernel}
23 %define alt_kernel      grsecurity
24 %endif
25 %if "%{_alt_kernel}" != "%{nil}"
26 %undefine       with_userspace
27 %endif
28
29 %define         rel     10
30 %define         pname   drbd
31 Summary:        drbd is a block device designed to build high availibility clusters
32 Summary(pl.UTF-8):      drbd jest urządzeniem blokowym dla klastrów o wysokiej niezawodności
33 Name:           %{pname}%{_alt_kernel}
34 Version:        8.3.5
35 Release:        %{rel}
36 License:        GPL
37 Group:          Base/Kernel
38 Source0:        http://oss.linbit.com/drbd/8.3/%{pname}-%{version}.tar.gz
39 # Source0-md5:  2a27a6924146ccd61e11e3a973707069
40 Patch0:         %{pname}-Makefile.patch
41 Patch1:         %{pname}-swab.patch
42 Patch2:         %{pname}-parallel-install.patch
43 URL:            http://www.drbd.org/
44 %if %{with userspace}
45 BuildRequires:  bison
46 BuildRequires:  flex
47 %endif
48 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
49 BuildRequires:  rpmbuild(macros) >= 1.379
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52 %description
53 drbd is a block device which is designed to build high availability
54 clusters. This is done by mirroring a whole block device via (a
55 dedicated) network. You could see it as a network RAID1.
56
57 %description -l pl.UTF-8
58 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
59 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
60 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
61
62 %description -l pt_BR.UTF-8
63 O DRBD é um dispositivo de bloco que é projetado para construir
64 clusters de Alta Disponibilidade. Isto é feito espelhando um
65 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
66 visto como um RAID 1 via rede. Este pacote contém utilitários para
67 gerenciar dispositivos DRBD.
68
69 %package -n drbdsetup
70 Summary:        Setup tool and scripts for DRBD
71 Summary(pl.UTF-8):      Narzędzie konfiguracyjne i skrypty dla DRBD
72 Summary(pt_BR.UTF-8):   Utilitários para gerenciar dispositivos DRBD
73 Group:          Applications/System
74 Requires(post,preun):   /sbin/chkconfig
75 Requires(pre):  /usr/bin/getgid
76 Requires(pre):  /usr/sbin/groupadd
77 Requires(postun):       /usr/sbin/groupdel
78 Requires:       rc-scripts
79 Provides:       group(haclient)
80 Conflicts:      drbdsetup24
81 Obsoletes:      drbdsetup8
82
83 %description -n drbdsetup
84 Setup tool and init scripts for DRBD.
85
86 %description -n drbdsetup -l pl.UTF-8
87 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
88
89 %package -n kernel%{_alt_kernel}-block-drbd
90 Summary:        Kernel module with drbd - a block device designed to build high availibility clusters
91 Summary(pl.UTF-8):      Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
92 Release:        %{rel}@%{_kernel_ver_str}
93 Group:          Base/Kernel
94 %{?with_dist_kernel:%requires_releq_kernel}
95 Requires(post,postun):  /sbin/depmod
96 Requires:       drbdsetup
97
98 %description -n kernel%{_alt_kernel}-block-drbd
99 drbd is a block device which is designed to build high availability
100 clusters. This is done by mirroring a whole block device via (a
101 dedicated) network. You could see it as a network RAID1.
102
103 %description -n kernel%{_alt_kernel}-block-drbd -l pl.UTF-8
104 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
105 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
106 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
107
108 %package -n bash-completion-drbd
109 Summary:        bash-completion for drbd
110 Summary(pl.UTF-8):      Bashowe uzupełnianie poleceń dla drbd
111 Group:          Applications/Shells
112 Requires:       bash-completion
113
114 %description -n bash-completion-drbd
115 This package provides bash-completion for drbd.
116
117 %description -n bash-completion-drbd -l pl.UTF-8
118 Ten pakiet dostarcza bashowe uzupełnianie poleceń dla drbd.
119
120 %package -n drbd-udev
121 Summary:        udev rules for drbd kernel module
122 Summary(pl.UTF-8):      Reguły udev dla modułów jądra Linuksa dla drbd
123 Group:          Base/Kernel
124 Requires:       udev-core
125
126 %description -n drbd-udev
127 udev rules for drbd kernel module.
128
129 %description -n drbd-udev -l pl.UTF-8
130 Reguły udev dla modułu jądra Linuksa dla drbd.
131
132 %prep
133 %setup -q -n %{pname}-%{version}
134 %patch0 -p1
135 %patch1 -p1
136 %patch2 -p1
137
138 %build
139 %if %{with userspace}
140 %{__make} tools \
141         KVER=dummy \
142         CC="%{__cc}" \
143         OPTCFLAGS="%{rpmcflags}" \
144         LDFLAGS="%{rpmldflags}"
145 %endif
146
147 %if %{with kernel}
148 cd drbd
149 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
150 ln -sf Makefile-2.6 Makefile
151 # kernel module(s)
152 %build_kernel_modules -m drbd
153 %endif
154
155 %install
156 rm -rf $RPM_BUILD_ROOT
157 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
158         $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
159
160 %if %{with kernel}
161 %install_kernel_modules -m drbd/drbd -d kernel/drivers/block
162 %endif
163
164 %if %{with userspace}
165 %{__make} install -C scripts \
166         DRBD_ENABLE_UDEV=1 \
167         PREFIX=$RPM_BUILD_ROOT
168 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
169 rm -rf $RPM_BUILD_ROOT/etc/init.d
170 install user/{drbdadm,drbdmeta,drbdsetup} $RPM_BUILD_ROOT/sbin
171
172 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
173 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
174 %endif
175
176 %clean
177 rm -rf $RPM_BUILD_ROOT
178
179 %post -n kernel%{_alt_kernel}-block-drbd
180 %depmod %{_kernel_ver}
181
182 %postun -n kernel%{_alt_kernel}-block-drbd
183 %depmod %{_kernel_ver}
184
185 %pre -n drbdsetup
186 %groupadd -g 60 haclient
187
188 %post -n drbdsetup
189 /sbin/chkconfig --add drbd
190 %service drbd restart
191
192 %preun -n drbdsetup
193 if [ "$1" = "0" ]; then
194         %service drbd stop
195         /sbin/chkconfig --del drbd
196 fi
197
198 %postun -n drbdsetup
199 if [ "$1" = "0" ]; then
200         %groupremove haclient
201 fi
202
203
204 %if %{with userspace}
205 %files -n drbdsetup
206 %defattr(644,root,root,755)
207 %attr(755,root,root) /sbin/drbdadm
208 %attr(2754,root,haclient) /sbin/drbdsetup
209 %attr(2754,root,haclient) /sbin/drbdmeta
210 %attr(754,root,root) /etc/rc.d/init.d/drbd
211 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
212 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbdupper
213 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
214 %{_mandir}/man[58]/*
215 %dir /usr/lib/drbd
216 %attr(755,root,root) /usr/lib/drbd/*
217 %attr(755,root,root) %{_sbindir}/drbd-overview
218
219 %files -n bash-completion-drbd
220 %defattr(644,root,root,755)
221 /etc/bash_completion.d/drbdadm
222
223 %files -n drbd-udev
224 %defattr(644,root,root,755)
225 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/65-drbd.rules
226 %endif
227
228 %if %{with kernel}
229 %files -n kernel%{_alt_kernel}-block-drbd
230 %defattr(644,root,root,755)
231 %doc ChangeLog README
232 /lib/modules/%{_kernel_ver}/kernel/drivers/block/drbd.ko*
233 %endif
This page took 0.047223 seconds and 3 git commands to generate.