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