3 %bcond_without dist_kernel # build without distribution kernel-headers
5 Summary: Minimalistic libc subset for use with initramfs
6 Summary(pl): Zminimalizowany podzbiór biblioteki C do u¿ywania z initramfs
12 #Source0: http://www.kernel.org/pub/linux/libs/klibc/Testing/%{name}-%{version}.tar.bz2
13 Source0: http://www.kernel.org/pub/linux/libs/klibc/%{name}-%{version}.tar.bz2
14 # Source0-md5: 7068f3d33c041a096267c6c9eafe61a6
15 Patch0: %{name}-klcc.patch
16 Patch1: %{name}-kill_interp_sohash.patch
17 Patch2: %{name}-ash-fix-mktemp-syntax.patch
18 URL: http://www.zytor.com/mailman/listinfo/klibc/
19 %{?with_dist_kernel:BuildRequires: kernel-headers >= 2.4}
22 BuildRequires: rpmbuild(macros) >= 1.153
23 BuildRequires: perl-base
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 %define no_install_post_strip 1
29 klibc, what is intended to be a minimalistic libc subset for use with
30 initramfs. It is deliberately written for small size, minimal
31 entaglement and portability, not speed. It is definitely a work in
32 progress, and a lot of things are still missing.
35 klibc w zamierzeniu ma byæ minimalistycznym podzbiorem biblioteki libc
36 do u¿ycia z initramfs. Celem jest minimalizacja, przeno¶no¶æ ale nie
37 szybko¶æ. klibc jest rozwijan± bibliotek± w zwi±zku z czym nadal
41 Summary: Development files for klibc
42 Summary(pl): Pliki dla programistów klibc
43 Group: Development/Libraries
44 Requires: %{name} = %{version}-%{release}
46 %{?with_dist_kernel:Requires: kernel-headers >= 2.4}
49 Small libc for building embedded applications - development files.
51 %description devel -l pl
52 Ma³a libc do budowania aplikacji wbudowanych - pliki dla programistów.
55 Summary: Static klibc libraries
56 Summary(pl): Biblioteki statyczne klibc
57 Group: Development/Libraries
58 Requires: %{name}-devel = %{version}-%{release}
61 Static klibc libraries.
63 %description static -l pl
64 Biblioteki statyczne klibc.
67 Summary: Utilities dynamically linked with klibc
68 Summary(pl): Narzêdzia dynamicznie zlinkowane z klibc
70 Requires: %{name} = %{version}-%{release}
72 %description utils-shared
73 Utilities dynamically linked with klibc.
75 %description utils-shared -l pl
76 Narzêdzia dynamicznie zlinkowane z klibc.
79 Summary: Utilities statically linked with klibc
80 Summary(pl): Narzêdzia statycznie zlinkowane z klibc
83 %description utils-static
84 Utilities staticly linked with klibc.
86 %description utils-static -l pl
87 Narzêdzia statycznie zlinkowane z klibc.
96 rm -rf include/{asm,asm-generic,linux}
98 if [ -d %{_kernelsrcdir}/include/asm-powerpc ]; then
99 install -d include/asm
100 cp -a %{_kernelsrcdir}/include/asm-ppc/* include/asm/
101 cp -a %{_kernelsrcdir}/include/asm-powerpc/* include/asm/
103 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
106 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
109 ln -sf %{_kernelsrcdir}/include/asm-generic .
110 ln -sf %{_kernelsrcdir}/include/linux .
111 %if %{with dist_kernel}
112 [ ! -d arch/%{_target_base_arch}/linux ] && mkdir arch/%{_target_base_arch}/linux
113 ln -sf %{_kernelsrcdir}/include/linux/autoconf-up.h arch/%{_target_base_arch}/linux/autoconf.h
115 for a in `ls arch`; do [ "$a" != "%{_target_base_arch}" ] && rm -rf arch/$a; done
119 # hack; missing dependency in make system
120 ( cd klibc && %{__make} -f arch/sparc/Makefile.inc ARCH=sparc \
121 arch/sparc/sdiv.S arch/sparc/udiv.S arch/sparc/srem.S arch/sparc/urem.S )
125 ARCH=%{_target_base_arch} \
127 rpm_prefix=%{_prefix} \
128 rpm_bindir=%{_bindir} \
129 rpm_includedir=%{_includedir}/klibc \
130 rpm_libdir=%{_libdir} \
132 OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \
133 -falign-jumps=0 -falign-loops=0 -ffreestanding"
136 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT/%{_lib}
138 install -d $RPM_BUILD_ROOT%{_includedir}/klibc
139 install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static}
141 cp -a include/* $RPM_BUILD_ROOT%{_includedir}/klibc
142 install klcc/klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc
143 install klcc/klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1
144 install klibc/libc.* klibc/arch/%{_target_base_arch}/crt0.o klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc
145 install klibc/klibc.so $RPM_BUILD_ROOT/%{_lib}
146 install dash/sh.shared $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh
147 install dash/sh.shared.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh.g
148 install dash/sh $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh
149 install dash/sh.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh.g
150 install usr/kinit/*/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared
151 install usr/kinit/*/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static
152 install utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared
153 install utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static
156 rm -rf $RPM_BUILD_ROOT
159 %defattr(644,root,root,755)
160 %attr(755,root,root) /%{_lib}/klibc.so
163 %defattr(644,root,root,755)
164 %attr(755,root,root) %{_bindir}/klcc
166 %dir %{_libdir}/klibc
167 %attr(755,root,root) %{_libdir}/klibc/*.so
172 %defattr(644,root,root,755)
176 %defattr(644,root,root,755)
177 %dir %{_libdir}/klibc/bin-shared
178 %attr(755,root,root) %{_libdir}/klibc/bin-shared/*
181 %defattr(644,root,root,755)
182 %dir %{_libdir}/klibc/bin-static
183 %attr(755,root,root) %{_libdir}/klibc/bin-static/*