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