2 # - for 3rd generation cluster see cluster.spec
3 # - gfs2 and dlm kernel modules are in the kernel package
4 # (2.6.28.9-3 for example); gfs is the old GFS.
7 # - more kernel stuff (gnbd, ...), but gnbd looks dead,
8 # use iscsi, fc, aoe, nbd or sth instead
11 %bcond_without dist_kernel # without distribution kernel
12 %bcond_with kernel # build kernel module
13 %bcond_without userspace # don't build userspace package
14 %bcond_with verbose # verbose kernel module build
17 %undefine with_dist_kernel
19 %if "%{_alt_kernel}" != "%{nil}"
20 %undefine with_userspace
22 %if %{without userspace}
23 # nothing to be placed to debuginfo package
24 %define _enable_debug_packages 0
28 Summary: Shared-disk cluster file system
29 Summary(pl.UTF-8): Klastrowy system plików na współdzielonym dysku
35 Group: Applications/System
36 Source0: ftp://sources.redhat.com/pub/cluster/releases/cluster-%{version}.tar.gz
37 # Source0-md5: 379b560096e315d4b52e238a5c72ba4a
38 Patch0: %{name}-kernel-2.6.28.patch
39 Patch1: %{name}-llh.patch
40 Patch2: %{name}-blkid.patch
41 Patch3: %{name}-quota-nolist.patch
42 URL: http://sources.redhat.com/cluster/gfs/
43 BuildRequires: libblkid-devel >= 2.16
44 # which exactly version merged qq_ll_next into reserved in gfs2_quota struct?
45 BuildRequires: linux-libc-headers >= 7:2.6.38
46 BuildRequires: ncurses-devel
47 BuildRequires: openais-devel
48 BuildRequires: perl-base
49 %if %{with dist_kernel}
50 BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.27
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 %define _sbindir /sbin
57 GFS (Global File System) is a cluster file system. It allows a cluster
58 of computers to simultaneously use a block device that is shared
59 between them (with FC, iSCSI, NBD, etc...). GFS reads and writes to
60 the block device like a local filesystem, but also uses a lock module
61 to allow the computers coordinate their I/O so filesystem consistency
62 is maintained. One of the nifty features of GFS is perfect consistency
63 - changes made to the filesystem on one machine show up immediately on
64 all other machines in the cluster.
66 %description -l pl.UTF-8
67 GFS (Global File System) to klastrowy system plików. Pozwala klastrowi
68 komputerów na jednoczesne korzystanie z urządzenia blokowego
69 dzielonego między nimi (poprzez FC, iSCSI, NBD itp.). GFS odczytuje i
70 zapisuje urządzenie blokowe jak lokalny system plików, ale używa
71 dodatkowo modułu blokującego, aby umożliwić komputerom koordynowanie
72 ich operacji I/O w celu zachowania spójności systemu plików. Jedną z
73 szykownych możliwości GFS-a jest idealna spójność - zmiany wykonane w
74 systemie plików na jednej maszynie natychmiast pokazują się na
75 wszystkich innych maszynach w klastrze.
77 %package -n kernel%{_alt_kernel}-misc-gfs
78 Summary: gfs kernel module
79 Summary(pl.UTF-8): Moduł jądra gfs
80 Release: %{rel}@%{_kernel_ver_str}
82 Requires(post,postun): /sbin/depmod
83 %if %{with dist_kernel}
84 %requires_releq_kernel
85 Requires(postun): %releq_kernel
87 Provides: kernel(gfs) = %{version}-%{rel}
89 %description -n kernel%{_alt_kernel}-misc-gfs
92 %description -n kernel%{_alt_kernel}-misc-gfs -l pl.UTF-8
95 %package -n kernel%{_alt_kernel}-misc-gnbd
96 Summary: gnbd kernel module
97 Summary(pl.UTF-8): Moduł jądra gnbd
98 Release: %{rel}@%{_kernel_ver_str}
100 Requires(post,postun): /sbin/depmod
101 %if %{with dist_kernel}
102 %requires_releq_kernel
103 Requires(postun): %releq_kernel
105 Provides: kernel(gnbd) = %{version}-%{rel}
107 %description -n kernel%{_alt_kernel}-misc-gnbd
110 %description -n kernel%{_alt_kernel}-misc-gnbd -l pl.UTF-8
114 %setup -q -n cluster-%{version}
120 %{__perl} -pi -e 's/-lncurses/-lncurses -ltinfo/' gfs2/edit/Makefile
124 sed -i -e "s,\.\./\.\./\.\.,$PWD," gfs-kernel/src/gfs/Makefile
125 sed -i -e "s,\$(OBJDIR),$PWD," gfs-kernel/src/gfs/Makefile
127 sed -i -e "s,\.\./\.\.,$PWD," gnbd-kernel/src/Makefile
128 sed -i -e "s,\$(OBJDIR),$PWD," gnbd-kernel/src/Makefile
134 --cflags="%{rpmcflags} -Wall" \
135 --ldflags="%{rpmldflags}" \
136 --incdir=%{_includedir} \
137 --ncursesincdir=%{_includedir}/ncurses \
138 --libdir=%{_libdir} \
139 --libexecdir=%{_libdir} \
140 --mandir=%{_mandir} \
141 --prefix=%{_prefix} \
142 --sbindir=%{_sbindir} \
145 --without_kernel_modules
147 %if %{with userspace}
152 export KBUILD_NOPEDANTIC=1
153 %build_kernel_modules -C gfs-kernel/src/gfs -m gfs
154 #build_kernel_modules -C gnbd-kernel/src -m gnbd
158 rm -rf $RPM_BUILD_ROOT
160 %if %{with userspace}
161 %{__make} -C %{name} install \
162 DESTDIR=$RPM_BUILD_ROOT
164 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
165 mv $RPM_BUILD_ROOT/''etc/init.d/* $RPM_BUILD_ROOT/etc/rc.d/init.d
169 %install_kernel_modules -m gfs-kernel/src/gfs/gfs -d misc
170 #install_kernel_modules -m gnbd-kernel/src/gnbd -d misc
174 rm -rf $RPM_BUILD_ROOT
176 %if %{with userspace}
178 %defattr(644,root,root,755)
179 %attr(755,root,root) %{_sbindir}/fsck.gfs2
180 %attr(755,root,root) %{_sbindir}/gfs2_*
181 %attr(755,root,root) %{_sbindir}/mkfs.gfs2
182 %attr(755,root,root) %{_sbindir}/mount.gfs2
183 %attr(755,root,root) %{_sbindir}/umount.gfs2
184 %attr(754,root,root) /etc/rc.d/init.d/gfs2
185 %{_mandir}/man8/gfs2.8*
186 %{_mandir}/man8/gfs2_*.8*
187 %{_mandir}/man8/mkfs.gfs2.8*
191 %files -n kernel%{_alt_kernel}-misc-gfs
192 %defattr(644,root,root,755)
193 /lib/modules/%{_kernel_ver}/misc/gfs.ko*
194 #/lib/modules/%{_kernel_ver}/misc/gnbd.ko*