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