]>
Commit | Line | Data |
---|---|---|
1 | # NOTE: | |
2 | # - obsolete, for 3rd generation cluster see cluster.spec and gfs2-utils.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. | |
5 | # | |
6 | # TODO: | |
7 | # - more kernel stuff (gnbd, ...), but gnbd looks dead, | |
8 | # use iscsi, fc, aoe, nbd or sth instead | |
9 | # | |
10 | # Conditional build: | |
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 | |
15 | ||
16 | %if %{without kernel} | |
17 | %undefine with_dist_kernel | |
18 | %endif | |
19 | %if "%{_alt_kernel}" != "%{nil}" | |
20 | %undefine with_userspace | |
21 | %endif | |
22 | %if %{without userspace} | |
23 | # nothing to be placed to debuginfo package | |
24 | %define _enable_debug_packages 0 | |
25 | %endif | |
26 | ||
27 | %define rel 1 | |
28 | Summary: Shared-disk cluster file system | |
29 | Summary(pl.UTF-8): Klastrowy system plików na współdzielonym dysku | |
30 | Name: gfs2 | |
31 | Version: 2.03.11 | |
32 | Release: %{rel} | |
33 | Epoch: 1 | |
34 | License: GPL v2 | |
35 | Group: Applications/System | |
36 | Source0: ftp://sources.redhat.com/pub/cluster/releases/cluster-%{version}.tar.gz | |
37 | # Source0-md5: 712b9f583472d1de614641bc0f4a0aaf | |
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 | Patch4: cluster-kernel.patch | |
43 | URL: http://sources.redhat.com/cluster/gfs/ | |
44 | BuildRequires: libblkid-devel >= 2.16 | |
45 | # which exactly version merged qq_ll_next into reserved in gfs2_quota struct? | |
46 | BuildRequires: linux-libc-headers >= 7:2.6.38 | |
47 | BuildRequires: ncurses-devel | |
48 | BuildRequires: perl-base | |
49 | %if %{with dist_kernel} | |
50 | BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.27 | |
51 | %endif | |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
53 | ||
54 | %define _sbindir /sbin | |
55 | ||
56 | %description | |
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. | |
65 | ||
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. | |
76 | ||
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} | |
81 | Group: Base/Kernel | |
82 | Requires(post,postun): /sbin/depmod | |
83 | %if %{with dist_kernel} | |
84 | %requires_releq_kernel | |
85 | Requires(postun): %releq_kernel | |
86 | %endif | |
87 | Provides: kernel(gfs) = %{version}-%{rel} | |
88 | ||
89 | %description -n kernel%{_alt_kernel}-misc-gfs | |
90 | gfs kernel module. | |
91 | ||
92 | %description -n kernel%{_alt_kernel}-misc-gfs -l pl.UTF-8 | |
93 | Moduł jądra gfs. | |
94 | ||
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} | |
99 | Group: Base/Kernel | |
100 | Requires(post,postun): /sbin/depmod | |
101 | %if %{with dist_kernel} | |
102 | %requires_releq_kernel | |
103 | Requires(postun): %releq_kernel | |
104 | %endif | |
105 | Provides: kernel(gnbd) = %{version}-%{rel} | |
106 | ||
107 | %description -n kernel%{_alt_kernel}-misc-gnbd | |
108 | gnbd kernel module. | |
109 | ||
110 | %description -n kernel%{_alt_kernel}-misc-gnbd -l pl.UTF-8 | |
111 | Moduł jądra gnbd. | |
112 | ||
113 | %prep | |
114 | %setup -q -n cluster-%{version} | |
115 | %patch0 -p1 | |
116 | %patch1 -p1 | |
117 | %patch2 -p1 | |
118 | %patch3 -p1 | |
119 | %patch4 -p1 | |
120 | ||
121 | %{__perl} -pi -e 's/-lncurses/-lncurses -ltinfo/' gfs2/edit/Makefile | |
122 | ||
123 | %if %{with kernel} | |
124 | # gfs | |
125 | sed -i -e "s,\.\./\.\./\.\.,$PWD," gfs-kernel/src/gfs/Makefile | |
126 | sed -i -e "s,\$(OBJDIR),$PWD," gfs-kernel/src/gfs/Makefile | |
127 | # gnbd | |
128 | sed -i -e "s,\.\./\.\.,$PWD," gnbd-kernel/src/Makefile | |
129 | sed -i -e "s,\$(OBJDIR),$PWD," gnbd-kernel/src/Makefile | |
130 | %endif | |
131 | ||
132 | %build | |
133 | ./configure \ | |
134 | --cc="%{__cc}" \ | |
135 | --cflags="%{rpmcflags} -Wall" \ | |
136 | --ldflags="%{rpmldflags}" \ | |
137 | --incdir=%{_includedir} \ | |
138 | --ncursesincdir=%{_includedir}/ncurses \ | |
139 | --libdir=%{_libdir} \ | |
140 | --libexecdir=%{_libexecdir} \ | |
141 | --mandir=%{_mandir} \ | |
142 | --prefix=%{_prefix} \ | |
143 | --sbindir=%{_sbindir} \ | |
144 | --without_gfs \ | |
145 | --without_gnbd \ | |
146 | --without_kernel_modules | |
147 | ||
148 | %if %{with userspace} | |
149 | %{__make} -C %{name} | |
150 | %endif | |
151 | ||
152 | %if %{with kernel} | |
153 | export KBUILD_NOPEDANTIC=1 | |
154 | %build_kernel_modules -C gfs-kernel/src/gfs -m gfs | |
155 | #build_kernel_modules -C gnbd-kernel/src -m gnbd | |
156 | %endif | |
157 | ||
158 | %install | |
159 | rm -rf $RPM_BUILD_ROOT | |
160 | ||
161 | %if %{with userspace} | |
162 | %{__make} -C %{name} install \ | |
163 | DESTDIR=$RPM_BUILD_ROOT | |
164 | ||
165 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d | |
166 | %{__mv} $RPM_BUILD_ROOT/''etc/init.d/* $RPM_BUILD_ROOT/etc/rc.d/init.d | |
167 | %endif | |
168 | ||
169 | %if %{with kernel} | |
170 | %install_kernel_modules -m gfs-kernel/src/gfs/gfs -d misc | |
171 | #install_kernel_modules -m gnbd-kernel/src/gnbd -d misc | |
172 | %endif | |
173 | ||
174 | %clean | |
175 | rm -rf $RPM_BUILD_ROOT | |
176 | ||
177 | %if %{with userspace} | |
178 | %files | |
179 | %defattr(644,root,root,755) | |
180 | %attr(755,root,root) %{_sbindir}/fsck.gfs2 | |
181 | %attr(755,root,root) %{_sbindir}/gfs2_* | |
182 | %attr(755,root,root) %{_sbindir}/mkfs.gfs2 | |
183 | %attr(755,root,root) %{_sbindir}/mount.gfs2 | |
184 | %attr(755,root,root) %{_sbindir}/umount.gfs2 | |
185 | %attr(754,root,root) /etc/rc.d/init.d/gfs2 | |
186 | %{_mandir}/man8/gfs2.8* | |
187 | %{_mandir}/man8/gfs2_*.8* | |
188 | %{_mandir}/man8/mkfs.gfs2.8* | |
189 | %endif | |
190 | ||
191 | %if %{with kernel} | |
192 | %files -n kernel%{_alt_kernel}-misc-gfs | |
193 | %defattr(644,root,root,755) | |
194 | /lib/modules/%{_kernel_ver}/misc/gfs.ko* | |
195 | #/lib/modules/%{_kernel_ver}/misc/gnbd.ko* | |
196 | %endif |