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