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