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