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