chiark / gitweb /
volume_id: provide libvolume_id.a file
[elogind.git] / klibc / klibc.spec.in
1 Summary: A minimal libc subset for use with initramfs.
2 Name: klibc
3 Version: @@VERSION@@
4 Release: 1
5 License: BSD/GPL
6 Group: Development/Libraries
7 URL: http://www.zytor.com/mailman/listinfo/klibc
8 Source: http://www.kernel.org/pub/linux/libs/klibc-%{version}.tar.gz
9 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
10 BuildRequires: kernel >= 2.6.0, kernel-devel
11 Packager: H. Peter Anvin <hpa@zytor.com>
12 Prefix: /usr
13 Vendor: Starving Linux Artists
14
15 %define klibcdir  %{_prefix}/lib/klibc
16 %define libdocdir %{_docdir}/%{name}-%{version}-%{release}
17 %define bindocdir %{_docdir}/%{name}-utils-%{version}-%{release}
18
19 %description
20 %{name} is intended to be a minimalistic libc subset for use with
21 initramfs.  It is deliberately written for small size, minimal
22 entanglement, and portability, not speed.
23
24 %package devel
25 Summary: Libraries and tools needed to compile applications against klibc.
26 Group: Development/Libraries
27 Requires: klibc = %{version}-%{release}
28
29 %description devel
30 This package contains the link libraries, header files, and gcc
31 wrapper scripts needed to compile applications against klibc.
32
33 %package utils
34 Summary: Small utilities built with klibc.
35 Group: Utilities/System
36 Requires: klibc = %{version}-%{release}
37
38 %description utils
39 This package contains a collection of programs that are linked against
40 klibc.  These duplicate some of the functionality of a regular Linux
41 toolset, but are typically much smaller than their full-function
42 counterparts.  They are intended for inclusion in initramfs images and
43 embedded systems.
44
45 %prep
46 %setup -q
47 cp -dRs /lib/modules/`uname -r`/build/ ./linux
48 # Shouldn't need this when getting the build tree from /lib/modules
49 # make -C linux defconfig ARCH=%{_target_cpu}
50 # make -C linux prepare ARCH=%{_target_cpu}
51 # Deal with braindamage in RedHat's kernel-source RPM
52 rm -f linux/include/linux/config.h
53 cat <<EOF > linux/include/linux/config.h
54 #ifndef _LINUX_CONFIG_H
55 #define _LINUX_CONFIG_H
56
57 #include <linux/autoconf.h>
58
59 #endif
60 EOF
61 mkdir -p %{buildroot}
62
63 %build
64 make  ARCH=%{_target_cpu} prefix=%{_prefix} bindir=%{_bindir} \
65         INSTALLDIR=%{klibcdir} mandir=%{_mandir} INSTALLROOT=%{buildroot}
66
67 %install
68 rm -rf %{buildroot}
69 make  ARCH=%{_target_cpu} prefix=%{_prefix} bindir=%{_bindir} \
70         INSTALLDIR=%{klibcdir} mandir=%{_mandir} INSTALLROOT=%{buildroot} \
71         install
72
73 # Make the .so file in /lib a hardlink (they will be expanded as two
74 # files automatically if it crosses filesystems when extracted.)
75 ln -f %{buildroot}%{klibcdir}/lib/klibc-*.so %{buildroot}/lib
76
77 # Install the docs
78 mkdir -p %{buildroot}%{bindocdir} %{buildroot}%{libdocdir}
79 install -m 444 README %{buildroot}%{libdocdir}
80 install -m 444 klibc/README %{buildroot}%{libdocdir}/README.klibc
81 install -m 444 klibc/arch/README %{buildroot}%{libdocdir}/README.klibc.arch
82
83 install -m 444 gzip/COPYING %{buildroot}%{bindocdir}/COPYING.gzip
84 install -m 444 gzip/README %{buildroot}%{bindocdir}/README.gzip
85 install -m 444 ipconfig/README %{buildroot}%{bindocdir}/README.ipconfig
86 install -m 444 kinit/README %{buildroot}%{bindocdir}/README.kinit
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 #
92 # Note: libc.so and interp.o are technically -devel files, but
93 # put them in this package until we can make really, really sure
94 # the dependency system can avoid confusion.  (In fact, it would be
95 # good to eventually get them out of here, so that multiple runtimes
96 # can be installed should it be necessary.)
97 #
98 %files
99 %defattr(-,root,root,-)
100 /lib/klibc-*.so
101 %{klibcdir}/lib/*.so
102 %{klibcdir}/lib/interp.o
103
104 %files devel
105 %defattr(-,root,root,-)
106 %{klibcdir}/include
107 %{klibcdir}/lib/*.a
108 %{klibcdir}/lib/crt0.o
109 %{_bindir}/klcc
110 %doc %{_mandir}/man1/*
111 %doc %{libdocdir}/*
112
113 %files utils
114 %defattr(-,root,root,-)
115 %{klibcdir}/bin
116 %doc %{bindocdir}/*
117
118 %changelog
119 * Tue Mar 1 2005 H. Peter Anvin <hpa@zytor.com>
120 - New "make install" scheme, klcc
121
122 * Tue Jul 6 2004 H. Peter Anvin <hpa@zytor.com>
123 - Update to use kernel-source RPM for the kernel symlink.
124
125 * Sat Nov 29 2003 Bryan O'Sullivan <bos@serpentine.com> - 
126 - Initial build.