]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # TODO: | |
3 | # - warning: Installed (but unpackaged) file(s) found: | |
4 | # /usr/lib/klibc/libc.so.hash | |
5 | # | |
6 | # Conditional build: | |
7 | %bcond_without dist_kernel # build without distribution kernel-headers | |
8 | %bcond_with verbose # verbose build | |
9 | # | |
10 | Summary: Minimalistic libc subset for use with initramfs | |
11 | Summary(pl.UTF-8): Zminimalizowany podzbiór biblioteki C do używania z initramfs | |
12 | Name: klibc | |
13 | Version: 1.5.23 | |
14 | Release: 1 | |
15 | License: BSD/GPL | |
16 | Group: Libraries | |
17 | Source0: http://www.kernel.org/pub/linux/libs/klibc/Current/%{name}-%{version}.tar.bz2 | |
18 | # Source0-md5: 38a0ac99c4facd14443f4495b29aeff1 | |
19 | Patch0: %{name}-klcc.patch | |
20 | Patch1: %{name}-make.patch | |
21 | URL: http://www.zytor.com/mailman/listinfo/klibc/ | |
22 | # ld.bfd binary | |
23 | BuildRequires: binutils >= 2.20.51.0.6 | |
24 | BuildRequires: bison | |
25 | BuildRequires: flex | |
26 | BuildRequires: linux-libc-headers >= 7:2.6.24-1 | |
27 | BuildRequires: perl-base | |
28 | BuildRequires: perl-modules | |
29 | BuildRequires: rpmbuild(macros) >= 1.153 | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %define no_install_post_strip 1 | |
33 | ||
34 | %description | |
35 | klibc, what is intended to be a minimalistic libc subset for use with | |
36 | initramfs. It is deliberately written for small size, minimal | |
37 | entaglement and portability, not speed. It is definitely a work in | |
38 | progress, and a lot of things are still missing. | |
39 | ||
40 | %description -l pl.UTF-8 | |
41 | klibc w zamierzeniu ma być minimalistycznym podzbiorem biblioteki libc | |
42 | do użycia z initramfs. Celem jest minimalizacja, przenośność ale nie | |
43 | szybkość. klibc jest rozwijaną biblioteką w związku z czym nadal | |
44 | brakuje wielu rzeczy. | |
45 | ||
46 | %package devel | |
47 | Summary: Development files for klibc | |
48 | Summary(pl.UTF-8): Pliki dla programistów klibc | |
49 | Group: Development/Libraries | |
50 | Requires: %{name} = %{version}-%{release} | |
51 | Requires: binutils | |
52 | Requires: linux-libc-headers >= 7:2.6.24-1 | |
53 | ||
54 | %description devel | |
55 | Small libc for building embedded applications - development files. | |
56 | ||
57 | %description devel -l pl.UTF-8 | |
58 | Mała libc do budowania aplikacji wbudowanych - pliki dla programistów. | |
59 | ||
60 | %package static | |
61 | Summary: Static klibc libraries | |
62 | Summary(pl.UTF-8): Biblioteki statyczne klibc | |
63 | Group: Development/Libraries | |
64 | Requires: %{name}-devel = %{version}-%{release} | |
65 | ||
66 | %description static | |
67 | Static klibc libraries. | |
68 | ||
69 | %description static -l pl.UTF-8 | |
70 | Biblioteki statyczne klibc. | |
71 | ||
72 | %package utils-shared | |
73 | Summary: Utilities dynamically linked with klibc | |
74 | Summary(pl.UTF-8): Narzędzia dynamicznie zlinkowane z klibc | |
75 | Group: Base | |
76 | Requires: %{name} = %{version}-%{release} | |
77 | ||
78 | %description utils-shared | |
79 | Utilities dynamically linked with klibc. | |
80 | ||
81 | %description utils-shared -l pl.UTF-8 | |
82 | Narzędzia dynamicznie zlinkowane z klibc. | |
83 | ||
84 | %package utils-shared-debug | |
85 | Summary: Utilities dynamically linked with klibc (unstripped) | |
86 | Summary(pl.UTF-8): Narzędzia dynamicznie zlinkowane z klibc (z informacjami dla debuggera) | |
87 | Group: Base | |
88 | Requires: %{name}-utils-shared = %{version}-%{release} | |
89 | ||
90 | %description utils-shared-debug | |
91 | Utilities dynamically linked with klibc. | |
92 | ||
93 | Programs in this package have debugging information not stripped. | |
94 | ||
95 | %description utils-shared-debug -l pl.UTF-8 | |
96 | Narzędzia dynamicznie zlinkowane z klibc. | |
97 | ||
98 | Programy zawarte w tym pakiecie zawierają informacje dla debuggera. | |
99 | ||
100 | %package utils-static | |
101 | Summary: Utilities statically linked with klibc | |
102 | Summary(pl.UTF-8): Narzędzia statycznie zlinkowane z klibc | |
103 | Group: Base | |
104 | ||
105 | %description utils-static | |
106 | Utilities staticly linked with klibc. | |
107 | ||
108 | %description utils-static -l pl.UTF-8 | |
109 | Narzędzia statycznie zlinkowane z klibc. | |
110 | ||
111 | %package utils-static-debug | |
112 | Summary: Utilities statically linked with klibc (unstripped) | |
113 | Summary(pl.UTF-8): Narzędzia statycznie zlinkowane z klibc (z informacjami dla debuggera) | |
114 | Group: Base | |
115 | Requires: %{name}-utils-static = %{version}-%{release} | |
116 | ||
117 | %description utils-static-debug | |
118 | Utilities staticly linked with klibc. | |
119 | ||
120 | Programs in this package have debugging information not stripped. | |
121 | ||
122 | %description utils-static-debug -l pl.UTF-8 | |
123 | Narzędzia statycznie zlinkowane z klibc. | |
124 | ||
125 | Programy zawarte w tym pakiecie zawierają informacje dla debuggera. | |
126 | ||
127 | %prep | |
128 | %setup -q | |
129 | %patch0 -p1 | |
130 | %patch1 -p1 | |
131 | ||
132 | %build | |
133 | cd usr/include | |
134 | ln -sf /usr/include/asm . | |
135 | ln -sf /usr/include/asm-generic . | |
136 | %ifarch sparc64 | |
137 | ln -sf /usr/include/asm-sparc . | |
138 | ln -sf /usr/include/asm-sparc64 . | |
139 | %endif | |
140 | ln -sf /usr/include/linux . | |
141 | # early-userspace needs acces to e.g. uvesafb.h. | |
142 | ln -sf /usr/include/video . | |
143 | ||
144 | cd ../.. | |
145 | install -d linux | |
146 | ln -sf ../usr/include linux/include | |
147 | ||
148 | %{__make} \ | |
149 | ARCH=%{_target_base_arch} \ | |
150 | HOSTCC="%{__cc}" \ | |
151 | CC="%{__cc}" \ | |
152 | LD="ld.bfd" \ | |
153 | rpm_prefix=%{_prefix} \ | |
154 | rpm_bindir=%{_bindir} \ | |
155 | rpm_includedir=%{_includedir}/klibc \ | |
156 | rpm_libdir=%{_libdir} \ | |
157 | SHLIBDIR=/%{_lib} \ | |
158 | %{?with_verbose:KBUILD_VERBOSE=1} \ | |
159 | OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \ | |
160 | -falign-jumps=0 -falign-loops=0 -ffreestanding" | |
161 | ||
162 | %install | |
163 | rm -rf $RPM_BUILD_ROOT | |
164 | install -d $RPM_BUILD_ROOT/%{_lib} | |
165 | install -d $RPM_BUILD_ROOT%{_includedir}/klibc | |
166 | install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static} | |
167 | ||
168 | cp -a usr/include/* $RPM_BUILD_ROOT%{_includedir}/klibc | |
169 | install klcc/klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc | |
170 | install klcc/klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1 | |
171 | install usr/klibc/libc.* usr/klibc/arch/%{_target_base_arch}/crt0.o usr/klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc | |
172 | install usr/klibc/klibc-*.so $RPM_BUILD_ROOT/%{_lib} | |
173 | install usr/dash/sh.shared $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh | |
174 | install usr/dash/sh.shared.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh.g | |
175 | install usr/dash/sh $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh | |
176 | install usr/dash/sh.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh.g | |
177 | install usr/kinit/*/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared | |
178 | install usr/kinit/*/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
179 | install usr/utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared | |
180 | install usr/utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
181 | ||
182 | ln -s %{_libdir}/klibc/bin-shared $RPM_BUILD_ROOT%{_libdir}/klibc/bin | |
183 | ||
184 | %clean | |
185 | rm -rf $RPM_BUILD_ROOT | |
186 | ||
187 | %files | |
188 | %defattr(644,root,root,755) | |
189 | %attr(755,root,root) /%{_lib}/klibc-*.so | |
190 | ||
191 | %files devel | |
192 | %defattr(644,root,root,755) | |
193 | %attr(755,root,root) %{_bindir}/klcc | |
194 | %{_includedir}/klibc | |
195 | %dir %{_libdir}/klibc | |
196 | %attr(755,root,root) %{_libdir}/klibc/*.so | |
197 | %{_libdir}/klibc/*.o | |
198 | %{_mandir}/man1/klcc.1* | |
199 | ||
200 | %files static | |
201 | %defattr(644,root,root,755) | |
202 | %{_libdir}/klibc/*.a | |
203 | ||
204 | %files utils-shared | |
205 | %defattr(644,root,root,755) | |
206 | %{_libdir}/klibc/bin | |
207 | %dir %{_libdir}/klibc/bin-shared | |
208 | %attr(755,root,root) %{_libdir}/klibc/bin-shared/* | |
209 | %exclude %{_libdir}/klibc/bin-shared/*.g | |
210 | ||
211 | %files utils-shared-debug | |
212 | %defattr(644,root,root,755) | |
213 | %attr(755,root,root) %{_libdir}/klibc/bin-shared/*.g | |
214 | ||
215 | %files utils-static | |
216 | %defattr(644,root,root,755) | |
217 | %dir %{_libdir}/klibc/bin-static | |
218 | %attr(755,root,root) %{_libdir}/klibc/bin-static/* | |
219 | %exclude %{_libdir}/klibc/bin-static/*.g | |
220 | ||
221 | %files utils-static-debug | |
222 | %defattr(644,root,root,755) | |
223 | %attr(755,root,root) %{_libdir}/klibc/bin-static/*.g |