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