]> git.pld-linux.org Git - packages/linux-libc-headers.git/blob - linux-libc-headers.spec
- rel 5
[packages/linux-libc-headers.git] / linux-libc-headers.spec
1 Summary:        Linux kernel headers for use with C libraries
2 Summary(pl):    Nag³ówki j±dra Linuksa do u¿ytku z bibliotekami C
3 Name:           linux-libc-headers
4 Version:        2.6.12.0
5 Release:        5
6 Epoch:          7
7 License:        GPL
8 Group:          Development
9 Source0:        http://ep09.pld-linux.org/~mmazur/linux-libc-headers/%{name}-%{version}.tar.bz2
10 # Source0-md5:  eae2f562afe224ad50f65a6acfb4252c
11 Patch0:         %{name}-esfq.patch
12 Patch1:         %{name}-wrr.patch
13 Patch2:         %{name}-netfilter.patch
14 Patch3:         %{name}-fbsplash.patch
15 Patch4:         %{name}-tc-u32-mark.patch
16 Patch5:         %{name}-imq.patch
17 Patch6:         %{name}-endian.patch
18 # based on http://people.redhat.com/sgrubb/audit/audit.h
19 Patch7:         %{name}-audit.patch
20 AutoReqProv:    no
21 BuildRequires:  rpmbuild(macros) >= 1.213
22 Requires(pre):  fileutils
23 Provides:       alsa-driver-devel
24 Provides:       i2c-devel = 2.8.2
25 Provides:       glibc-kernel-headers = %{epoch}:%{version}-%{release}
26 Obsoletes:      alsa-driver-devel
27 Obsoletes:      glibc-kernheaders
28 Obsoletes:      glibc-kernel-headers
29 Conflicts:      lm_sensors-devel < 2.8.2-2
30 ExclusiveOS:    Linux
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %define         no_install_post_strip           1
34
35 %ifarch %{x8664} ppc64 s390x sparc sparc64 sparcv9
36 %define         dodual  1
37 %else
38 %define         dodual  0
39 %endif
40
41 %description
42 This package includes the C header files that specify the interface
43 between the Linux kernel and userspace libraries and programs. The
44 header files define structures and constants that are needed for
45 building most standard programs and are also needed for rebuilding the
46 glibc package.
47
48 %description -l pl
49 Ten pakiet zawiera pliki nag³ówkowe C, które definiuj± interfejs
50 miêdzy j±drem Linuksa a bibliotekami i programami dzia³aj±cymi w
51 przestrzeni u¿ytkownika. Pliki nag³ówkowe definiuj± struktury i sta³e
52 potrzebne do zbudowania wiêkszo¶ci standardowych programów, s± tak¿e
53 potrzebne do przebudowania pakietu glibc.
54
55 %prep
56 %setup -q
57 %patch0 -p1
58 %patch1 -p1
59 %patch2 -p0
60 %patch3 -p1
61 %patch4 -p1
62 %patch5 -p1
63 %patch6 -p1
64 %patch7 -p1
65
66 %build
67 %ifarch %{x8664}
68 a1=i386
69 a2=x86_64
70 c1='defined(__i386__)'
71 c2='defined(__x86_64__)'
72 cond1=
73 %endif
74 %ifarch ppc64
75 a1=ppc
76 a2=ppc64
77 c1='defined(__powerpc__) && !defined(__powerpc64__)'
78 c2='defined(__powerpc64__)'
79 %endif
80 %ifarch s390 s390x
81 a1=sparc
82 a2=sparc64
83 c1='defined(__s390__) && !defined(__s390x__)'
84 c2='defined(__s390x__)'
85 %endif
86 %ifarch sparc sparcv9 sparc64
87 a1=sparc
88 a2=sparc64
89 c1='defined(__sparc__) && !defined(__arch64__)'
90 c2='defined(__sparc__) && defined(__arch64__)'
91 %endif
92
93 %if %{dodual}
94 cd include
95 rm -f asm
96 mkdir asm
97
98 for h in `( ls asm-${a1}; ls asm-${a2} ) | grep '\.h$' | sort -u`; do
99         name=`echo $h | tr a-z. A-Z_`
100         # common header
101         cat > asm/$h << EOF
102 /* All asm/ files are generated and point to the corresponding
103  * file in asm-${a1} or asm-${a2}.
104  */
105
106 #ifndef __ASM_STUB_${name}__
107 #define __ASM_STUB_${name}__
108
109 #  if ${c1}
110 EOF
111
112         if [ -f asm-${a1}/$h ]; then
113                 echo "#    include <asm-${a1}/$h>" >> asm/$h
114         else
115                 echo "#    error <asm-${a1}/$h> does not exist" >> asm/$h
116         fi
117
118         cat >> asm/$h <<EOF
119 #  endif
120 #  if ${c2}
121 EOF
122
123         if [ -f asm-${a2}/$h ]; then
124                 echo "#    include <asm-${a2}/$h>" >> asm/$h
125         else
126                 echo "#    error <asm-${a2}/$h> does not exist" >> asm/$h
127         fi
128
129         # common footer
130         cat >> asm/$h <<EOF
131 #  endif
132
133 #endif /* !__ASM_STUB_${name}__ */
134 EOF
135
136 done
137 echo "asm asm-${a1} asm-${a2}" > asmdirs
138 %endif
139
140 %install
141 rm -rf $RPM_BUILD_ROOT
142 install -d $RPM_BUILD_ROOT%{_includedir}
143
144 cd include
145 %if %{dodual}
146 cp -a `cat asmdirs` $RPM_BUILD_ROOT%{_includedir}
147 %else
148 cp -a asm-%{_target_base_arch} $RPM_BUILD_ROOT%{_includedir}/asm
149 %endif
150 cp -a linux $RPM_BUILD_ROOT%{_includedir}
151 cp -a sound $RPM_BUILD_ROOT%{_includedir}
152
153 find $RPM_BUILD_ROOT%{_includedir} -type f \
154         '(' -name '*.orig' -o -name '*~' ')' | xargs -r rm
155
156 %clean
157 rm -rf $RPM_BUILD_ROOT
158
159 %pre
160 [ ! -L /usr/include/linux ] || rm -f /usr/include/linux
161 [ ! -L /usr/include/asm ] || rm -f /usr/include/asm
162 [ ! -L /usr/include/sound ] || rm -f /usr/include/sound
163 %ifarch sparc sparcv9 sparc64
164 [ ! -L /usr/include/asm-sparc ] || rm -f /usr/include/asm-sparc
165 [ ! -L /usr/include/asm-sparc64 ] || rm -f /usr/include/asm-sparc64
166 %endif
167
168 %files
169 %defattr(644,root,root,755)
170 %{_includedir}/linux
171 %{_includedir}/asm*
172 %{_includedir}/sound
This page took 0.040343 seconds and 3 git commands to generate.