]> git.ipfire.org Git - thirdparty/systemd.git/blame - klibc/klibc.spec.in
[PATCH] start up udevd ourselves in the init script to give it some good priorities.
[thirdparty/systemd.git] / klibc / klibc.spec.in
CommitLineData
da92f46b
GKH
1%define _rpmdir rpms
2%define _builddir .
3
4Summary: A minimal libc subset for use with initramfs.
5Name: klibc
6Version: 0.89
7Release: 1
8License: BSD/GPL
9Group: Development/Libraries
10URL: http://www.zytor.com/klibc
11Source: /dev/null
12BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
13Packager: Bryan O'Sullivan <bos@serpentine.com>
14Prefix: /usr
15Vendor: Starving Linux Artists
16
17%description
18%{name} is intended to be a minimalistic libc subset for use with
19initramfs. It is deliberately written for small size, minimal
20entanglement, and portability, not speed. It is definitely a work in
21progress, and a lot of things are still missing.
22
23%package kernheaders
24Summary: Kernel headers used during the build of klibc.
25Group: Development/Libraries
26
27%description kernheaders
28This package contains the set of kernel headers that were required to
29build %{name} and the utilities that ship with it. This may or may
30not be a complete enough set to build other programs that link against
31%{name}. If in doubt, use real kernel headers instead.
32
33%package utils
34Summary: Small statically-linked utilities built with klibc.
35Group: Utilities/System
36
37%description utils
38
39This package contains a collection of programs that are statically
40linked against klibc. These duplicate some of the functionality of a
41regular Linux toolset, but are typically much smaller than their
42full-function counterparts. They are intended for inclusion in
43initramfs images and embedded systems.
44
45%prep
46if [ ! -L linux ]; then
47 echo "*** You must have a symlink named linux to build klibc" 1>&2
48 exit 1
49fi
50if [ ! -f linux/include/asm/page.h ]; then
51 echo "*** You need to 'make prepare' in the linux tree before building klibc" 1>&2
52 exit 1
53fi
54mkdir -p %{buildroot} %{_rpmdir}
55
56%build
57make
58
59%install
60rm -rf %{buildroot}
61
62dest=%{buildroot}/%{prefix}
63lib=$dest/%{_lib}/klibc
64inc=$dest/include/klibc
65exe=$dest/libexec/klibc
66doc=$dest/share/doc/%{name}-%{version}
67udoc=$dest/share/doc/%{name}-utils-%{version}
68
69# First, the library.
70
71install -dD -m 755 $lib $inc/kernel $exe $doc $udoc
72install -m 755 klibc/klibc.so $lib
73install -m 644 klibc/libc.a $lib
74install -m 644 klibc/crt0.o $lib
75install -m 644 klibc/libc.so.hash $lib
76ln $lib/klibc.so $lib/libc.so
77ln $lib/klibc.so $lib/klibc-$(cat $lib/libc.so.hash).so
78
79# Next, the generated binaries.
80
81install -m 755 ash/sh $exe
82install -m 755 gzip/gzip $exe
83ln $exe/gzip $exe/gunzip
84ln $exe/gzip $exe/zcat
85install -m 755 ipconfig/ipconfig $exe
86install -m 755 kinit/kinit $exe
87install -m 755 nfsmount/nfsmount $exe
88for i in chroot dd fstype mkdir mkfifo mount umount; do
89 install -m 755 utils/$i $exe
90done
91
92# The docs.
93
94install -m 444 README $doc
95install -m 444 klibc/README $doc/README.klibc
96install -m 444 klibc/arch/README $doc/README.klibc.arch
97
98install -m 444 gzip/COPYING $udoc/COPYING.gzip
99install -m 444 gzip/README $udoc/README.gzip
100install -m 444 ipconfig/README $udoc/README.ipconfig
101install -m 444 kinit/README $udoc/README.kinit
102
103# Finally, the include files.
104
105bitsize=$(make --no-print-directory -C klibc bitsize)
106cp --parents $(find klibc/include \( -name CVS -o -name SCCS \) -prune \
107 -o -name '*.h' -print) $inc
108mv $inc/klibc $inc/klibc.$$
109mv $inc/klibc.$$/include/* $inc
110mv $inc/bits$bitsize/bitsize $inc
111rm -rf $inc/klibc.$$ $inc/bits[0-9]*
112pushd klibc/arch/%{_arch}/include
113cp --parents -f $(find . \( -name CVS -o -name SCCS \) -prune \
114 -o -name '*.h' -print) $inc
115popd
116
117# Yeugh. Find the transitive closure over all kernel headers included
118# by klibc, and copy them into place.
119
120find . -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)
121
122%clean
123rm -rf $RPM_BUILD_ROOT
124
125%files
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}
138
139%files kernheaders
140%defattr(-,root,root,-)
141%{prefix}/include/klibc/kernel
142
143%files utils
144%defattr(-,root,root,-)
145%{prefix}/libexec/klibc
146%docdir %{prefix}/share/doc/%{name}-utils-%{version}
147%{prefix}/share/doc/%{name}-utils-%{version}
148
149%changelog
150* Sat Nov 29 2003 Bryan O'Sullivan <bos@serpentine.com> -
151- Initial build.