4 Summary: A minimal libc subset for use with initramfs.
9 Group: Development/Libraries
10 URL: http://www.zytor.com/klibc
12 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
13 Packager: Bryan O'Sullivan <bos@serpentine.com>
15 Vendor: Starving Linux Artists
18 %{name} is intended to be a minimalistic libc subset for use with
19 initramfs. It is deliberately written for small size, minimal
20 entanglement, and portability, not speed. It is definitely a work in
21 progress, and a lot of things are still missing.
24 Summary: Kernel headers used during the build of klibc.
25 Group: Development/Libraries
27 %description kernheaders
28 This package contains the set of kernel headers that were required to
29 build %{name} and the utilities that ship with it. This may or may
30 not be a complete enough set to build other programs that link against
31 %{name}. If in doubt, use real kernel headers instead.
34 Summary: Small statically-linked utilities built with klibc.
35 Group: Utilities/System
39 This package contains a collection of programs that are statically
40 linked against klibc. These duplicate some of the functionality of a
41 regular Linux toolset, but are typically much smaller than their
42 full-function counterparts. They are intended for inclusion in
43 initramfs images and embedded systems.
46 if [ ! -L linux ]; then
47 echo "*** You must have a symlink named linux to build klibc" 1>&2
50 if [ ! -f linux/include/asm/page.h ]; then
51 echo "*** You need to 'make prepare' in the linux tree before building klibc" 1>&2
54 mkdir -p %{buildroot} %{_rpmdir}
62 dest=%{buildroot}/%{prefix}
63 lib=$dest/%{_lib}/klibc
64 inc=$dest/include/klibc
65 exe=$dest/libexec/klibc
66 doc=$dest/share/doc/%{name}-%{version}
67 udoc=$dest/share/doc/%{name}-utils-%{version}
71 install -dD -m 755 $lib $inc/kernel $exe $doc $udoc
72 install -m 755 klibc/klibc.so $lib
73 install -m 644 klibc/libc.a $lib
74 install -m 644 klibc/crt0.o $lib
75 install -m 644 klibc/libc.so.hash $lib
76 ln $lib/klibc.so $lib/libc.so
77 ln $lib/klibc.so $lib/klibc-$(cat $lib/libc.so.hash).so
79 # Next, the generated binaries.
81 install -m 755 ash/sh $exe
82 install -m 755 gzip/gzip $exe
83 ln $exe/gzip $exe/gunzip
84 ln $exe/gzip $exe/zcat
85 install -m 755 ipconfig/ipconfig $exe
86 install -m 755 kinit/kinit $exe
87 install -m 755 nfsmount/nfsmount $exe
88 for i in chroot dd fstype mkdir mkfifo mount umount; do
89 install -m 755 utils/$i $exe
94 install -m 444 README $doc
95 install -m 444 klibc/README $doc/README.klibc
96 install -m 444 klibc/arch/README $doc/README.klibc.arch
98 install -m 444 gzip/COPYING $udoc/COPYING.gzip
99 install -m 444 gzip/README $udoc/README.gzip
100 install -m 444 ipconfig/README $udoc/README.ipconfig
101 install -m 444 kinit/README $udoc/README.kinit
103 # Finally, the include files.
105 bitsize=$(make --no-print-directory -C klibc bitsize)
106 cp --parents $(find klibc/include \( -name CVS -o -name SCCS \) -prune \
107 -o -name '*.h' -print) $inc
108 mv $inc/klibc $inc/klibc.$$
109 mv $inc/klibc.$$/include/* $inc
110 mv $inc/bits$bitsize/bitsize $inc
111 rm -rf $inc/klibc.$$ $inc/bits[0-9]*
112 pushd klibc/arch/%{_arch}/include
113 cp --parents -f $(find . \( -name CVS -o -name SCCS \) -prune \
114 -o -name '*.h' -print) $inc
117 # Yeugh. Find the transitive closure over all kernel headers included
118 # by klibc, and copy them into place.
120 find . -name '.*.d' | xargs -r sed -e 's,[ \t][ \t]*,\n,g' | sed -n -e 's,^\.\./linux/include/,,p' | sort | uniq | (cd linux/include && xargs -ri cp --parents '{}' $inc/kernel)
123 rm -rf $RPM_BUILD_ROOT
126 %defattr(-,root,root,-)
127 %docdir %{prefix}/share/doc/%{name}-%{version}
128 %{prefix}/%{_lib}/klibc
129 %dir %{prefix}/include/klibc
130 %{prefix}/include/klibc/*.h
131 %{prefix}/include/klibc/arpa
132 %{prefix}/include/klibc/bitsize
133 %{prefix}/include/klibc/klibc
134 %{prefix}/include/klibc/net
135 %{prefix}/include/klibc/netinet
136 %{prefix}/include/klibc/sys
137 %{prefix}/share/doc/%{name}-%{version}
140 %defattr(-,root,root,-)
141 %{prefix}/include/klibc/kernel
144 %defattr(-,root,root,-)
145 %{prefix}/libexec/klibc
146 %docdir %{prefix}/share/doc/%{name}-utils-%{version}
147 %{prefix}/share/doc/%{name}-utils-%{version}
150 * Sat Nov 29 2003 Bryan O'Sullivan <bos@serpentine.com> -