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