]> git.pld-linux.org Git - packages/drbd.git/blob - drbd.spec
- bconds up, smp removed
[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:        0.7.23
18 Release:        %{_rel}
19 License:        GPL
20 Group:          Base/Kernel
21 Source0:        http://oss.linbit.com/drbd/0.7/%{name}-%{version}.tar.gz
22 # Source0-md5:  3600d689e4e9bb45108c0c185a1e85c5
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}
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:       rc-scripts
57 Conflicts:      drbdsetup24
58
59 %description -n drbdsetup
60 Setup tool and init scripts for DRBD.
61
62 %description -n drbdsetup -l pl.UTF-8
63 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
64
65 %package -n kernel%{_alt_kernel}-block-drbd
66 Summary:        Kernel module with drbd - a block device designed to build high availibility clusters
67 Summary(pl.UTF-8):      Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
68 Release:        %{_rel}@%{_kernel_ver_str}
69 Group:          Base/Kernel
70 %{?with_dist_kernel:%requires_releq_kernel}
71 Requires(post,postun):  /sbin/depmod
72 Requires:       drbdsetup
73
74 %description -n kernel%{_alt_kernel}-block-drbd
75 drbd is a block device which is designed to build high availability
76 clusters. This is done by mirroring a whole block device via (a
77 dedicated) network. You could see it as a network RAID1.
78
79 %description -n kernel%{_alt_kernel}-block-drbd -l pl.UTF-8
80 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
81 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
82 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
83
84 %prep
85 %setup -q
86 %patch0 -p1
87
88 %build
89 %if %{with userspace}
90 %{__make} tools \
91         KVER=dummy \
92         CC="%{__cc}" \
93         OPTCFLAGS="%{rpmcflags}" \
94         LDFLAGS="%{rpmldflags}"
95 %endif
96
97 %if %{with kernel}
98 cd drbd
99 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
100 ln -sf Makefile-2.6 Makefile
101 # kernel module(s)
102 %build_kernel_modules -m drbd EXTRA_CFLAGS="-DNO_MORE_DEV_FS"
103 %endif
104
105 %install
106 rm -rf $RPM_BUILD_ROOT
107 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
108         $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
109
110 %if %{with kernel}
111 %install_kernel_modules -m drbd/drbd -d block
112 %endif
113
114 %if %{with userspace}
115 install user/{drbdadm,drbdsetup} $RPM_BUILD_ROOT/sbin
116 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
117 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
118
119 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
120
121 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
122 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
123 %endif
124
125 %clean
126 rm -rf $RPM_BUILD_ROOT
127
128 %post -n kernel%{_alt_kernel}-block-drbd
129 %depmod %{_kernel_ver}
130
131 %postun -n kernel%{_alt_kernel}-block-drbd
132 %depmod %{_kernel_ver}
133
134 %post -n drbdsetup
135 /sbin/chkconfig --add drbd
136 %service drbd restart
137
138 %preun -n drbdsetup
139 if [ "$1" = "0" ]; then
140         %service drbd stop
141         /sbin/chkconfig --del drbd
142 fi
143
144 %if %{with userspace}
145 %files -n drbdsetup
146 %defattr(644,root,root,755)
147 %attr(755,root,root) /sbin/*
148 %attr(754,root,root) /etc/rc.d/init.d/drbd
149 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
150 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
151 %{_mandir}/man[58]/*
152 %endif
153
154 %if %{with kernel}
155 %files -n kernel%{_alt_kernel}-block-drbd
156 %defattr(644,root,root,755)
157 %doc ChangeLog README
158 /lib/modules/%{_kernel_ver}/block/drbd.ko*
159 %endif
This page took 0.074518 seconds and 3 git commands to generate.