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