]> git.pld-linux.org Git - packages/drbd.git/blob - drbd.spec
879331242a1b424c4bef655c0c7e9ac1b1d9c0a4
[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     1
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.7
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:  3b37c028b18bf2c8f5414396f681cf17
40 URL:            http://www.drbd.org/
41 %if %{with userspace}
42 BuildRequires:  bison
43 BuildRequires:  flex
44 %endif
45 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
46 BuildRequires:  rpmbuild(macros) >= 1.379
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %description
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.
53
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.
58
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
64 gerenciar dispositivos DRBD.
65
66 %package -n drbdsetup
67 Summary:        Setup tool and scripts for DRBD
68 Summary(pl.UTF-8):      Narzędzie konfiguracyjne i skrypty dla DRBD
69 Summary(pt_BR.UTF-8):   Utilitários para gerenciar dispositivos DRBD
70 Group:          Applications/System
71 Requires(post,preun):   /sbin/chkconfig
72 Requires(pre):  /usr/bin/getgid
73 Requires(pre):  /usr/sbin/groupadd
74 Requires(postun):       /usr/sbin/groupdel
75 Requires:       rc-scripts
76 Provides:       group(haclient)
77 Conflicts:      drbdsetup24
78 Obsoletes:      drbdsetup8
79
80 %description -n drbdsetup
81 Setup tool and init scripts for DRBD.
82
83 %description -n drbdsetup -l pl.UTF-8
84 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
85
86 %package -n kernel%{_alt_kernel}-block-drbd
87 Summary:        Kernel module with drbd - a block device designed to build high availibility clusters
88 Summary(pl.UTF-8):      Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
89 Release:        %{rel}@%{_kernel_ver_str}
90 Group:          Base/Kernel
91 %{?with_dist_kernel:%requires_releq_kernel}
92 Requires(post,postun):  /sbin/depmod
93 Requires:       drbdsetup
94
95 %description -n kernel%{_alt_kernel}-block-drbd
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
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.
104
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
117 %package -n drbd-udev
118 Summary:        udev rules for drbd kernel module
119 Summary(pl.UTF-8):      Reguły udev dla modułów jądra Linuksa dla drbd
120 Group:          Base/Kernel
121 Requires:       udev-core
122
123 %description -n drbd-udev
124 udev rules for drbd kernel module.
125
126 %description -n drbd-udev -l pl.UTF-8
127 Reguły udev dla modułu jądra Linuksa dla drbd.
128
129 %prep
130 %setup -q -n %{pname}-%{version}
131
132 %build
133 %configure
134 %if %{with userspace}
135 %{__make} tools \
136         KVER=dummy \
137         CC="%{__cc}" \
138         OPTCFLAGS="%{rpmcflags}" \
139         LDFLAGS="%{rpmldflags}"
140 %endif
141
142 %if %{with kernel}
143 cd drbd
144 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
145 ln -sf Makefile-2.6 Makefile
146 # kernel module(s)
147 %build_kernel_modules -m drbd
148 %endif
149
150 %install
151 rm -rf $RPM_BUILD_ROOT
152 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
153         $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
154
155 %if %{with kernel}
156 %install_kernel_modules -m drbd/drbd -d kernel/drivers/block
157 %endif
158
159 %if %{with userspace}
160 %{__make} install -C scripts \
161         DRBD_ENABLE_UDEV=1 \
162         DESTDIR=$RPM_BUILD_ROOT
163
164 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
165 rm -rf $RPM_BUILD_ROOT/etc/init.d
166 install user/{drbdadm,drbdmeta,drbdsetup} $RPM_BUILD_ROOT/sbin
167
168 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
169 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
170 %endif
171
172 %clean
173 rm -rf $RPM_BUILD_ROOT
174
175 %post -n kernel%{_alt_kernel}-block-drbd
176 %depmod %{_kernel_ver}
177
178 %postun -n kernel%{_alt_kernel}-block-drbd
179 %depmod %{_kernel_ver}
180
181 %pre -n drbdsetup
182 %groupadd -g 60 haclient
183
184 %post -n drbdsetup
185 /sbin/chkconfig --add drbd
186 %service drbd restart
187
188 %preun -n drbdsetup
189 if [ "$1" = "0" ]; then
190         %service drbd stop
191         /sbin/chkconfig --del drbd
192 fi
193
194 %postun -n drbdsetup
195 if [ "$1" = "0" ]; then
196         %groupremove haclient
197 fi
198
199
200 %if %{with userspace}
201 %files -n drbdsetup
202 %defattr(644,root,root,755)
203 %attr(755,root,root) /sbin/drbdadm
204 %attr(2754,root,haclient) /sbin/drbdsetup
205 %attr(2754,root,haclient) /sbin/drbdmeta
206 %attr(754,root,root) /etc/rc.d/init.d/drbd
207 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
208 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbdupper
209 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
210 %{_mandir}/man[58]/*
211 %dir /usr/lib/drbd
212 %attr(755,root,root) /usr/lib/drbd/*
213 %attr(755,root,root) %{_sbindir}/drbd-overview
214
215 %files -n bash-completion-drbd
216 %defattr(644,root,root,755)
217 /etc/bash_completion.d/drbdadm
218
219 %files -n drbd-udev
220 %defattr(644,root,root,755)
221 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/65-drbd.rules
222 %endif
223
224 %if %{with kernel}
225 %files -n kernel%{_alt_kernel}-block-drbd
226 %defattr(644,root,root,755)
227 %doc ChangeLog README
228 /lib/modules/%{_kernel_ver}/kernel/drivers/block/drbd.ko*
229 %endif
This page took 0.067498 seconds and 3 git commands to generate.