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