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: 9fcc435fff2e3611365727336633fcdf
14 #Source0: http://www.kernel.org/pub/linux/libs/klibc/%{name}-%{version}.tar.bz2
15 Patch0: %{name}-klcc.patch
16 Patch1: %{name}-kill_interp_sohash.patch
17 URL: http://www.zytor.com/mailman/listinfo/klibc/
18 %{?with_dist_kernel:BuildRequires: kernel-headers >= 2.4}
21 BuildRequires: rpmbuild(macros) >= 1.153
22 BuildRequires: perl-base
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 %define no_install_post_strip 1
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.
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
40 Summary: Development files for klibc
41 Summary(pl): Pliki dla programistów klibc
42 Group: Development/Libraries
43 Requires: %{name} = %{version}-%{release}
45 %{?with_dist_kernel:Requires: kernel-headers >= 2.4}
48 Small libc for building embedded applications - development files.
50 %description devel -l pl
51 Ma³a libc do budowania aplikacji wbudowanych - pliki dla programistów.
54 Summary: Static klibc libraries
55 Summary(pl): Biblioteki statyczne klibc
56 Group: Development/Libraries
57 Requires: %{name}-devel = %{version}-%{release}
60 Static klibc libraries.
62 %description static -l pl
63 Biblioteki statyczne klibc.
66 Summary: Utilities dynamically linked with klibc
67 Summary(pl): Narzêdzia dynamicznie zlinkowane z klibc
69 Requires: %{name} = %{version}-%{release}
71 %description utils-shared
72 Utilities dynamically linked with klibc.
74 %description utils-shared -l pl
75 Narzêdzia dynamicznie zlinkowane z klibc.
78 Summary: Utilities statically linked with klibc
79 Summary(pl): Narzêdzia statycznie zlinkowane z klibc
82 %description utils-static
83 Utilities staticly linked with klibc.
85 %description utils-static -l pl
86 Narzêdzia statycznie zlinkowane z klibc.
94 ln -s %{_kernelsrcdir} linux
95 rm -rf usr/include/{asm,asm-generic,linux}
97 if [ -d %{_kernelsrcdir}/include/asm-powerpc ]; then
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/
102 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} usr/include/asm
105 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} usr/include/asm
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
114 for a in `ls arch`; do [ "$a" != "%{_target_base_arch}" ] && rm -rf arch/$a; done
118 # hack; missing dependency in make system
119 ( cd usr/klibc && %{__make} -f arch/sparc/Makefile.inc ARCH=sparc \
120 arch/sparc/sdiv.S arch/sparc/udiv.S arch/sparc/srem.S arch/sparc/urem.S )
124 ARCH=%{_target_base_arch} \
126 rpm_prefix=%{_prefix} \
127 rpm_bindir=%{_bindir} \
128 rpm_includedir=%{_includedir}/klibc \
129 rpm_libdir=%{_libdir} \
131 OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \
132 -falign-jumps=0 -falign-loops=0 -ffreestanding"
135 rm -rf $RPM_BUILD_ROOT
136 install -d $RPM_BUILD_ROOT/%{_lib}
137 install -d $RPM_BUILD_ROOT%{_includedir}/klibc
138 install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static}
140 cp -a usr/include/* $RPM_BUILD_ROOT%{_includedir}/klibc
141 install klcc/klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc
142 install klcc/klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1
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
149 install usr/kinit/*/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared
150 install usr/kinit/*/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static
151 install usr/utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared
152 install usr/utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static
155 rm -rf $RPM_BUILD_ROOT
158 %defattr(644,root,root,755)
159 %attr(755,root,root) /%{_lib}/klibc.so
162 %defattr(644,root,root,755)
163 %attr(755,root,root) %{_bindir}/klcc
165 %dir %{_libdir}/klibc
166 %attr(755,root,root) %{_libdir}/klibc/*.so
171 %defattr(644,root,root,755)
175 %defattr(644,root,root,755)
176 %dir %{_libdir}/klibc/bin-shared
177 %attr(755,root,root) %{_libdir}/klibc/bin-shared/*
180 %defattr(644,root,root,755)
181 %dir %{_libdir}/klibc/bin-static
182 %attr(755,root,root) %{_libdir}/klibc/bin-static/*