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 Patch3: %{name}-ksh-syntax.patch
22 URL: http://www.zytor.com/mailman/listinfo/klibc/
23 %{?with_dist_kernel:BuildRequires: kernel-headers >= 2.4}
24 BuildRequires: rpmbuild(macros) >= 1.153
25 BuildRequires: perl-base
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 %define no_install_post_strip 1
31 klibc, what is intended to be a minimalistic libc subset for use with
32 initramfs. It is deliberately written for small size, minimal
33 entaglement and portability, not speed. It is definitely a work in
34 progress, and a lot of things are still missing.
37 klibc w zamierzeniu ma byæ minimalistycznym podzbiorem biblioteki libc
38 do u¿ycia z initramfs. Celem jest minimalizacja, przeno¶no¶æ ale nie
39 szybko¶æ. klibc jest rozwijan± bibliotek± w zwi±zku z czym nadal
43 Summary: Development files for klibc
44 Summary(pl): Pliki dla programistów klibc
45 Group: Development/Libraries
46 Requires: %{name} = %{epoch}:%{version}-%{release}
48 %{?with_dist_kernel:Requires: kernel-headers >= 2.4}
51 Small libc for building embedded applications - development files.
53 %description devel -l pl
54 Ma³a libc do budowania aplikacji wbudowanych - pliki dla programistów.
57 Summary: Static klibc libraries
58 Summary(pl): Biblioteki statyczne klibc
59 Group: Development/Libraries
60 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
63 Static klibc libraries.
65 %description static -l pl
66 Biblioteki statyczne klibc.
69 Summary: Utilities dynamically linked with klibc
70 Summary(pl): Narzêdzia dynamicznie zlinkowane z klibc
72 Requires: %{name} = %{version}-%{release}
74 %description utils-shared
75 Utilities dynamically linked with klibc.
77 %description utils-shared -l pl
78 Narzêdzia dynamicznie zlinkowane z klibc.
81 Summary: Utilities statically linked with klibc
82 Summary(pl): Narzêdzia statycznie zlinkowane z klibc
85 %description utils-static
86 Utilities staticly linked with klibc.
88 %description utils-static -l pl
89 Narzêdzia statycznie zlinkowane z klibc.
100 rm -rf asm asm-generic linux
101 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} .
102 ln -sf asm-%{_target_base_arch} asm
103 ln -sf %{_kernelsrcdir}/include/asm-generic .
104 ln -sf %{_kernelsrcdir}/include/linux .
105 %if %{with dist_kernel}
106 [ ! -d arch/%{_target_base_arch}/linux ] && mkdir arch/%{_target_base_arch}/linux
107 ln -sf %{_kernelsrcdir}/include/linux/autoconf-up.h arch/%{_target_base_arch}/linux/autoconf.h
109 for a in `ls arch`; do [ "$a" != "%{_target_base_arch}" ] && rm -rf arch/$a; done
113 ARCH=%{_target_base_arch} \
117 includedir=%{_includedir}/klibc \
120 OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \
121 -falign-jumps=0 -falign-loops=0 -ffreestanding"
124 rm -rf $RPM_BUILD_ROOT
125 install -d $RPM_BUILD_ROOT/%{_lib}
126 install -d $RPM_BUILD_ROOT%{_includedir}/klibc
127 install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static}
129 cp -a include/* $RPM_BUILD_ROOT%{_includedir}/klibc
130 install klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc
131 install klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1
132 install klibc/libc.* klibc/crt0.o klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc
133 install klibc/klibc-*.so $RPM_BUILD_ROOT/%{_lib}
134 install utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared
135 install utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static
138 rm -rf $RPM_BUILD_ROOT
141 %defattr(644,root,root,755)
142 %attr(755,root,root) /%{_lib}/klibc*.so
145 %defattr(644,root,root,755)
146 %attr(755,root,root) %{_bindir}/klcc
148 %dir %{_libdir}/klibc
149 %attr(755,root,root) %{_libdir}/klibc/*.so
154 %defattr(644,root,root,755)
158 %defattr(644,root,root,755)
159 %dir %{_libdir}/klibc/bin-shared
160 %attr(755,root,root) %{_libdir}/klibc/bin-shared/*
163 %defattr(644,root,root,755)
164 %dir %{_libdir}/klibc/bin-static
165 %attr(755,root,root) %{_libdir}/klibc/bin-static/*