Logoj0ke.net Open Build Service > Projects > GFS > kernel-source > kernel-source-rt.spec
Sign Up | Log In

File kernel-source-rt.spec of Package kernel-source (Revision 8a28e0d4b516821f05fe09a754aac0c1)

Currently displaying revision 8a28e0d4b516821f05fe09a754aac0c1, show latest

 
1
#
2
# spec file for package kernel-source-rt (Version 2.6.27.4)
3
#
4
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
5
# This file and all modifications and additions to the pristine
6
# package are under the same license as the package itself.
7
#
8
# Please submit bugfixes or comments via http://bugs.opensuse.org/
9
#
10
11
# norootforbuild
12
# icecream 0
13
14
# FIXME: this check will go before the next release ...
15
16
%if 0%{?opensuse_bs}
17
# Strip off the build number ("y") from the "x.y" release number
18
%define source_rel %(release=%release; echo ${release%.*})
19
%else
20
# We don't have build numbers internally
21
%define source_rel %release
22
%endif
23
24
Name:         kernel-source-rt
25
Summary:      Dummy summary
26
Version:      2.6.27.4
27
Release:      <RELEASE>
28
License:      GPL
29
Group:        Development/Sources
30
AutoReqProv:  off
31
BuildRequires:  coreutils sed
32
BuildRequires:  fdupes
33
Requires(post): coreutils sed
34
%if ! 0%{?opensuse_bs}
35
BuildRequires:  kernel-dummy
36
%endif
37
ExclusiveArch: %ix86 x86_64
38
Provides:       linux
39
Provides:       kernel-source-rt = 2.6.27.4-%source_rel
40
%if "kernel-source-rt" == "kernel-source"
41
Provides:     linux lx_suse lx_sus22 lx_sus24
42
Obsoletes:    linux lx-gdt lx-hack lx-suse lx1162_1 lx1162_2 lx1212_1 lx1212_2 lx1213_1 lx1213_2 lx121_1 lx121_2 lx126_1 lx126_2 lx129_1 lx129_2 lx_large kernel_headers lx_suse lx_sus22 lx_sus24
43
%endif
44
Source0:      http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.tar.bz2
45
Source1:      source-post.sh
46
Source2:      kernel-source-rt.rpmlintrc
47
Source10:     preun.sh
48
Source11:     postun.sh
49
Source12:     pre.sh
50
Source13:     post.sh
51
Source14:     series.conf
52
Source15:     arch-symbols
53
Source16:     guards
54
Source21:     config.conf
55
Source23:     supported.conf
56
Source30:     config-subst
57
Source33:     check-for-config-changes
58
Source34:     check-supported-list
59
Source37:     README.SUSE
60
Source38:     kabi-checks
61
Source40:     build-source-timestamp
62
Source41:     built-in-where
63
Source42:     list-exported-symbols
64
Source43:     split-into-symsets
65
Source44:     find-provides
66
Source45:     module-renames
67
Source46:     modversions
68
Source47:     extract-modaliases
69
Source48:     macros.kernel-source
70
Source49:     kernel-module-subpackage
71
Source50:     kernel-syms.spec
72
Source51:     kernel-debug.spec
73
Source52:     kernel-default.spec
74
Source53:     kernel-kdump.spec
75
Source54:     kernel-pae.spec
76
Source55:     kernel-ppc64.spec
77
Source56:     kernel-ps3.spec
78
Source57:     kernel-rt.spec
79
Source58:     kernel-rt_debug.spec
80
Source59:     kernel-s390.spec
81
Source60:     kernel-trace.spec
82
Source61:     kernel-vanilla.spec
83
Source62:     kernel-xen.spec
84
Source100:    config.tar.bz2
85
Source101:    patches.arch.tar.bz2
86
Source102:    patches.drivers.tar.bz2
87
Source103:    patches.fixes.tar.bz2
88
Source104:    patches.rpmify.tar.bz2
89
Source105:    patches.suse.tar.bz2
90
Source107:    patches.xen.tar.bz2
91
Source108:    patches.addon.tar.bz2
92
Source109:    patches.kernel.org.tar.bz2
93
Source110:    patches.apparmor.tar.bz2
94
Source111:    patches.rt.tar.bz2
95
Source112:    patches.trace.tar.bz2
96
Source120:    kabi.tar.bz2
97
BuildRoot:    %_tmppath/%name-%version-build
98
Prefix:       /usr/src
99
100
# Build with bash instead of sh as the shell: this turns on bash
101
# extensions like <(...).
102
%define _buildshell /bin/bash
103
104
%define my_builddir %_builddir/%{name}-%{version}
105
106
%(chmod +x %_sourcedir/{arch-symbols,guards,config-subst,check-for-config-changes,kabi-checks})
107
108
%define symbols %(set -- $(%_sourcedir/arch-symbols %_target_cpu) $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
109
110
%define tolerate_unknown_new_config_options 1
111
112
%description
113
Dummy description.
114
115
%prep
116
if ! [ -e %_sourcedir/linux-2.6.27.tar.bz2 ]; then
117
    echo "Please get a copy of linux-2.6.27.tar.bz2 from" \
118
     "ftp://ftp.kernel.org/pub/linux/kernel/v2.6/."
119
fi
120
121
echo "Architecture symbol(s): %symbols"
122
123
# Unpack all sources and patches
124
%setup -q -c -T -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112
125
126
%build
127
# Release number without the EXTRAVERSION
128
RELEASE=%source_rel
129
while [ "$RELEASE" != "${RELEASE#[^0-9]*.}" ]; do
130
    RELEASE=${RELEASE#[^0-9]*.}
131
done
132
133
KERNELRELEASE=2.6.27.4-$RELEASE
134
135
case kernel-source-rt in
136
(*-rt)
137
    variant=-rt
138
    variant_symbols=RT
139
    ;;
140
(*)
141
    variant=
142
    variant_symbols=
143
    ;;
144
esac
145
146
cat > %_builddir/%{name}-%{version}/.rpm-defs <<EOF
147
KERNELRELEASE=$KERNELRELEASE
148
variant=$variant
149
EOF
150
151
mkdir -p $RPM_BUILD_ROOT/usr/src
152
cd $RPM_BUILD_ROOT/usr/src
153
154
# Unpack the vanilla kernel sources
155
bzip2 -cd %_sourcedir/linux-2.6.27.tar.bz2 \
156
| tar xf -
157
158
mv linux-2.6.27 linux-$KERNELRELEASE$variant
159
cd linux-$KERNELRELEASE$variant
160
161
chmod -x arch/arm/mach-at91/board-yl-9200.c # executable by accident (fixed in 2.6.27)
162
163
%_sourcedir/guards $variant_symbols %symbols < %_sourcedir/series.conf \
164
    > .patches
165
for patch in $(< .patches); do
166
    if ! patch -s -F0 -E -p1 --no-backup-if-mismatch \
167
          -i %_builddir/kernel-source-rt-2.6.27.4/$patch; then
168
    echo "*** Patch $patch failed ***"
169
    exit 1
170
    fi
171
done
172
173
if [ -f %_sourcedir/localversion ] ; then
174
    cat %_sourcedir/localversion > localversion
175
fi
176
177
cat > %my_builddir/kernel-source-rt.files <<EOF
178
%%%%defattr(-, root, root)
179
%%%%ghost /usr/src/linux$variant
180
%%%%ghost /usr/src/linux$variant-obj
181
/usr/src/linux-$KERNELRELEASE$variant
182
/usr/src/linux-$KERNELRELEASE$variant-obj
183
/usr/share/doc/packages/%name
184
/etc/rpm/macros.kernel-source
185
/usr/lib/rpm/kernel-module-subpackage
186
/lib/modules/*
187
EOF
188
189
for config in $(%_sourcedir/guards %symbols < %_sourcedir/config.conf | grep -v vanilla); do
190
    arch=${config%/*}
191
    flavor=${config#*/}
192
    config=%_builddir/%buildsubdir/config/$config
193
194
    case "$flavor" in
195
    *-*)
