]> git.ipfire.org Git - thirdparty/systemd.git/blame - klibc/klibc.spec
[PATCH] fix unusual sysfs behavior for pcmcia_socket
[thirdparty/systemd.git] / klibc / klibc.spec
CommitLineData
a0622777
GKH
1Summary: A minimal libc subset for use with initramfs.
2Name: klibc
3Version: 0.181
4Release: 1
5License: BSD/GPL
6Group: Development/Libraries
7URL: http://www.zytor.com/mailman/listinfo/klibc
8Source: http://www.kernel.org/pub/linux/libs/klibc-%{version}.tar.gz
9BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
10BuildRequires: kernel-source >= 2.6.0
11Packager: H. Peter Anvin <hpa@zytor.com>
12Prefix: /usr
13Vendor: Starving Linux Artists
14
15%description
16%{name} is intended to be a minimalistic libc subset for use with
17initramfs. It is deliberately written for small size, minimal
18entanglement, and portability, not speed. It is definitely a work in
19progress, and a lot of things are still missing.
20
21%package kernheaders
22Summary: Kernel headers used during the build of klibc.
23Group: Development/Libraries
24
25%description kernheaders
26This package contains the set of kernel headers that were required to
27build %{name} and the utilities that ship with it. This may or may
28not be a complete enough set to build other programs that link against
29%{name}. If in doubt, use real kernel headers instead.
30
31%package utils
32Summary: Small statically-linked utilities built with klibc.
33Group: Utilities/System
34
35%description utils
36
37This package contains a collection of programs that are statically
38linked against klibc. These duplicate some of the functionality of a
39regular Linux toolset, but are typically much smaller than their
40full-function counterparts. They are intended for inclusion in
41initramfs images and embedded systems.
42
43%prep
44%setup -q
45cp -as /usr/src/linux-`rpm -q kernel-source | tail -1 | cut -d- -f3-` ./linux
46make -C linux defconfig ARCH=%{_target_cpu}
47make -C linux prepare ARCH=%{_target_cpu}
48# Deal with braindamage in RedHat's kernel-source RPM
49rm -f linux/include/linux/config.h
50cat <<EOF > linux/include/linux/config.h
51#ifndef _LINUX_CONFIG_H
52#define _LINUX_CONFIG_H
53
54#include <linux/autoconf.h>
55
56#endif
57EOF
58mkdir -p %{buildroot}
59
60%build
61make ARCH=%{_target_cpu}
62
63%install
64rm -rf %{buildroot}
65
66dest=%{buildroot}/%{prefix}
67lib=$dest/%{_lib}/klibc
68inc=$dest/include/klibc
69exe=$dest/libexec/klibc
70doc=$dest/share/doc/%{name}-%{version}
71udoc=$dest/share/doc/%{name}-utils-%{version}
72
73# First, the library.
74
75install -dD -m 755 $lib $inc/kernel $exe $doc $udoc
76install -m 755 klibc/klibc.so $lib
77install -m 644 klibc/libc.a $lib
78install -m 644 klibc/crt0.o $lib
79install -m 644 klibc/libc.so.hash $lib
80ln $lib/klibc.so $lib/libc.so
81ln $lib/klibc.so $lib/klibc-$(cat $lib/libc.so.hash).so
82
83# Next, the generated binaries.
84# These are currently static binaries, should we go for shared?
85
86install -m 755 ash/sh $exe
87install -m 755 gzip/gzip $exe
88ln $exe/gzip $exe/gunzip
89ln $exe/gzip $exe/zcat
90install -m 755 ipconfig/ipconfig $exe
91install -m 755 kinit/kinit $exe
92install -m 755 nfsmount/nfsmount $exe
93install -m 755 utils/static/* $exe
94
95# The docs.
96
97install -m 444 README $doc
98install -m 444 klibc/README $doc/README.klibc
99install -m 444 klibc/arch/README $doc/README.klibc.arch
100
101install -m 444 gzip/COPYING $udoc/COPYING.gzip
102install -m 444 gzip/README $udoc/README.gzip
103install -m 444 ipconfig/README $udoc/README.ipconfig
104install -m 444 kinit/README $udoc/README.kinit
105
106# Finally, the include files.
107
108bitsize=$(make --no-print-directory -C klibc bitsize ARCH=%{_target_cpu})
109cp --parents $(find klibc/include \( -name CVS -o -name SCCS \) -prune \
110 -o -name '*.h' -print) $inc
111mv $inc/klibc $inc/klibc.$$
112mv $inc/klibc.$$/include/* $inc
113mv $inc/bits$bitsize/bitsize $inc
114rm -rf $inc/klibc.$$ $inc/bits[0-9]*
115pushd klibc/arch/%{_arch}/include
116cp --parents -f $(find . \( -name CVS -o -name SCCS \) -prune \
117 -o -name '*.h' -print) $inc
118popd
119
120# Yeugh. Find the transitive closure over all kernel headers included
121# by klibc, and copy them into place.
122
123find . -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)
124
125%clean
126rm -rf $RPM_BUILD_ROOT
127
128%files
129%defattr(-,root,root,-)
130%docdir %{prefix}/share/doc/%{name}-%{version}
131%{prefix}/%{_lib}/klibc
132%dir %{prefix}/include/klibc
133%{prefix}/include/klibc/*.h
134%{prefix}/include/klibc/arpa
135%{prefix}/include/klibc/bitsize
136%{prefix}/include/klibc/klibc
137%{prefix}/include/klibc/net
138%{prefix}/include/klibc/netinet
139%{prefix}/include/klibc/sys
140%{prefix}/share/doc/%{name}-%{version}
141
142%files kernheaders
143%defattr(-,root,root,-)
144%{prefix}/include/klibc/kernel
145
146%files utils
147%defattr(-,root,root,-)
148%{prefix}/libexec/klibc
149%docdir %{prefix}/share/doc/%{name}-utils-%{version}
150%{prefix}/share/doc/%{name}-utils-%{version}
151
152%changelog
153* Tue Jul 6 2004 H. Peter Anvin <hpa@zytor.com>
154- Update to use kernel-source RPM for the kernel symlink.
155
156* Sat Nov 29 2003 Bryan O'Sullivan <bos@serpentine.com> -
157- Initial build.