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