196
    echo "Flavor '$flavor' must not contain dashes." >&2
197
    exit 1
198
    ;;
199
    esac
200
201
    set -- kernel-$flavor $flavor
202
    case $flavor in
203
    (rt|rt_*)
204
    set -- "$@" RT
205
    ;;
206
    esac
207
208
    diff -q .patches \
209
     <(%_sourcedir/guards $* %symbols < %_sourcedir/series.conf) \
210
       || continue
211
212
#    source_tree=linux-$KERNELRELEASE$variant
213
    o=$RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant-obj/$arch/$flavor
214
    mkdir -p $o
215
    cat $config \
216
    | %_sourcedir/config-subst CONFIG_LOCALVERSION '"'-$RELEASE-$flavor'"' \
217
    | %_sourcedir/config-subst CONFIG_SUSE_KERNEL y \
218
    > $o/.config
219
220
    case $flavor in
221
    um)
222
    MAKE_ARGS="ARCH=$flavor SUBARCH=$arch O=$o" ;;
223
    *)
224
    MAKE_ARGS="ARCH=$arch O=$o" ;;
225
    esac
226
227
    # Works around a "fix" in mainline that ends up causing the makefile
228
    # to not be regenerated.
229
    echo "Automatically" > $o/Makefile
230
231
%if %{tolerate_unknown_new_config_options}
232
    yes '' | make oldconfig $MAKE_ARGS
