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: 882492395506ffb5f4cdbfca11eeb3d6
14 Patch0: %{name}-ksh-quotation.patch
15 Patch1: %{name}-klcc.patch
16 URL: http://www.zytor.com/mailman/listinfo/klibc/
17 %{?with_dist_kernel:BuildRequires: kernel-headers >= 2.4}
18 BuildRequires: rpmbuild(macros) >= 1.153
19 BuildRequires: perl-base
20 %{?with_dist_kernel:Requires: kernel-headers >= 2.4}
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 %define no_install_post_strip 1
26 klibc, what is intended to be a minimalistic libc subset for use with
27 initramfs. It is deliberately written for small size, minimal
28 entaglement and portability, not speed. It is definitely a work in
29 progress, and a lot of things are still missing.
32 klibc w zamierzeniu ma byæ minimalistycznym podzbiorem biblioteki libc
33 do u¿ycia z initramfs. Celem jest minimalizacja, przeno¶no¶æ ale nie
34 szybko¶æ. klibc jest rozwijan± bibliotek± w zwi±zku z czym nadal
38 Summary: Utilities dynamically linked with klibc
39 Summary(pl): Narzêdzia dynamicznie zlinkowane z klibc
41 Requires: %{name} = %{version}-%{release}
43 %description utils-shared
44 Utilities dynamically linked with klibc.
46 %description utils-shared -l pl
47 Narzêdzia dynamicznie zlinkowane z klibc.
50 Summary: Utilities statically linked with klibc
51 Summary(pl): Narzêdzia statycznie zlinkowane z klibc
54 %description utils-static
55 Utilities staticly linked with klibc.
57 %description utils-static -l pl
58 Narzêdzia statycznie zlinkowane z klibc.
66 rm -rf include/{asm,asm-generic,linux}
67 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
68 ln -sf %{_kernelsrcdir}/include/asm-generic include/asm-generic
69 cp -ar %{_kernelsrcdir}/include/linux include/linux
70 %{?with_dist_kernel:ln -sf %{_kernelsrcdir}/include/linux/autoconf-up.h include/linux/autoconf.h}
74 ARCH=%{_target_base_arch} \
75 CROSS=%{_target_base_arch}-pld-linux- \
80 includedir=%{_includedir}/klibc \
83 OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \
84 -falign-jumps=0 -falign-loops=0 -ffreestanding"
87 rm -rf $RPM_BUILD_ROOT
88 install -d $RPM_BUILD_ROOT%{_includedir}/klibc
89 install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static}
91 cp -a include/* $RPM_BUILD_ROOT%{_includedir}/klibc
92 install klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc
93 install klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1
94 install klibc/libc.* klibc/crt0.o klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc
95 install utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared
96 install utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static
99 rm -rf $RPM_BUILD_ROOT
102 %defattr(644,root,root,755)
103 %attr(755,root,root) %{_bindir}/klcc
105 %dir %{_libdir}/klibc
106 %attr(755,root,root) %{_libdir}/klibc/*.so
107 %{_libdir}/klibc/*.[ao]
111 %defattr(644,root,root,755)
112 %dir %{_libdir}/klibc/bin-shared
113 %attr(755,root,root) %{_libdir}/klibc/bin-shared/*
116 %defattr(644,root,root,755)
117 %dir %{_libdir}/klibc/bin-static
118 %attr(755,root,root) %{_libdir}/klibc/bin-static/*