]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without dist_kernel # build without distribution kernel-headers | |
4 | %bcond_with verbose # verbose build | |
5 | # | |
6 | Summary: Minimalistic libc subset for use with initramfs | |
7 | Summary(pl.UTF-8): Zminimalizowany podzbiór biblioteki C do używania z initramfs | |
8 | Name: klibc | |
9 | Version: 1.5 | |
10 | Release: 1 | |
11 | License: BSD/GPL | |
12 | Group: Libraries | |
13 | Source0: http://www.kernel.org/pub/linux/libs/klibc/%{name}-%{version}.tar.bz2 | |
14 | # Source0-md5: 481dfdef7273f2cc776c2637f481f017 | |
15 | Patch0: %{name}-klcc.patch | |
16 | Patch1: %{name}-kill_interp_sohash.patch | |
17 | URL: http://www.zytor.com/mailman/listinfo/klibc/ | |
18 | BuildRequires: bison | |
19 | BuildRequires: flex | |
20 | BuildRequires: linux-libc-headers >= 7:2.6.20 | |
21 | BuildRequires: rpmbuild(macros) >= 1.153 | |
22 | BuildRequires: perl-base | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %define no_install_post_strip 1 | |
26 | ||
27 | %description | |
28 | klibc, what is intended to be a minimalistic libc subset for use with | |
29 | initramfs. It is deliberately written for small size, minimal | |
30 | entaglement and portability, not speed. It is definitely a work in | |
31 | progress, and a lot of things are still missing. | |
32 | ||
33 | %description -l pl.UTF-8 | |
34 | klibc w zamierzeniu ma być minimalistycznym podzbiorem biblioteki libc | |
35 | do użycia z initramfs. Celem jest minimalizacja, przenośność ale nie | |
36 | szybkość. klibc jest rozwijaną biblioteką w związku z czym nadal | |
37 | brakuje wielu rzeczy. | |
38 | ||
39 | %package devel | |
40 | Summary: Development files for klibc | |
41 | Summary(pl.UTF-8): Pliki dla programistów klibc | |
42 | Group: Development/Libraries | |
43 | Requires: %{name} = %{version}-%{release} | |
44 | Requires: binutils | |
45 | Requires: linux-libc-headers >= 7:2.6.20 | |
46 | ||
47 | %description devel | |
48 | Small libc for building embedded applications - development files. | |
49 | ||
50 | %description devel -l pl.UTF-8 | |
51 | Mała libc do budowania aplikacji wbudowanych - pliki dla programistów. | |
52 | ||
53 | %package static | |
54 | Summary: Static klibc libraries | |
55 | Summary(pl.UTF-8): Biblioteki statyczne klibc | |
56 | Group: Development/Libraries | |
57 | Requires: %{name}-devel = %{version}-%{release} | |
58 | ||
59 | %description static | |
60 | Static klibc libraries. | |
61 | ||
62 | %description static -l pl.UTF-8 | |
63 | Biblioteki statyczne klibc. | |
64 | ||
65 | %package utils-shared | |
66 | Summary: Utilities dynamically linked with klibc | |
67 | Summary(pl.UTF-8): Narzędzia dynamicznie zlinkowane z klibc | |
68 | Group: Base | |
69 | Requires: %{name} = %{version}-%{release} | |
70 | ||
71 | %description utils-shared | |
72 | Utilities dynamically linked with klibc. | |
73 | ||
74 | %description utils-shared -l pl.UTF-8 | |
75 | Narzędzia dynamicznie zlinkowane z klibc. | |
76 | ||
77 | %package utils-static | |
78 | Summary: Utilities statically linked with klibc | |
79 | Summary(pl.UTF-8): Narzędzia statycznie zlinkowane z klibc | |
80 | Group: Base | |
81 | ||
82 | %description utils-static | |
83 | Utilities staticly linked with klibc. | |
84 | ||
85 | %description utils-static -l pl.UTF-8 | |
86 | Narzędzia statycznie zlinkowane z klibc. | |
87 | ||
88 | %prep | |
89 | %setup -q | |
90 | %patch0 -p1 | |
91 | %patch1 -p1 | |
92 | ||
93 | %build | |
94 | cd usr/include | |
95 | ln -sf /usr/include/linux . | |
96 | ln -sf /usr/include/asm . | |
97 | ln -sf /usr/include/asm-generic . | |
98 | %ifarch %{x8664} | |
99 | ln -sf /usr/include/asm-i386 . | |
100 | ln -sf /usr/include/asm-x86_64 . | |
101 | %endif | |
102 | %ifarch sparc64 | |
103 | ln -sf /usr/include/asm-sparc . | |
104 | ln -sf /usr/include/asm-sparc64 . | |
105 | %endif | |
106 | ||
107 | cd ../.. | |
108 | install -d linux | |
109 | ln -sf ../usr/include linux/include | |
110 | ||
111 | %{__make} \ | |
112 | ARCH=%{_target_base_arch} \ | |
113 | HOSTCC="%{__cc}" \ | |
114 | rpm_prefix=%{_prefix} \ | |
115 | rpm_bindir=%{_bindir} \ | |
116 | rpm_includedir=%{_includedir}/klibc \ | |
117 | rpm_libdir=%{_libdir} \ | |
118 | SHLIBDIR=/%{_lib} \ | |
119 | %{?with_verbose:KBUILD_VERBOSE=1} \ | |
120 | OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \ | |
121 | -falign-jumps=0 -falign-loops=0 -ffreestanding" | |
122 | ||
123 | %install | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | install -d $RPM_BUILD_ROOT/%{_lib} | |
126 | install -d $RPM_BUILD_ROOT%{_includedir}/klibc | |
127 | install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static} | |
128 | ||
129 | cp -a usr/include/* $RPM_BUILD_ROOT%{_includedir}/klibc | |
130 | install klcc/klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc | |
131 | install klcc/klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1 | |
132 | install usr/klibc/libc.* usr/klibc/arch/%{_target_base_arch}/crt0.o usr/klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc | |
133 | install usr/klibc/klibc.so $RPM_BUILD_ROOT/%{_lib} | |
134 | install usr/dash/sh.shared $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh | |
135 | install usr/dash/sh.shared.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh.g | |
136 | install usr/dash/sh $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh | |
137 | install usr/dash/sh.g $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh.g | |
138 | install usr/kinit/*/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared | |
139 | install usr/kinit/*/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
140 | install usr/utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared | |
141 | install usr/utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static | |
142 | ||
143 | %clean | |
144 | rm -rf $RPM_BUILD_ROOT | |
145 | ||
146 | %files | |
147 | %defattr(644,root,root,755) | |
148 | %attr(755,root,root) /%{_lib}/klibc.so | |
149 | ||
150 | %files devel | |
151 | %defattr(644,root,root,755) | |
152 | %attr(755,root,root) %{_bindir}/klcc | |
153 | %{_includedir}/klibc | |
154 | %dir %{_libdir}/klibc | |
155 | %attr(755,root,root) %{_libdir}/klibc/*.so | |
156 | %{_libdir}/klibc/*.o | |
157 | %{_mandir}/man1/* | |
158 | ||
159 | %files static | |
160 | %defattr(644,root,root,755) | |
161 | %{_libdir}/klibc/*.a | |
162 | ||
163 | %files utils-shared | |
164 | %defattr(644,root,root,755) | |
165 | %dir %{_libdir}/klibc/bin-shared | |
166 | %attr(755,root,root) %{_libdir}/klibc/bin-shared/* | |
167 | ||
168 | %files utils-static | |
169 | %defattr(644,root,root,755) | |
170 | %dir %{_libdir}/klibc/bin-static | |
171 | %attr(755,root,root) %{_libdir}/klibc/bin-static/* |