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