]>
Commit | Line | Data |
---|---|---|
e17d518f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without dist_kernel # build without distribution kernel-headers | |
4 | # | |
d3eef778 | 5 | Summary: Minimalistic libc subset for use with initramfs |
df4dc817 | 6 | Summary(pl.UTF-8): Zminimalizowany podzbiór biblioteki C do używania z initramfs |
d3eef778 | 7 | Name: klibc |
5b191cd6 | 8 | Version: 1.4.34 |
0de29ff3 | 9 | Release: 1 |
8c66903c | 10 | License: BSD/GPL |
d3eef778 | 11 | Group: Libraries |
cfacef84 | 12 | Source0: http://www.kernel.org/pub/linux/libs/klibc/Testing/%{name}-%{version}.tar.bz2 |
5b191cd6 | 13 | # Source0-md5: f503f328cc612d4ab523919692814804 |
cfacef84 | 14 | #Source0: http://www.kernel.org/pub/linux/libs/klibc/%{name}-%{version}.tar.bz2 |
0de29ff3 AM |
15 | Patch0: %{name}-klcc.patch |
16 | Patch1: %{name}-kill_interp_sohash.patch | |
321006c0 | 17 | URL: http://www.zytor.com/mailman/listinfo/klibc/ |
e17d518f | 18 | %{?with_dist_kernel:BuildRequires: kernel-headers >= 2.4} |
580efb58 | 19 | BuildRequires: bison |
20 | BuildRequires: flex | |
1a41b530 | 21 | BuildRequires: rpmbuild(macros) >= 1.153 |
e17d518f | 22 | BuildRequires: perl-base |
d3eef778 AM |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
24 | ||
e17d518f | 25 | %define no_install_post_strip 1 |
d3eef778 AM |
26 | |
27 | %description | |
28 | klibc, what is intended to be a minimalistic libc subset for use with | |
29 | initramfs. It is deliberately written for small size, minimal | |
30 | entaglement and portability, not speed. It is definitely a work in | |
31 | progress, and a lot of things are still missing. | |
32 | ||
df4dc817 JR |
33 | %description -l pl.UTF-8 |
34 | klibc w zamierzeniu ma być minimalistycznym podzbiorem biblioteki libc | |
35 | do użycia z initramfs. Celem jest minimalizacja, przenośność ale nie | |
36 | szybkość. klibc jest rozwijaną biblioteką w związku z czym nadal | |
d3eef778 AM |
37 | brakuje wielu rzeczy. |
38 | ||
bdde959a PS |
39 | %package devel |
40 | Summary: Development files for klibc | |
df4dc817 | 41 | Summary(pl.UTF-8): Pliki dla programistów klibc |
bdde959a | 42 | Group: Development/Libraries |
d5f6848a | 43 | Requires: %{name} = %{version}-%{release} |
bdde959a PS |
44 | Requires: binutils |
45 | %{?with_dist_kernel:Requires: kernel-headers >= 2.4} | |
46 | ||
47 | %description devel | |
48 | Small libc for building embedded applications - development files. | |
49 | ||
df4dc817 JR |
50 | %description devel -l pl.UTF-8 |
51 | Mała libc do budowania aplikacji wbudowanych - pliki dla programistów. | |
bdde959a PS |
52 | |
53 | %package static | |
54 | Summary: Static klibc libraries | |
df4dc817 | 55 | Summary(pl.UTF-8): Biblioteki statyczne klibc |
bdde959a | 56 | Group: Development/Libraries |
d5f6848a | 57 | Requires: %{name}-devel = %{version}-%{release} |
bdde959a PS |
58 | |
59 | %description static | |
60 | Static klibc libraries. | |
61 | ||
df4dc817 | 62 | %description static -l pl.UTF-8 |
bdde959a PS |
63 | Biblioteki statyczne klibc. |
64 | ||
7a694fa4 | 65 | %package utils-shared |
2c601817 | 66 | Summary: Utilities dynamically linked with klibc |
df4dc817 | 67 | Summary(pl.UTF-8): Narzędzia dynamicznie zlinkowane z klibc |
2c601817 | 68 | Group: Base |
036f735f | 69 | Requires: %{name} = %{version}-%{release} |
7a694fa4 AM |
70 | |
71 | %description utils-shared | |
036f735f JB |
72 | Utilities dynamically linked with klibc. |
73 | ||
df4dc817 JR |
74 | %description utils-shared -l pl.UTF-8 |
75 | Narzędzia dynamicznie zlinkowane z klibc. | |
7a694fa4 AM |
76 | |
77 | %package utils-static | |
2c601817 | 78 | Summary: Utilities statically linked with klibc |
df4dc817 | 79 | Summary(pl.UTF-8): Narzędzia statycznie zlinkowane z klibc |
2c601817 | 80 | Group: Base |
7a694fa4 AM |
81 | |
82 | %description utils-static | |
83 | Utilities staticly linked with klibc. | |
84 | ||
df4dc817 JR |
85 | %description utils-static -l pl.UTF-8 |
86 | Narzędzia statycznie zlinkowane z klibc. | |
036f735f | 87 | |
d3eef778 AM |
88 | %prep |
89 | %setup -q | |
1a41b530 | 90 | %patch0 -p1 |
65ee0145 | 91 | %patch1 -p1 |
d3eef778 AM |
92 | |
93 | %build | |
4f949b8e | 94 | ln -s %{_kernelsrcdir} linux |
cfacef84 | 95 | rm -rf usr/include/{asm,asm-generic,linux} |
54d29b74 PS |
96 | %ifarch ppc powerpc |
97 | if [ -d %{_kernelsrcdir}/include/asm-powerpc ]; then | |
cfacef84 PS |
98 | install -d usr/include/asm |
99 | cp -a %{_kernelsrcdir}/include/asm-ppc/* usr/include/asm/ | |
100 | cp -a %{_kernelsrcdir}/include/asm-powerpc/* usr/include/asm/ | |
54d29b74 | 101 | else |
cfacef84 | 102 | ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} usr/include/asm |
54d29b74 PS |
103 | fi |
104 | %else | |
cfacef84 | 105 | ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} usr/include/asm |
54d29b74 | 106 | %endif |
cfacef84 | 107 | cd usr/include |
bdde959a PS |
108 | ln -sf %{_kernelsrcdir}/include/asm-generic . |
109 | ln -sf %{_kernelsrcdir}/include/linux . | |
110 | %if %{with dist_kernel} | |
111 | [ ! -d arch/%{_target_base_arch}/linux ] && mkdir arch/%{_target_base_arch}/linux | |
112 | ln -sf %{_kernelsrcdir}/include/linux/autoconf-up.h arch/%{_target_base_arch}/linux/autoconf.h | |
113 | %endif | |
114 | for a in `ls arch`; do [ "$a" != "%{_target_base_arch}" ] && rm -rf arch/$a; done | |
cfacef84 | 115 | cd ../.. |
d3eef778 | 116 | |
f2698199 AM |
117 | %ifarch sparc |
118 | # hack; missing dependency in make system | |
cfacef84 | 119 | ( cd usr/klibc && %{__make} -f arch/sparc/Makefile.inc ARCH=sparc \ |
f2698199 AM |
120 | arch/sparc/sdiv.S arch/sparc/udiv.S arch/sparc/srem.S arch/sparc/urem.S ) |
121 | %endif | |
122 | ||
d3eef778 | 123 | %{__make} \ |
8c66903c | 124 | ARCH=%{_target_base_arch} \ |
f2698199 | 125 | HOSTCC="%{__cc}" \ |
278b233a AM |
126 | rpm_prefix=%{_prefix} \ |
127 | rpm_bindir=%{_bindir} \ | |
128 | rpm_includedir=%{_includedir}/klibc \ | |
129 | rpm_libdir=%{_libdir} \ | |
09055665 | 130 | SHLIBDIR=/%{_lib} \ |
d3eef778 | 131 | OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \ |
368a55c7 | 132 | -falign-jumps=0 -falign-loops=0 -ffreestanding" |
d3eef778 AM |
133 | |
134 | %install | |
135 | rm -rf $RPM_BUILD_ROOT | |
a8f95f0f | 136 | install -d $RPM_BUILD_ROOT/%{_lib} |
d3eef778 | 137 | install -d $RPM_BUILD_ROOT%{_includedir}/klibc |
7a694fa4 | 138 | install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static} |
d3eef778 | 139 | |
cfacef84 | 140 | cp -a usr/include/* $RPM_BUILD_ROOT%{_includedir}/klibc |
0de29ff3 AM |
141 | install klcc/klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc |
142 | install klcc/klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1 | |
cfacef84 PS |
143 | install usr/klibc/libc.* usr/klibc/arch/%{_target_base_arch}/crt0.o usr/klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc |
144 | install usr/klibc/klibc.so $RPM_BUILD_ROOT/%{_lib} | |
145 | install usr/dash/sh.shared $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh | |
146 | install usr/dash/sh.shared.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh.g | |
147 | install usr/dash/sh $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh | |
148 | install usr/dash/sh.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh.g | |
386f9626 | 149 | install usr/kinit/*/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared |
150 | install usr/kinit/*/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
cfacef84 PS |
151 | install usr/utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared |
152 | install usr/utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
7a694fa4 | 153 | |
d3eef778 AM |
154 | %clean |
155 | rm -rf $RPM_BUILD_ROOT | |
156 | ||
157 | %files | |
158 | %defattr(644,root,root,755) | |
0806e28c | 159 | %attr(755,root,root) /%{_lib}/klibc.so |
bdde959a PS |
160 | |
161 | %files devel | |
162 | %defattr(644,root,root,755) | |
00a0ff6f PS |
163 | %attr(755,root,root) %{_bindir}/klcc |
164 | %{_includedir}/klibc | |
d3eef778 | 165 | %dir %{_libdir}/klibc |
d3eef778 | 166 | %attr(755,root,root) %{_libdir}/klibc/*.so |
bdde959a | 167 | %{_libdir}/klibc/*.o |
00a0ff6f | 168 | %{_mandir}/man1/* |
7a694fa4 | 169 | |
bdde959a PS |
170 | %files static |
171 | %defattr(644,root,root,755) | |
172 | %{_libdir}/klibc/*.a | |
173 | ||
7a694fa4 AM |
174 | %files utils-shared |
175 | %defattr(644,root,root,755) | |
176 | %dir %{_libdir}/klibc/bin-shared | |
177 | %attr(755,root,root) %{_libdir}/klibc/bin-shared/* | |
178 | ||
179 | %files utils-static | |
180 | %defattr(644,root,root,755) | |
181 | %dir %{_libdir}/klibc/bin-static | |
182 | %attr(755,root,root) %{_libdir}/klibc/bin-static/* |