]>
Commit | Line | Data |
---|---|---|
c9753b19 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without shared # don't build shared lib support | |
4 | # | |
70879d06 | 5 | Summary: C library optimized for size |
2a309db2 | 6 | Summary(pl.UTF-8): Biblioteka C zoptymalizowana na rozmiar |
70879d06 | 7 | Name: uClibc |
835882e7 | 8 | Version: 0.9.29 |
0e912c1e | 9 | Release: 11 |
95116193 | 10 | Epoch: 2 |
1e0be70f | 11 | License: LGPL v2.1 |
3698d221 | 12 | Group: Libraries |
13 | Source0: http://uclibc.org/downloads/%{name}-%{version}.tar.bz2 | |
835882e7 | 14 | # Source0-md5: 61dc55f43b17a38a074f347e74095b20 |
eacf49ba | 15 | Patch0: %{name}-newsoname.patch |
835882e7 JB |
16 | Patch1: %{name}-toolchain-wrapper.patch |
17 | Patch2: %{name}-targetcpu.patch | |
21f5f0fd | 18 | Patch3: %{name}-debug.patch |
4ae50705 JB |
19 | Patch4: %{name}-stdio-unhide.patch |
20 | Patch5: %{name}-sparc.patch | |
3698d221 | 21 | URL: http://uclibc.org/ |
cd27c03b | 22 | BuildRequires: binutils-gasp |
c9753b19 | 23 | BuildRequires: cpp |
cd27c03b | 24 | BuildRequires: gcc >= 5:3.0 |
0e912c1e | 25 | BuildRequires: linux-libc-headers >= 7:2.6.24 |
91b0210c | 26 | BuildRequires: sed >= 4.0 |
d49d5dcf | 27 | BuildRequires: which |
f230b68a | 28 | ExclusiveArch: alpha %{ix86} ppc sparc sparcv9 %{x8664} |
70879d06 | 29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
70879d06 | 30 | |
8e0ba786 ER |
31 | %define specflags -fgnu89-inline |
32 | ||
835882e7 | 33 | %define uclibc_root /usr/%{_target_cpu}-linux-uclibc |
1f16f3bd | 34 | |
70879d06 | 35 | %description |
36 | Small libc for building embedded applications. | |
37 | ||
adb3d9c8 JR |
38 | %description -l pl.UTF-8 |
39 | Mała libc do budowania aplikacji wbudowanych. | |
056323ce | 40 | |
3698d221 | 41 | %package devel |
70879d06 | 42 | Summary: Development files for uClibc |
2a309db2 | 43 | Summary(pl.UTF-8): Pliki dla programistów uClibc |
70879d06 | 44 | Group: Development/Libraries |
2af21321 | 45 | Requires: %{name} = %{epoch}:%{version}-%{release} |
4311e39e | 46 | Requires: binutils |
0e912c1e | 47 | Requires: linux-libc-headers >= 7:2.6.24 |
33f7e18e | 48 | %requires_eq gcc |
70879d06 | 49 | |
3698d221 | 50 | %description devel |
70879d06 | 51 | Small libc for building embedded applications. |
52 | ||
adb3d9c8 JR |
53 | %description devel -l pl.UTF-8 |
54 | Mała libc do budowania aplikacji wbudowanych. | |
056323ce | 55 | |
3698d221 | 56 | %package static |
8ff09ad0 | 57 | Summary: Static uClibc libraries |
2a309db2 | 58 | Summary(pl.UTF-8): Biblioteki statyczne uClibc |
70879d06 | 59 | Group: Development/Libraries |
2af21321 | 60 | Requires: %{name}-devel = %{epoch}:%{version}-%{release} |
15ba795d | 61 | Provides: libc-static |
70879d06 | 62 | |
3698d221 | 63 | %description static |
8ff09ad0 | 64 | Static uClibc libraries. |
70879d06 | 65 | |
adb3d9c8 | 66 | %description static -l pl.UTF-8 |
3698d221 | 67 | Biblioteki statyczne uClibc. |
056323ce | 68 | |
70879d06 | 69 | %prep |
8733b462 | 70 | %setup -q |
30b1dd68 JB |
71 | %patch0 -p1 |
72 | %patch1 -p1 | |
fdce39e0 | 73 | %patch2 -p1 |
21f5f0fd | 74 | %patch3 -p1 |
4ae50705 | 75 | %patch4 -p1 |
b7bca0b9 | 76 | # check if it's needed now... ldso is broken on sparc anyway |
4ae50705 | 77 | #%patch5 -p1 |
70879d06 | 78 | |
df6ea0eb ER |
79 | # ARCH is already determined by uname -m |
80 | %ifarch %{ix86} | |
81 | defconfig=extra/Configs/defconfigs/i386 | |
82 | %ifarch i386 | |
83 | echo 'CONFIG_386=y' >> $defconfig | |
3698d221 | 84 | %endif |
df6ea0eb ER |
85 | %ifarch i486 |
86 | echo 'CONFIG_486=y' >> $defconfig | |
87 | %endif | |
88 | %ifarch i586 | |
89 | echo 'CONFIG_586=y' >> $defconfig | |
90 | %endif | |
91 | %ifarch i686 | |
92 | echo 'CONFIG_686=y' >> $defconfig | |
93 | %endif | |
94 | %ifarch pentium3 | |
95 | echo 'CONFIG_PENTIUMIII=y' >> $defconfig | |
96 | %endif | |
97 | %ifarch pentium4 | |
98 | echo 'CONFIG_PENTIUM4=y' >> $defconfig | |
99 | %endif | |
100 | %ifarch athlon | |
101 | echo 'CONFIG_K7=y' >> $defconfig | |
3698d221 | 102 | %endif |
9dfdc366 JB |
103 | %endif |
104 | %ifarch %{x8664} | |
df6ea0eb ER |
105 | defconfig=extra/Configs/defconfigs/x86_64 |
106 | %endif | |
107 | %ifarch alpha | |
108 | defconfig=extra/Configs/defconfigs/alpha | |
109 | %endif | |
110 | %ifarch sparc sparcv9 | |
111 | defconfig=extra/Configs/defconfigs/sparc | |
112 | %endif | |
113 | %ifarch ppc | |
114 | defconfig=extra/Configs/defconfigs/powerpc | |
115 | %endif | |
116 | %ifarch ia64 | |
117 | defconfig=extra/Configs/defconfigs/ia64 | |
3698d221 | 118 | %endif |
df6ea0eb ER |
119 | |
120 | cat <<'EOF' >> $defconfig | |
121 | UCLIBC_HAS_IPV6=y | |
122 | DO_C99_MATH=y | |
123 | UCLIBC_HAS_RPC=y | |
124 | # UCLIBC_HAS_FULL_RPC is not set | |
125 | # UCLIBC_HAS_REENTRANT_RPC is not set | |
126 | UCLIBC_HAS_SYS_SIGLIST=y | |
127 | SHARED_LIB_LOADER_PREFIX="$(RUNTIME_PREFIX)/lib" | |
128 | %if %{without shared} | |
129 | HAVE_NO_SHARED=y | |
130 | # HAVE_SHARED is not set | |
131 | %endif | |
132 | UCLIBC_HAS_PRINTF_M_SPEC=y | |
133 | UCLIBC_SUSV3_LEGACY=y | |
134 | UCLIBC_SUSV3_LEGACY_MACROS=y | |
135 | # DOSTRIP is not set | |
136 | %{?debug:DODEBUG=y} | |
137 | %{?debug:SUPPORT_LD_DEBUG=y} | |
138 | %{?debug:SUPPORT_LD_DEBUG_EARLY=y} | |
139 | EOF | |
30b1dd68 | 140 | |
70879d06 | 141 | %build |
df6ea0eb ER |
142 | # NOTE: 'defconfig' and 'all' must be run in separate make process because of macros |
143 | %{__make} defconfig \ | |
30b1dd68 | 144 | TARGET_CPU="%{_target_cpu}" \ |
5d1a434a | 145 | HOSTCC="%{__cc}" \ |
30b1dd68 | 146 | HOSTCFLAGS="%{rpmcflags} %{rpmldflags}" \ |
df6ea0eb ER |
147 | CC="%{__cc}" \ |
148 | OPTIMIZATION="%{rpmcflags} -Os" | |
149 | ||
150 | %{__make} \ | |
1ecf6a0b | 151 | TARGET_CPU="%{_target_cpu}" \ |
cd27c03b | 152 | HOSTCC="%{__cc}" \ |
15afd9ab | 153 | HOSTCFLAGS="%{rpmcflags} %{rpmldflags}" \ |
df6ea0eb ER |
154 | CC="%{__cc}" \ |
155 | OPTIMIZATION="%{rpmcflags} -Os" | |
70879d06 | 156 | |
157 | %install | |
158 | rm -rf $RPM_BUILD_ROOT | |
3698d221 | 159 | install -d $RPM_BUILD_ROOT%{_bindir} |
70879d06 | 160 | |
415dc192 | 161 | %{__make} -j1 install \ |
1ecf6a0b | 162 | TARGET_CPU="%{_target_cpu}" \ |
df6ea0eb ER |
163 | HOSTCC="%{__cc}" \ |
164 | HOSTCFLAGS="%{rpmcflags} %{rpmldflags}" \ | |
c95f6ae8 | 165 | CC="%{__cc}" \ |
df6ea0eb ER |
166 | OPTIMIZATION="%{rpmcflags} -Os" \ |
167 | DESTDIR=$RPM_BUILD_ROOT | |
70879d06 | 168 | |
c9753b19 | 169 | %if %{with shared} |
835882e7 JB |
170 | mv -f $RPM_BUILD_ROOT%{uclibc_root}/usr/lib/{libpthread-uclibc,libpthread}.so |
171 | ln -sf libpthread-0.9.29.so $RPM_BUILD_ROOT%{uclibc_root}/lib/libpthread.so.0 | |
c9753b19 | 172 | %endif |
835882e7 | 173 | |
b19cfcd2 | 174 | # these links are *needed* (by stuff in bin/) |
835882e7 | 175 | for f in $RPM_BUILD_ROOT%{uclibc_root}/bin/*; do |
c9753b19 ER |
176 | if [ -L $f ]; then |
177 | l=$(readlink $f) | |
178 | a=${l##*/} | |
179 | d=${l%/*} | |
180 | case "$d" in | |
181 | %{_bindir}) | |
182 | ln -sf ${l#%{_bindir}/} $RPM_BUILD_ROOT%{_bindir}/${f##*/} | |
183 | rm -f $f | |
184 | ;; | |
185 | $a) | |
186 | mv -f $f $RPM_BUILD_ROOT%{_bindir} | |
187 | ;; | |
188 | *) | |
189 | exit 1 | |
190 | ;; | |
191 | esac | |
192 | else | |
193 | a=${f#*/%{_target_cpu}-uclibc-} | |
194 | ln -sf %{_bindir}/$(basename $f) $RPM_BUILD_ROOT%{uclibc_root}/usr/bin/$a | |
195 | mv -f $f $RPM_BUILD_ROOT%{_bindir} | |
196 | fi | |
30b1dd68 | 197 | done |
70879d06 | 198 | |
c9753b19 ER |
199 | for f in $RPM_BUILD_ROOT%{uclibc_root}/usr/bin/*; do |
200 | if [ -L $f ]; then | |
201 | l=$(readlink $f) | |
202 | case "${l%/*}" in | |
203 | %{uclibc_root}/bin) | |
204 | a=${l#*/%{_target_cpu}-uclibc-} | |
205 | ln -sf %{_bindir}/$a $f | |
206 | ;; | |
207 | %{_bindir}) | |
208 | : | |
209 | ;; | |
210 | *) | |
211 | exit 2 | |
212 | ;; | |
213 | esac | |
214 | fi | |
f7ae07ef PS |
215 | done |
216 | ||
835882e7 JB |
217 | rm -rf $RPM_BUILD_ROOT%{uclibc_root}/usr/include/{linux,asm*} |
218 | ln -sf /usr/include/asm $RPM_BUILD_ROOT%{uclibc_root}/usr/include/asm | |
219 | ln -sf /usr/include/asm-generic $RPM_BUILD_ROOT%{uclibc_root}/usr/include/asm-generic | |
f230b68a | 220 | # for future use |
e74b8a86 | 221 | %ifarch sparc64 |
835882e7 JB |
222 | ln -sf /usr/include/asm-sparc $RPM_BUILD_ROOT%{uclibc_root}/usr/include/asm-sparc |
223 | ln -sf /usr/include/asm-sparc64 $RPM_BUILD_ROOT%{uclibc_root}/usr/include/asm-sparc64 | |
485e7d55 | 224 | %endif |
835882e7 | 225 | ln -sf /usr/include/linux $RPM_BUILD_ROOT%{uclibc_root}/usr/include/linux |
3c259173 | 226 | |
70879d06 | 227 | %clean |
228 | rm -rf $RPM_BUILD_ROOT | |
229 | ||
70879d06 | 230 | %files |
231 | %defattr(644,root,root,755) | |
835882e7 JB |
232 | %doc Changelog* DEDICATION.mjn3 MAINTAINERS README TODO |
233 | %dir %{uclibc_root} | |
f230b68a | 234 | %ifarch %{ix86} %{x8664} ppc sparc sparcv9 |
c9753b19 | 235 | %if %{with shared} |
835882e7 JB |
236 | %dir %{uclibc_root}/lib |
237 | %attr(755,root,root) %{uclibc_root}/lib/*.so* | |
9a46e67b | 238 | %endif |
c9753b19 | 239 | %endif |
70879d06 | 240 | |
3698d221 | 241 | %files devel |
70879d06 | 242 | %defattr(644,root,root,755) |
835882e7 | 243 | %doc docs/*.txt |
3698d221 | 244 | %attr(755,root,root) %{_bindir}/* |
835882e7 JB |
245 | %{uclibc_root}/usr/lib/*.o |
246 | %dir %{uclibc_root}/usr | |
247 | %dir %{uclibc_root}/usr/bin | |
248 | %attr(755,root,root) %{uclibc_root}/usr/bin/* | |
249 | %dir %{uclibc_root}/usr/lib | |
c9753b19 | 250 | %if %{with shared} |
835882e7 | 251 | %{uclibc_root}/usr/lib/uclibc_nonshared.a |
f230b68a | 252 | %ifarch %{ix86} %{x8664} ppc sparc sparcv9 |
835882e7 | 253 | %attr(755,root,root) %{uclibc_root}/usr/lib/*.so |
1a8228b3 | 254 | %endif |
c9753b19 | 255 | %endif |
835882e7 | 256 | %{uclibc_root}/usr/include |
3698d221 | 257 | |
258 | %files static | |
98274bf4 | 259 | %defattr(644,root,root,755) |
835882e7 | 260 | %{uclibc_root}/usr/lib/lib*.a |