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