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-md5: 80b85e84306695ed61049720008dd409
14 Patch0: %{name}-klcc.patch
15 Patch1: %{name}-kill_interp_sohash.patch
16 URL: http://www.zytor.com/mailman/listinfo/klibc/
17 %{?with_dist_kernel:BuildRequires: kernel-headers >= 2.4}
20 BuildRequires: rpmbuild(macros) >= 1.153
21 BuildRequires: perl-base
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 %define no_install_post_strip 1
27 klibc, what is intended to be a minimalistic libc subset for use with
28 initramfs. It is deliberately written for small size, minimal
29 entaglement and portability, not speed. It is definitely a work in
30 progress, and a lot of things are still missing.
33 klibc w zamierzeniu ma byæ minimalistycznym podzbiorem biblioteki libc
34 do u¿ycia z initramfs. Celem jest minimalizacja, przeno¶no¶æ ale nie
35 szybko¶æ. klibc jest rozwijan± bibliotek± w zwi±zku z czym nadal
39 Summary: Development files for klibc
40 Summary(pl): Pliki dla programistów klibc
41 Group: Development/Libraries
42 Requires: %{name} = %{version}-%{release}
44 %{?with_dist_kernel:Requires: kernel-headers >= 2.4}
47 Small libc for building embedded applications - development files.
49 %description devel -l pl
50 Ma³a libc do budowania aplikacji wbudowanych - pliki dla programistów.
53 Summary: Static klibc libraries
54 Summary(pl): Biblioteki statyczne klibc
55 Group: Development/Libraries
56 Requires: %{name}-devel = %{version}-%{release}
59 Static klibc libraries.
61 %description static -l pl
62 Biblioteki statyczne klibc.
65 Summary: Utilities dynamically linked with klibc
66 Summary(pl): Narzêdzia dynamicznie zlinkowane z klibc
68 Requires: %{name} = %{version}-%{release}
70 %description utils-shared
71 Utilities dynamically linked with klibc.
73 %description utils-shared -l pl
74 Narzêdzia dynamicznie zlinkowane z klibc.
77 Summary: Utilities statically linked with klibc
78 Summary(pl): Narzêdzia statycznie zlinkowane z klibc
81 %description utils-static
82 Utilities staticly linked with klibc.
84 %description utils-static -l pl
85 Narzêdzia statycznie zlinkowane z klibc.
93 rm -rf include/{asm,asm-generic,linux}
95 if [ -d %{_kernelsrcdir}/include/asm-powerpc ]; then
96 install -d include/asm
97 cp -a %{_kernelsrcdir}/include/asm-ppc/* include/asm/
98 cp -a %{_kernelsrcdir}/include/asm-powerpc/* include/asm/
100 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
103 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
106 ln -sf %{_kernelsrcdir}/include/asm-generic .
107 ln -sf %{_kernelsrcdir}/include/linux .
108 %if %{with dist_kernel}
109 [ ! -d arch/%{_target_base_arch}/linux ] && mkdir arch/%{_target_base_arch}/linux
110 ln -sf %{_kernelsrcdir}/include/linux/autoconf-up.h arch/%{_target_base_arch}/linux/autoconf.h
112 for a in `ls arch`; do [ "$a" != "%{_target_base_arch}" ] && rm -rf arch/$a; done
116 # hack; missing dependency in make system
117 ( cd klibc && %{__make} -f arch/sparc/Makefile.inc ARCH=sparc \
118 arch/sparc/sdiv.S arch/sparc/udiv.S arch/sparc/srem.S arch/sparc/urem.S )
122 ARCH=%{_target_base_arch} \
124 rpm_prefix=%{_prefix} \
125 rpm_bindir=%{_bindir} \
126 rpm_includedir=%{_includedir}/klibc \
127 rpm_libdir=%{_libdir} \
129 OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \
130 -falign-jumps=0 -falign-loops=0 -ffreestanding"
133 rm -rf $RPM_BUILD_ROOT
134 install -d $RPM_BUILD_ROOT/%{_lib}
135 install -d $RPM_BUILD_ROOT%{_includedir}/klibc
136 install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static}
138 cp -a include/* $RPM_BUILD_ROOT%{_includedir}/klibc
139 install klcc/klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc
140 install klcc/klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1
141 install klibc/libc.* klibc/arch/%{_target_base_arch}/crt0.o klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc
142 install klibc/klibc.so $RPM_BUILD_ROOT/%{_lib}
143 install dash/sh.shared $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh
144 install dash/sh $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh
145 install utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared
146 install utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static
149 rm -rf $RPM_BUILD_ROOT
152 %defattr(644,root,root,755)
153 %attr(755,root,root) /%{_lib}/klibc.so
156 %defattr(644,root,root,755)
157 %attr(755,root,root) %{_bindir}/klcc
159 %dir %{_libdir}/klibc
160 %attr(755,root,root) %{_libdir}/klibc/*.so
165 %defattr(644,root,root,755)
169 %defattr(644,root,root,755)
170 %dir %{_libdir}/klibc/bin-shared
171 %attr(755,root,root) %{_libdir}/klibc/bin-shared/*
174 %defattr(644,root,root,755)
175 %dir %{_libdir}/klibc/bin-static
176 %attr(755,root,root) %{_libdir}/klibc/bin-static/*