36 |
beyerle@PS |
1 |
# -------------------------------------------------------------------------------------------
|
|
|
2 |
#
|
|
|
3 |
# How to build for normal kernel
|
|
|
4 |
#
|
|
|
5 |
# rpmbuild -ba --target i686 --define 'kernel 2.6.18-1.2747.el5' unionfs.spec
|
|
|
6 |
# rpmbuild -ba --target x86_64 --define 'kernel 2.6.18-1.2747.el5' unionfs.spec
|
|
|
7 |
#
|
|
|
8 |
# How to build for normal kernel and XEN kernel
|
|
|
9 |
#
|
|
|
10 |
# rpmbuild -ba --target i686 --define 'kernel 2.6.18-1.2747.el5' --define 'buildxen 1' unionfs.spec
|
|
|
11 |
# rpmbuild -ba --target x86_64 --define 'kernel 2.6.18-1.2747.el5' --define 'buildxen 1' unionfs.spec
|
|
|
12 |
#
|
|
|
13 |
#
|
|
|
14 |
# How to build for normal kernel and PAE kernel
|
|
|
15 |
#
|
|
|
16 |
# rpmbuild -ba --target i686 --define 'kernel 2.6.18-1.2747.el5' --define 'buildPAE 1' unionfs.spec
|
|
|
17 |
# rpmbuild -ba --target x86_64 --define 'kernel 2.6.18-1.2747.el5' --define 'buildPAE 1' unionfs.spec
|
|
|
18 |
#
|
|
|
19 |
# How to build for all kernel (normal, xen, PAE)
|
|
|
20 |
#
|
|
|
21 |
# rpmbuild -ba --target i686 --define 'kernel 2.6.18-1.2747.el5' --define 'buildall 1' unionfs.spec
|
|
|
22 |
# rpmbuild -ba --target x86_64 --define 'kernel 2.6.18-1.2747.el5' --define 'buildall 1' unionfs.spec
|
|
|
23 |
#
|
|
|
24 |
#
|
|
|
25 |
# How to build for the running kernel:
|
|
|
26 |
#
|
|
|
27 |
# rpmbuild -ba --target i686 unionfs.spec
|
|
|
28 |
# rpmbuild -ba --target x86_64 unionfs.spec
|
|
|
29 |
#
|
|
|
30 |
# -------------------------------------------------------------------------------------------
|
|
|
31 |
|
|
|
32 |
%{!?buildxen:%define buildxen 0}
|
|
|
33 |
%{!?buildPAE:%define buildPAE 0}
|
|
|
34 |
|
|
|
35 |
%{?buildall:%define buildxen 1}
|
|
|
36 |
%{?buildall:%define buildPAE 1}
|
|
|
37 |
|
|
|
38 |
%{?!kernel:%define kernel %(rpm -q kernel-devel | tail -1 | sed -e 's|kernel-devel-||')}
|
|
|
39 |
|
|
|
40 |
%define kversion %(echo "%{kernel}" | sed -e 's|-.*||')
|
|
|
41 |
%define krelease %(echo "%{kernel}" | sed -e 's|.*-||')
|
|
|
42 |
|
|
|
43 |
%define kernel_src_path %{_usrsrc}/kernels/%{kernel}-%{_target_cpu}
|
|
|
44 |
%define kernel_xen_src_path %{_usrsrc}/kernels/%{kernel}-xen-%{_target_cpu}
|
|
|
45 |
%define kernel_PAE_src_path %{_usrsrc}/kernels/%{kernel}-PAE-%{_target_cpu}
|
|
|
46 |
|
|
|
47 |
%define kernel_moduledir /lib/modules/%{kernel}
|
|
|
48 |
%define kernel_xen_moduledir /lib/modules/%{kernel}xen
|
|
|
49 |
%define kernel_PAE_moduledir /lib/modules/%{kernel}PAE
|
|
|
50 |
|
|
|
51 |
%define pkg_name unionfs
|
|
|
52 |
%define kmdl_name kernel-module-%{pkg_name}-%{kernel}
|
|
|
53 |
|
|
|
54 |
# -------------------------------------------------------------------------------------------
|
|
|
55 |
|
|
|
56 |
Summary: A Stackable Unification File System
|
|
|
57 |
Name: %{pkg_name}
|
|
|
58 |
Version: 1.4
|
|
|
59 |
Release: 2.sl5.psi
|
|
|
60 |
Epoch: 0
|
|
|
61 |
Packager: Urs Beyerle <urs.beyerle@psi.ch>
|
|
|
62 |
License: GPL
|
|
|
63 |
Group: System Environment/Kernel
|
|
|
64 |
Source0: ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/%{name}-%{version}.tar.gz
|
|
|
65 |
URL: http://www.am-utils.org/project-unionfs.html
|
|
|
66 |
Patch0: unionfs-1.4-unionfs.h.patch
|
|
|
67 |
Patch1: unionfs-1.4-stale_inode.c.patch
|
|
|
68 |
Patch2: unionfs-1.4-Makefile.patch
|
|
|
69 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
|
|
70 |
Requires: kernel-module-%{pkg_name} >= %{version}-%{release}
|
|
|
71 |
BuildRequires: kernel-devel = %{kernel}, e2fsprogs-devel
|
|
|
72 |
%if %{buildxen}
|
|
|
73 |
BuildRequires: kernel-xen-devel = %{kernel}
|
|
|
74 |
%endif
|
|
|
75 |
%if %{buildPAE}
|
|
|
76 |
BuildRequires: kernel-PAE-devel = %{kernel}
|
|
|
77 |
%endif
|
|
|
78 |
|
|
|
79 |
%description
|
|
|
80 |
This project builds a stackable unification file system, which
|
|
|
81 |
can appear to merge the contents of several directories (branches),
|
|
|
82 |
while keeping their physical content separate. Unionfs is useful
|
|
|
83 |
for unified source tree management, merged contents of split
|
|
|
84 |
CD-ROM, merged separate software package directories, data grids,
|
|
|
85 |
and more. Unionfs allows any mix of read-only and read-write
|
|
|
86 |
branches, as well as insertion and deletion of branches anywhere
|
|
|
87 |
in the fan-out. To maintain unix semantics, Unionfs handles
|
|
|
88 |
elimination of duplicates, partial-error conditions, and more.
|
|
|
89 |
Unionfs is part of the larger FiST project.
|
|
|
90 |
|
|
|
91 |
Kernel modules for unionfs are in kernel-module-%{pkg_name} rpms.
|
|
|
92 |
|
|
|
93 |
%package -n %{kmdl_name}
|
|
|
94 |
Summary: kernel modules for %{name}.
|
|
|
95 |
Group: System Environment/Kernel
|
|
|
96 |
License: GPL
|
|
|
97 |
Provides: kernel-module-%{pkg_name} = %{epoch}:%{version}-%{release}
|
|
|
98 |
Requires: %{pkg_name}
|
|
|
99 |
|
|
|
100 |
%description -n %{kmdl_name}
|
|
|
101 |
Kernel modules for %{name}.
|
|
|
102 |
|
|
|
103 |
%if %{buildxen}
|
|
|
104 |
%package -n %{kmdl_name}xen
|
|
|
105 |
Summary: xen kernel modules for %{name}.
|
|
|
106 |
Group: System Environment/Kernel
|
|
|
107 |
License: GPL
|
|
|
108 |
Provides: kernel-module-%{pkg_name} = %{epoch}:%{version}-%{release}
|
|
|
109 |
Requires: %{pkg_name}
|
|
|
110 |
|
|
|
111 |
%description -n %{kmdl_name}xen
|
|
|
112 |
XEN kernel modules for %{name}.
|
|
|
113 |
%endif
|
|
|
114 |
|
|
|
115 |
%if %{buildPAE}
|
|
|
116 |
%package -n %{kmdl_name}PAE
|
|
|
117 |
Summary: PAE kernel modules for %{name}.
|
|
|
118 |
Group: System Environment/Kernel
|
|
|
119 |
License: GPL
|
|
|
120 |
Provides: kernel-module-%{pkg_name} = %{epoch}:%{version}-%{release}
|
|
|
121 |
Requires: %{pkg_name}
|
|
|
122 |
|
|
|
123 |
%description -n %{kmdl_name}PAE
|
|
|
124 |
PAE kernel modules for %{name}.
|
|
|
125 |
%endif
|
|
|
126 |
|
|
|
127 |
%prep
|
|
|
128 |
%setup -q
|
|
|
129 |
|
|
|
130 |
%patch0 -p1
|
|
|
131 |
%patch1 -p1
|
|
|
132 |
%patch2 -p1
|
|
|
133 |
|
|
|
134 |
%build
|
|
|
135 |
echo -e "\nDriver version: %{version}\nKernel version: %{kernel}\n"
|
|
|
136 |
|
|
|
137 |
### kernel
|
|
|
138 |
make clean
|
|
|
139 |
KVERS="%{kernel}" PREFIX=${RPM_BUILD_ROOT}%{_prefix} make unionfs.ko
|
|
|
140 |
|
|
|
141 |
INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kernel}/kernel"
|
|
|
142 |
mkdir -p "${INST_MODLIB}/fs/unionfs"
|
|
|
143 |
install -p -m 744 unionfs.ko "${INST_MODLIB}/fs/unionfs/"
|
|
|
144 |
|
|
|
145 |
### XEN kernel
|
|
|
146 |
%if %{buildxen}
|
|
|
147 |
make clean
|
|
|
148 |
KVERS="%{kernel}xen" PREFIX=${RPM_BUILD_ROOT}%{_prefix} make unionfs.ko
|
|
|
149 |
INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kernel}xen/kernel"
|
|
|
150 |
mkdir -p "${INST_MODLIB}/fs/unionfs"
|
|
|
151 |
install -p -m 744 unionfs.ko "${INST_MODLIB}/fs/unionfs/"
|
|
|
152 |
%endif
|
|
|
153 |
|
|
|
154 |
### PAE kernel
|
|
|
155 |
%if %{buildPAE}
|
|
|
156 |
make clean
|
|
|
157 |
KVERS="%{kernel}PAE" PREFIX=${RPM_BUILD_ROOT}%{_prefix} make unionfs.ko
|
|
|
158 |
INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kernel}PAE/kernel"
|
|
|
159 |
mkdir -p "${INST_MODLIB}/fs/unionfs"
|
|
|
160 |
install -p -m 744 unionfs.ko "${INST_MODLIB}/fs/unionfs/"
|
|
|
161 |
%endif
|
|
|
162 |
|
|
|
163 |
### build statically linked unionctl
|
|
|
164 |
make clean
|
|
|
165 |
cp -a Makefile Makefile.ori
|
|
|
166 |
sed -i "s|^CC.*=.*gcc|CC = 'gcc -static'|" Makefile
|
|
|
167 |
make utils
|
|
|
168 |
mv -f utils/unionctl utils/unionctl.static
|
|
|
169 |
mv -f Makefile.ori Makefile
|
|
|
170 |
|
|
|
171 |
### build utils
|
|
|
172 |
make clean
|
|
|
173 |
make utils
|
|
|
174 |
|
|
|
175 |
|
|
|
176 |
%install
|
|
|
177 |
mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/sbin
|
|
|
178 |
mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man4
|
|
|
179 |
mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man8
|
|
|
180 |
|
|
|
181 |
cp -a utils/unionctl ${RPM_BUILD_ROOT}/%{_prefix}/sbin
|
|
|
182 |
cp -a utils/unionctl.static ${RPM_BUILD_ROOT}/%{_prefix}/sbin
|
|
|
183 |
cp -a utils/uniondbg ${RPM_BUILD_ROOT}/%{_prefix}/sbin
|
|
|
184 |
cp -a utils/unionimap ${RPM_BUILD_ROOT}/%{_prefix}/sbin
|
|
|
185 |
|
|
|
186 |
cp man/unionfs.4 ${RPM_BUILD_ROOT}/%{_mandir}/man4
|
|
|
187 |
cp man/unionctl.8 ${RPM_BUILD_ROOT}/%{_mandir}/man8
|
|
|
188 |
cp man/uniondbg.8 ${RPM_BUILD_ROOT}/%{_mandir}/man8
|
|
|
189 |
cp man/unionimap.8 ${RPM_BUILD_ROOT}/%{_mandir}/man8
|
|
|
190 |
|
|
|
191 |
|
|
|
192 |
%clean
|
|
|
193 |
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|
|
194 |
|
|
|
195 |
%postun -n %{kmdl_name}
|
|
|
196 |
depmod -a %{kernel} >/dev/null 2>&1 || :
|
|
|
197 |
|
|
|
198 |
%post -n %{kmdl_name}
|
|
|
199 |
depmod -a %{kernel} >/dev/null 2>&1 || :
|
|
|
200 |
|
|
|
201 |
%if %{buildxen}
|
|
|
202 |
%postun -n %{kmdl_name}xen
|
|
|
203 |
depmod -a %{kernel}xen >/dev/null 2>&1 || :
|
|
|
204 |
|
|
|
205 |
%post -n %{kmdl_name}xen
|
|
|
206 |
depmod -a %{kernel}xen >/dev/null 2>&1 || :
|
|
|
207 |
%endif
|
|
|
208 |
|
|
|
209 |
%if %{buildPAE}
|
|
|
210 |
%postun -n %{kmdl_name}PAE
|
|
|
211 |
depmod -a %{kernel}PAE >/dev/null 2>&1 || :
|
|
|
212 |
|
|
|
213 |
%post -n %{kmdl_name}PAE
|
|
|
214 |
depmod -a %{kernel}PAE >/dev/null 2>&1 || :
|
|
|
215 |
%endif
|
|
|
216 |
|
|
|
217 |
|
|
|
218 |
%files
|
|
|
219 |
%defattr(-,root,root,-)
|
|
|
220 |
%doc AUTHORS BUGS ChangeLog COPYING INSTALL NEWS README
|
|
|
221 |
%{_prefix}/sbin/*
|
|
|
222 |
%{_mandir}/man4/*
|
|
|
223 |
%{_mandir}/man8/*
|
|
|
224 |
|
|
|
225 |
%files -n %{kmdl_name}
|
|
|
226 |
%defattr(-,root,root,-)
|
|
|
227 |
/lib/modules/%{kernel}/kernel/fs/unionfs
|
|
|
228 |
|
|
|
229 |
%if %{buildxen}
|
|
|
230 |
%files -n %{kmdl_name}xen
|
|
|
231 |
%defattr(-,root,root,-)
|
|
|
232 |
/lib/modules/%{kernel}xen/kernel/fs/unionfs
|
|
|
233 |
%endif
|
|
|
234 |
|
|
|
235 |
%if %{buildPAE}
|
|
|
236 |
%files -n %{kmdl_name}PAE
|
|
|
237 |
%defattr(-,root,root,-)
|
|
|
238 |
/lib/modules/%{kernel}PAE/kernel/fs/unionfs
|
|
|
239 |
%endif
|
|
|
240 |
|
|
|
241 |
|
|
|
242 |
%changelog
|
|
|
243 |
* Wed Jan 10 2007 Urs Beyerle <urs.beyerle@psi.ch> 1.4-2.sl5.psi
|
|
|
244 |
- buildsmp removed
|
|
|
245 |
- buildxen added (default buildxen=0)
|
|
|
246 |
- buildPAE added (default buildPAE=0
|
|
|
247 |
- buildall added
|
|
|
248 |
|
|
|
249 |
* Tue Jan 09 2007 Urs Beyerle <urs.beyerle@psi.ch> 1.4-1.sl5.psi
|
|
|
250 |
- add patches to build with SL5 kernel
|
|
|
251 |
- add BuildRequires: e2fsprogs-devel
|
|
|
252 |
- made some small changes in build and install sections
|
|
|
253 |
- add man/unionimap.8
|
|
|
254 |
- change gcc -static to 'gcc -static' in the sed command
|
|
|
255 |
- build for SL5 alpha
|
|
|
256 |
|
|
|
257 |
* Mon Oct 16 2006 Urs Beyerle <urs.beyerle@psi.ch> 1.1.5-2.sl4.psi
|
|
|
258 |
- add unionctl.static (statically linked unionctl), needed for LiveCD
|
|
|
259 |
|
|
|
260 |
* Thu Aug 31 2006 Urs Beyerle <urs.beyerle@psi.ch> 1.1.5-1.sl4.psi
|
|
|
261 |
- inital build.
|