233
%else
234
    cp $o/.config $o/.config.before
235
    make silentoldconfig $MAKE_ARGS < /dev/null
236
    %_sourcedir/check-for-config-changes $o/.config.before $o/.config
237
    rm -r $o/.config.before
238
%endif
239
240
    make prepare $MAKE_ARGS
241
    make scripts $MAKE_ARGS
242
    krel=$(make -s kernelrelease $MAKE_ARGS)
243
    if [ $KERNELRELEASE != "${krel%%-*}" ]; then
244
    echo "Kernel release mismatch: $KERNELRELEASE != ${krel%%-*}" >&2
245
    exit 1
246
    fi
247
    make clean $MAKE_ARGS
248
249
    mkdir -p $RPM_BUILD_ROOT/lib/modules/$krel
250
    ln -s ../../../usr/src/linux-$KERNELRELEASE$variant \
251
        $RPM_BUILD_ROOT/lib/modules/$krel/source
252
253
    # Replace the absolute with a relative path
254
    sed -e "s,$RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant,../../../linux-$KERNELRELEASE$variant,g" \
255
    -i $o/Makefile
256
    rm -f $o/.config.old
257
done
258
259
rm -f linux-$KERNELRELEASE$variant/.patches
260
261
# Hardlink duplicate files automatically (from package fdupes).
262
%fdupes $RPM_BUILD_ROOT
263
264
cd $RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant-obj
265
set -- *
266
[ -e %_target_cpu ] || ln -s $1 %_target_cpu
267
%ifarch ppc ppc64
268
[ -e ppc ] || ln -s $1 ppc
269
[ -e ppc64 ] || ln -s $1 ppc64
270
%endif
271
272
cd $RPM_BUILD_ROOT/usr/src
273
274
rm -f `find linux-$KERNELRELEASE$variant -name ".gitignore"`
275
276
# Remove $RPM_BUILD_ROOT prefix from symlinks.
277
for link in $(find $RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant-obj -type l); do
278
    target=$(readlink $link)
279
    rm -f $link
280
    ln -s ${target/$RPM_BUILD_ROOT/} $link
281
done
282
283
ln -sf linux$variant linux$variant  # dummy symlink
284
ln -sf linux$variant-obj linux$variant-obj  # dummy symlink
285
286
%install
287
source .rpm-defs
288
289
# Install the documentation and example Kernel Module Package.
290
DOC=$RPM_BUILD_ROOT/usr/share/doc/packages/%name
291
mkdir -p $DOC
292
cp %_sourcedir/README.SUSE $DOC
293
ln -s /usr/share/doc/packages/%name/README.SUSE \
294
    $RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant/
295
296
install -m 755 -d $RPM_BUILD_ROOT/etc/rpm
297
install -m 644 %_sourcedir/macros.kernel-source $RPM_BUILD_ROOT/etc/rpm/
298
install -m 755 -d $RPM_BUILD_ROOT/usr/lib/rpm
299
install -m 644 %_sourcedir/kernel-module-subpackage \
300
    $RPM_BUILD_ROOT/usr/lib/rpm/
301
302
sed -e "s:@KERNELRELEASE@:$KERNELRELEASE:g" \
303
    -e "s:@VARIANT@:$variant:g" \
304
    %_sourcedir/source-post.sh > kernel-source-rt-post.sh
305
306
%post -f kernel-source-rt-post.sh
307
%files -f kernel-source-rt.files
308