]>
Commit | Line | Data |
---|---|---|
e17d518f | 1 | # |
e0821253 JK |
2 | # TODO: |
3 | # - warning: Installed (but unpackaged) file(s) found: | |
4 | # /usr/lib/klibc/libc.so.hash | |
5 | # | |
e17d518f JB |
6 | # Conditional build: |
7 | %bcond_without dist_kernel # build without distribution kernel-headers | |
4f5f4ff4 | 8 | %bcond_with verbose # verbose build |
e17d518f | 9 | # |
d3eef778 | 10 | Summary: Minimalistic libc subset for use with initramfs |
8690a6c0 | 11 | Summary(pl.UTF-8): Zminimalizowany podzbiór biblioteki C do używania z initramfs |
d3eef778 | 12 | Name: klibc |
88ca6b52 JB |
13 | Version: 2.0.6 |
14 | Release: 1 | |
8c66903c | 15 | License: BSD/GPL |
d3eef778 | 16 | Group: Libraries |
55f4c5da | 17 | Source0: https://www.kernel.org/pub/linux/libs/klibc/2.0/%{name}-%{version}.tar.xz |
88ca6b52 | 18 | # Source0-md5: d01e2f8fa8a616c8523787ea4c634e8b |
0de29ff3 | 19 | Patch0: %{name}-klcc.patch |
14e46099 | 20 | Patch1: aligned_u64.patch |
321006c0 | 21 | URL: http://www.zytor.com/mailman/listinfo/klibc/ |
e65c6b5d JB |
22 | # ld.bfd binary |
23 | BuildRequires: binutils >= 2.20.51.0.6 | |
580efb58 | 24 | BuildRequires: bison |
25 | BuildRequires: flex | |
3f35718a | 26 | BuildRequires: linux-libc-headers >= 7:2.6.24-1 |
e17d518f | 27 | BuildRequires: perl-base |
f18cfcaa | 28 | BuildRequires: perl-modules |
29 | BuildRequires: rpmbuild(macros) >= 1.153 | |
27cc1f85 JB |
30 | BuildRequires: tar >= 1:1.22 |
31 | BuildRequires: xz | |
d3eef778 AM |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
e17d518f | 34 | %define no_install_post_strip 1 |
d3eef778 AM |
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 | ||
df4dc817 JR |
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 | |
d3eef778 AM |
46 | brakuje wielu rzeczy. |
47 | ||
bdde959a PS |
48 | %package devel |
49 | Summary: Development files for klibc | |
8690a6c0 | 50 | Summary(pl.UTF-8): Pliki dla programistów klibc |
bdde959a | 51 | Group: Development/Libraries |
d5f6848a | 52 | Requires: %{name} = %{version}-%{release} |
bdde959a | 53 | Requires: binutils |
3f35718a | 54 | Requires: linux-libc-headers >= 7:2.6.24-1 |
bdde959a PS |
55 | |
56 | %description devel | |
57 | Small libc for building embedded applications - development files. | |
58 | ||
df4dc817 JR |
59 | %description devel -l pl.UTF-8 |
60 | Mała libc do budowania aplikacji wbudowanych - pliki dla programistów. | |
bdde959a PS |
61 | |
62 | %package static | |
63 | Summary: Static klibc libraries | |
8690a6c0 | 64 | Summary(pl.UTF-8): Biblioteki statyczne klibc |
bdde959a | 65 | Group: Development/Libraries |
d5f6848a | 66 | Requires: %{name}-devel = %{version}-%{release} |
bdde959a PS |
67 | |
68 | %description static | |
69 | Static klibc libraries. | |
70 | ||
df4dc817 | 71 | %description static -l pl.UTF-8 |
bdde959a PS |
72 | Biblioteki statyczne klibc. |
73 | ||
7a694fa4 | 74 | %package utils-shared |
2c601817 | 75 | Summary: Utilities dynamically linked with klibc |
8690a6c0 | 76 | Summary(pl.UTF-8): Narzędzia dynamicznie zlinkowane z klibc |
2c601817 | 77 | Group: Base |
036f735f | 78 | Requires: %{name} = %{version}-%{release} |
7a694fa4 AM |
79 | |
80 | %description utils-shared | |
036f735f JB |
81 | Utilities dynamically linked with klibc. |
82 | ||
df4dc817 JR |
83 | %description utils-shared -l pl.UTF-8 |
84 | Narzędzia dynamicznie zlinkowane z klibc. | |
7a694fa4 | 85 | |
a78269a3 JR |
86 | %package utils-shared-debug |
87 | Summary: Utilities dynamically linked with klibc (unstripped) | |
40258091 | 88 | Summary(pl.UTF-8): Narzędzia dynamicznie zlinkowane z klibc (z informacjami dla debuggera) |
a78269a3 JR |
89 | Group: Base |
90 | Requires: %{name}-utils-shared = %{version}-%{release} | |
91 | ||
92 | %description utils-shared-debug | |
93 | Utilities dynamically linked with klibc. | |
40258091 | 94 | |
9cab31ae | 95 | Programs in this package have debugging information not stripped. |
a78269a3 JR |
96 | |
97 | %description utils-shared-debug -l pl.UTF-8 | |
98 | Narzędzia dynamicznie zlinkowane z klibc. | |
40258091 JB |
99 | |
100 | Programy zawarte w tym pakiecie zawierają informacje dla debuggera. | |
a78269a3 | 101 | |
7a694fa4 | 102 | %package utils-static |
2c601817 | 103 | Summary: Utilities statically linked with klibc |
8690a6c0 | 104 | Summary(pl.UTF-8): Narzędzia statycznie zlinkowane z klibc |
2c601817 | 105 | Group: Base |
7a694fa4 AM |
106 | |
107 | %description utils-static | |
108 | Utilities staticly linked with klibc. | |
109 | ||
df4dc817 JR |
110 | %description utils-static -l pl.UTF-8 |
111 | Narzędzia statycznie zlinkowane z klibc. | |
a78269a3 JR |
112 | |
113 | %package utils-static-debug | |
114 | Summary: Utilities statically linked with klibc (unstripped) | |
40258091 | 115 | Summary(pl.UTF-8): Narzędzia statycznie zlinkowane z klibc (z informacjami dla debuggera) |
a78269a3 JR |
116 | Group: Base |
117 | Requires: %{name}-utils-static = %{version}-%{release} | |
118 | ||
119 | %description utils-static-debug | |
120 | Utilities staticly linked with klibc. | |
40258091 | 121 | |
5018c634 | 122 | Programs in this package have debugging information not stripped. |
a78269a3 JR |
123 | |
124 | %description utils-static-debug -l pl.UTF-8 | |
125 | Narzędzia statycznie zlinkowane z klibc. | |
40258091 JB |
126 | |
127 | Programy zawarte w tym pakiecie zawierają informacje dla debuggera. | |
036f735f | 128 | |
d3eef778 AM |
129 | %prep |
130 | %setup -q | |
1a41b530 | 131 | %patch0 -p1 |
14e46099 | 132 | %patch1 -p2 |
d3eef778 AM |
133 | |
134 | %build | |
cfacef84 | 135 | cd usr/include |
30162054 JB |
136 | ln -sf /usr/include/asm . |
137 | ln -sf /usr/include/asm-generic . | |
4f5f4ff4 | 138 | %ifarch sparc64 |
139 | ln -sf /usr/include/asm-sparc . | |
140 | ln -sf /usr/include/asm-sparc64 . | |
141 | %endif | |
3f35718a PS |
142 | ln -sf /usr/include/linux . |
143 | # early-userspace needs acces to e.g. uvesafb.h. | |
144 | ln -sf /usr/include/video . | |
4f5f4ff4 | 145 | |
cfacef84 | 146 | cd ../.. |
291edbfa JB |
147 | install -d linux |
148 | ln -sf ../usr/include linux/include | |
d3eef778 | 149 | |
d3eef778 | 150 | %{__make} \ |
8c66903c | 151 | ARCH=%{_target_base_arch} \ |
f2698199 | 152 | HOSTCC="%{__cc}" \ |
e65c6b5d JB |
153 | CC="%{__cc}" \ |
154 | LD="ld.bfd" \ | |
278b233a AM |
155 | rpm_prefix=%{_prefix} \ |
156 | rpm_bindir=%{_bindir} \ | |
157 | rpm_includedir=%{_includedir}/klibc \ | |
158 | rpm_libdir=%{_libdir} \ | |
09055665 | 159 | SHLIBDIR=/%{_lib} \ |
4f5f4ff4 | 160 | %{?with_verbose:KBUILD_VERBOSE=1} \ |
d3eef778 | 161 | OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \ |
368a55c7 | 162 | -falign-jumps=0 -falign-loops=0 -ffreestanding" |
d3eef778 AM |
163 | |
164 | %install | |
165 | rm -rf $RPM_BUILD_ROOT | |
a8f95f0f | 166 | install -d $RPM_BUILD_ROOT/%{_lib} |
d3eef778 | 167 | install -d $RPM_BUILD_ROOT%{_includedir}/klibc |
7a694fa4 | 168 | install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static} |
d3eef778 | 169 | |
cfacef84 | 170 | cp -a usr/include/* $RPM_BUILD_ROOT%{_includedir}/klibc |
0de29ff3 AM |
171 | install klcc/klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc |
172 | install klcc/klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1 | |
cfacef84 | 173 | install usr/klibc/libc.* usr/klibc/arch/%{_target_base_arch}/crt0.o usr/klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc |
201b5da4 | 174 | install usr/klibc/klibc-*.so $RPM_BUILD_ROOT/%{_lib} |
88ca6b52 JB |
175 | install usr/dash/shared/sh $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared |
176 | install usr/dash/shared/sh.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared | |
177 | install usr/dash/static/sh $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
178 | install usr/dash/static/sh.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
179 | install usr/gzip/{gunzip,gzip,gzip.g,zcat} $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
386f9626 | 180 | install usr/kinit/*/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared |
181 | install usr/kinit/*/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
cfacef84 PS |
182 | install usr/utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared |
183 | install usr/utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
7a694fa4 | 184 | |
a78269a3 JR |
185 | ln -s %{_libdir}/klibc/bin-shared $RPM_BUILD_ROOT%{_libdir}/klibc/bin |
186 | ||
d3eef778 AM |
187 | %clean |
188 | rm -rf $RPM_BUILD_ROOT | |
189 | ||
190 | %files | |
191 | %defattr(644,root,root,755) | |
201b5da4 | 192 | %attr(755,root,root) /%{_lib}/klibc-*.so |
bdde959a PS |
193 | |
194 | %files devel | |
195 | %defattr(644,root,root,755) | |
00a0ff6f PS |
196 | %attr(755,root,root) %{_bindir}/klcc |
197 | %{_includedir}/klibc | |
d3eef778 | 198 | %dir %{_libdir}/klibc |
d3eef778 | 199 | %attr(755,root,root) %{_libdir}/klibc/*.so |
bdde959a | 200 | %{_libdir}/klibc/*.o |
e65c6b5d | 201 | %{_mandir}/man1/klcc.1* |
7a694fa4 | 202 | |
bdde959a PS |
203 | %files static |
204 | %defattr(644,root,root,755) | |
205 | %{_libdir}/klibc/*.a | |
206 | ||
7a694fa4 AM |
207 | %files utils-shared |
208 | %defattr(644,root,root,755) | |
a78269a3 | 209 | %{_libdir}/klibc/bin |
7a694fa4 AM |
210 | %dir %{_libdir}/klibc/bin-shared |
211 | %attr(755,root,root) %{_libdir}/klibc/bin-shared/* | |
a78269a3 JR |
212 | %exclude %{_libdir}/klibc/bin-shared/*.g |
213 | ||
214 | %files utils-shared-debug | |
215 | %defattr(644,root,root,755) | |
216 | %attr(755,root,root) %{_libdir}/klibc/bin-shared/*.g | |
7a694fa4 AM |
217 | |
218 | %files utils-static | |
219 | %defattr(644,root,root,755) | |
220 | %dir %{_libdir}/klibc/bin-static | |
221 | %attr(755,root,root) %{_libdir}/klibc/bin-static/* | |
a78269a3 JR |
222 | %exclude %{_libdir}/klibc/bin-static/*.g |
223 | ||
224 | %files utils-static-debug | |
225 | %defattr(644,root,root,755) | |
226 | %attr(755,root,root) %{_libdir}/klibc/bin-static/*.g |