]> git.pld-linux.org Git - packages/drbd8.git/blob - drbd8.spec
- update also smp package; rel 5
[packages/drbd8.git] / drbd8.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
10 %ifarch sparc
11 %undefine       with_smp
12 %endif
13
14 %if %{without kernel}
15 %undefine       with_dist_kernel
16 %endif
17 %if "%{_alt_kernel}" != "%{nil}"
18 %undefine       with_userspace
19 %endif
20 %if %{without userspace}
21 # nothing to be placed to debuginfo package
22 %define         _enable_debug_packages  0
23 %endif
24
25 %define         rel             5
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}8%{_alt_kernel}
30 Version:        8.2.6
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:  43da0e3888e38ef8254197dbca35ed89
36 Patch0:         %{pname}8-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 drbdsetup8
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 Conflicts:      drbdsetup < 8.0.0
76
77 %description -n drbdsetup8
78 Setup tool and init scripts for DRBD.
79
80 %description -n drbdsetup8 -l pl.UTF-8
81 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
82
83 %package -n kernel%{_alt_kernel}-block-drbd8
84 Summary:        Kernel module with drbd - a block device designed to build high availibility clusters
85 Summary(pl.UTF-8):      Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
86 Release:        %{rel}@%{_kernel_vermagic}
87 Group:          Base/Kernel
88 %{?with_dist_kernel:Requires:   kernel%{_alt_kernel}(vermagic) = %{_kernel_ver}}
89 Requires(post,postun):  /sbin/depmod
90 Requires:       drbdsetup8
91 Conflicts:      kernel%{_alt_kernel}-block-drbd
92
93 %description -n kernel%{_alt_kernel}-block-drbd8
94 drbd is a block device which is designed to build high availability
95 clusters. This is done by mirroring a whole block device via (a
96 dedicated) network. You could see it as a network RAID1.
97
98 %description -n kernel%{_alt_kernel}-block-drbd8 -l pl.UTF-8
99 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
100 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
101 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
102
103 %package -n kernel%{_alt_kernel}-smp-block-drbd8
104 Summary:        SMP kernel module with drbd - a block device designed to build high availibility clusters
105 Summary(pl.UTF-8):      Wersja SMP Modułu jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
106 Release:        %{_rel}@%{_kernel_ver_str}
107 Group:          Base/Kernel
108 %{?with_dist_kernel:Requires:   kernel%{_alt_kernel}(vermagic) = %{_kernel_ver}}
109 Requires(post,postun):  /sbin/depmod
110 Requires:       drbdsetup8
111 Conflicts:      kernel%{_alt_kernel}-smp-block-drbd
112
113 %description -n kernel%{_alt_kernel}-smp-block-drbd8
114 drbd is a block device which is designed to build high availability
115 clusters. This is done by mirroring a whole block device via (a
116 dedicated) network. You could see it as a network RAID1.
117
118 %description -n kernel%{_alt_kernel}-smp-block-drbd8 -l pl.UTF-8
119 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
120 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
121 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
122
123 %prep
124 %setup -q -n %{pname}-%{version}
125 %patch0 -p1
126
127 %build
128 %if %{with userspace}
129 %{__make} tools \
130         KVER=dummy \
131         KDIR=/usr/include \
132         CC="%{__cc}" \
133         OPTCFLAGS="%{rpmcflags}" \
134         LDFLAGS="%{rpmldflags}"
135 %endif
136
137 %if %{with kernel}
138 cd drbd
139 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
140 ln -sf Makefile-2.6 Makefile
141 # kernel module(s)
142 %build_kernel_modules -m drbd
143 %endif
144
145 %install
146 rm -rf $RPM_BUILD_ROOT
147 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
148         $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
149
150 %if %{with kernel}
151 %install_kernel_modules -m drbd/drbd -d block
152 %endif
153
154 %if %{with userspace}
155 install user/{drbdadm,drbdmeta,drbdsetup} $RPM_BUILD_ROOT/sbin
156 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
157 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
158
159 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
160
161 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
162 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
163 %endif
164
165 %clean
166 rm -rf $RPM_BUILD_ROOT
167
168 %post -n kernel%{_alt_kernel}-block-drbd8
169 %depmod %{_kernel_ver}
170
171 %postun -n kernel%{_alt_kernel}-block-drbd8
172 %depmod %{_kernel_ver}
173
174 %post -n kernel%{_alt_kernel}-smp-block-drbd8
175 %depmod %{_kernel_ver}smp
176
177 %postun -n kernel%{_alt_kernel}-smp-block-drbd8
178 %depmod %{_kernel_ver}smp
179
180 %pre -n drbdsetup8
181 %groupadd -g 60 haclient
182
183 %post -n drbdsetup8
184 /sbin/chkconfig --add drbd
185 %service drbd restart
186
187 %preun -n drbdsetup8
188 if [ "$1" = "0" ]; then
189         %service drbd stop
190         /sbin/chkconfig --del drbd
191 fi
192
193 %postun -n drbdsetup8
194 if [ "$1" = "0" ]; then
195         %groupremove haclient
196 fi
197
198 %if %{with userspace}
199 %files -n drbdsetup8
200 %defattr(644,root,root,755)
201 %attr(755,root,root) /sbin/drbdadm
202 %attr(2754,root,haclient) /sbin/drbdsetup
203 %attr(2754,root,haclient) /sbin/drbdmeta
204 %attr(754,root,root) /etc/rc.d/init.d/drbd
205 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
206 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
207 %{_mandir}/man[58]/*
208 %endif
209
210 %if %{with kernel}
211 %if %{with up} || %{without dist_kernel}
212 %files -n kernel%{_alt_kernel}-block-drbd8
213 %defattr(644,root,root,755)
214 %doc ChangeLog README
215 /lib/modules/%{_kernel_ver}/block/drbd.ko*
216 %endif
217
218 %if %{with smp} && %{with dist_kernel}
219 %files -n kernel%{_alt_kernel}-smp-block-drbd8
220 %defattr(644,root,root,755)
221 %doc ChangeLog README
222 /lib/modules/%{_kernel_ver}smp/block/drbd.ko*
223 %endif
224 %endif
This page took 0.072471 seconds and 3 git commands to generate.