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