3 # - fix klibc loader crash:
4 # http://www.zytor.com/pipermail/klibc/2005-September/001150.html
7 %bcond_without dist_kernel # build without distribution kernel-headers
9 Summary: Minimalistic libc subset for use with initramfs
10 Summary(pl): Zminimalizowany podzbiór biblioteki C do u¿ywania z initramfs
16 Source0: http://www.kernel.org/pub/linux/libs/klibc/Testing/%{name}-%{version}.tar.bz2
17 # Source0-md5: baa1f6e0b6acbf9576bb28cca5c32c89
18 Patch0: %{name}-ksh-quotation.patch
19 Patch1: %{name}-klcc.patch
20 Patch2: %{name}-fstype_jfs.patch
21 URL: http://www.zytor.com/mailman/listinfo/klibc/
22 %{?with_dist_kernel:BuildRequires: kernel-headers >= 2.4}
23 BuildRequires: rpmbuild(macros) >= 1.153
24 BuildRequires: perl-base
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define no_install_post_strip 1
30 klibc, what is intended to be a minimalistic libc subset for use with
31 initramfs. It is deliberately written for small size, minimal
32 entaglement and portability, not speed. It is definitely a work in
33 progress, and a lot of things are still missing.
36 klibc w zamierzeniu ma byæ minimalistycznym podzbiorem biblioteki libc
37 do u¿ycia z initramfs. Celem jest minimalizacja, przeno¶no¶æ ale nie
38 szybko¶æ. klibc jest rozwijan± bibliotek± w zwi±zku z czym nadal
42 Summary: Development files for klibc
43 Summary(pl): Pliki dla programistów klibc
44 Group: Development/Libraries
45 Requires: %{name} = %{epoch}:%{version}-%{release}
47 %{?with_dist_kernel:Requires: kernel-headers >= 2.4}
50 Small libc for building embedded applications - development files.
52 %description devel -l pl
53 Ma³a libc do budowania aplikacji wbudowanych - pliki dla programistów.
56 Summary: Static klibc libraries
57 Summary(pl): Biblioteki statyczne klibc
58 Group: Development/Libraries
59 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
62 Static klibc libraries.
64 %description static -l pl
65 Biblioteki statyczne klibc.
68 Summary: Utilities dynamically linked with klibc
69 Summary(pl): Narzêdzia dynamicznie zlinkowane z klibc
71 Requires: %{name} = %{version}-%{release}
73 %description utils-shared
74 Utilities dynamically linked with klibc.
76 %description utils-shared -l pl
77 Narzêdzia dynamicznie zlinkowane z klibc.
80 Summary: Utilities statically linked with klibc
81 Summary(pl): Narzêdzia statycznie zlinkowane z klibc
84 %description utils-static
85 Utilities staticly linked with klibc.
87 %description utils-static -l pl
88 Narzêdzia statycznie zlinkowane z klibc.
98 rm -rf asm asm-generic linux
99 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} .
100 ln -sf asm-%{_target_base_arch} asm
101 ln -sf %{_kernelsrcdir}/include/asm-generic .
102 ln -sf %{_kernelsrcdir}/include/linux .
103 %if %{with dist_kernel}
104 [ ! -d arch/%{_target_base_arch}/linux ] && mkdir arch/%{_target_base_arch}/linux
105 ln -sf %{_kernelsrcdir}/include/linux/autoconf-up.h arch/%{_target_base_arch}/linux/autoconf.h
107 for a in `ls arch`; do [ "$a" != "%{_target_base_arch}" ] && rm -rf arch/$a; done
111 ARCH=%{_target_base_arch} \
115 includedir=%{_includedir}/klibc \
117 OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \
118 -falign-jumps=0 -falign-loops=0 -ffreestanding"
121 rm -rf $RPM_BUILD_ROOT
122 install -d $RPM_BUILD_ROOT/%{_lib}
123 install -d $RPM_BUILD_ROOT%{_includedir}/klibc
124 install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static}
126 cp -a include/* $RPM_BUILD_ROOT%{_includedir}/klibc
127 install klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc
128 install klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1
129 install klibc/libc.* klibc/crt0.o klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc
130 install klibc/klibc-*.so $RPM_BUILD_ROOT/%{_lib}
131 install utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared
132 install utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static
135 rm -rf $RPM_BUILD_ROOT
138 %defattr(644,root,root,755)
139 %attr(755,root,root) /%{_lib}/klibc*.so
142 %defattr(644,root,root,755)
143 %attr(755,root,root) %{_bindir}/klcc
145 %dir %{_libdir}/klibc
146 %attr(755,root,root) %{_libdir}/klibc/*.so
151 %defattr(644,root,root,755)
155 %defattr(644,root,root,755)
156 %dir %{_libdir}/klibc/bin-shared
157 %attr(755,root,root) %{_libdir}/klibc/bin-shared/*
160 %defattr(644,root,root,755)
161 %dir %{_libdir}/klibc/bin-static
162 %attr(755,root,root) %{_libdir}/klibc/bin-static/*