# disable stack protector, build doesn't work with it %define _ssp_cflags %{nil} %define uclibc_root %{_prefix}/uclibc %define uclibc_cc uclibc-gcc %define majorish 0.9.30.1 Summary: A C library optimized for size useful for embedded applications Name: uClibc Version: %{majorish} Release: %mkrel 12 License: LGPLv2.1 Group: System/Libraries URL: http://uclibc.org/ Source0: http://uclibc.org/downloads/%{name}-%{version}.tar.bz2 Source1: http://uclibc.org/downloads/%{name}-%{version}.tar.bz2.sign Source2: uClibc-0.9.30.2-config Patch0: uClibc-0.9.30.1-getline.patch Patch1: uClibc-0.9.30.1-lib64.patch # http://lists.busybox.net/pipermail/uclibc/2009-September/043035.html Patch2: uClibc-0.9.30.2-add-rpmatch-function.patch # http://svn.exactcode.de/t2/branches/7.0/package/base/uclibc/scanf-aflag.patch Patch3: uClibc-0.9.30.1-add-scanf-a-flag.patch # (proyvind): the ABI isn't stable, so set it to current version Patch4: uClibc-0.9.30.2-unstable-abi.patch # backported patches from uClibc git: Patch100: uClibc-0.9.30.1-64bit-strtouq.patch Patch101: uClibc-0.9.30.1-arm-fix-linuxthreads-sysdep.patch Patch102: uClibc-0.9.30.1-c99-ldbl-math.patch Patch103: uClibc-0.9.30.1-dl-sysdep-inline.patch Patch104: uClibc-0.9.30.1-fix-getaddrinfo.patch Patch105: uClibc-0.9.30.1-enable-nanosecond-stat.patch Patch106: uClibc-0.9.30.1-add-missing-utime-defs.patch Patch107: uClibc-0.9.30.1-add-strverscmp-and-versionsort-64.patch Patch108: uClibc-0.9.30.1-libm-add-scalbf-gammaf-significandf-wrappers.patch Patch109: uClibc-0.9.30.1-test-stat-fix-compiling-the-memcmp-stat-test-when-__.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %define desc uclibc (pronounced yew-see-lib-see) is a c library for developing\ embedded linux systems. it is much smaller than the gnu c library,\ but nearly all applications supported by glibc also work perfectly\ with uclibc. porting applications from glibc to uclibc typically\ involves just recompiling the source code. uclibc even supports\ shared libraries and threading. it currently runs on standard\ linux and mmu-less (also known as uclinux) systems with support\ for alpha, arm, cris, i386, i960, h8300, m68k, mips/mipsel,\ powerpc, sh, sparc, and v850 processors.\ \ if you are building an embedded linux system and you find that\ glibc is eating up too much space, you should consider using\ uclibc. if you are building a huge fileserver with 12 terabytes of\ storage, then using glibc may make more sense. unless, for\ example, that 12 terabytes will be network attached storage and\ you plan to burn linux into the system's firmware... #' <- this is just to "close" to work around vim highlighting :p %description %{desc} %define libname %mklibname %{name} %{version} %package -n %{libname} Summary: %{summary} Group: System/Libraries Provides: %mklibname %{name} Obsoletes: %{mklibname %{name}} <= %{version}-%{release} Requires: %{name} %description -n %{libname} %{desc} %define libdev %mklibname %{name} -d %package -n %{libdev} Summary: Development files & libraries for uClibc Group: Development/C Requires: %{libname} = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} Obsoletes: %{name}-devel <= %{version}-%{release} %define libstat %mklibname %{name} -d -s Provides: %{libstat} = %{version}-%{release} Obsoletes: %{libstat} <= %{version}-%{release} Provides: libc-static Provides: %{name}-static-devel = %{version}-%{release} Obsoletes: %{name}-static-devel <= %{version}-%{release} %description -n %{libdev} Small libc for building embedded applications. %prep %setup -q %patch0 -p1 -b .getline~ %patch1 -p1 -b .lib64~ %patch2 -p1 -b .rpmatch~ %patch3 -p1 -b .a_flag~ %patch4 -p1 -b .abi_version~ %patch100 -p1 -b .64bit_strouq~ %patch101 -p1 -b .arm_linuxthreads~ %patch102 -p1 -b .c99_math~ %patch103 -p1 -b .dl_sysdep~ %patch104 -p1 -b .getaddrinfo~ %patch105 -p1 -b .ns_stat~ %patch106 -p1 -b .utime_defs~ %patch107 -p1 -b .versionsort~ %patch108 -p1 -b .scalbf~ %patch109 -p1 -b .stat_check~ %define arch %(echo %{_arch} | sed -e 's/ppc/powerpc/') cat %{SOURCE2} |sed \ -e "s|@CFLAGS@|%{optflags}|g" \ -e 's|@ARCH@|%{arch}|g' \ -e 's|@LIB@|%{_lib}|g' \ -e 's|@PREFIX@|%{uclibc_root}|g' \ >> .config %build yes "" | %make oldconfig V=1 %make VERBOSE=1 CPU_CFLAGS="" all utils %check exit 0 ln -snf %{_includedir}/{asm,asm-generic,linux} test ln -snf %{buildroot}%{uclibc_root} install_dir # This test relies on /etc/ethers being present to pass, so we'll skip it by # removing it rm -f test/inet/tst-ethers* %make check VERBOSE=1 || /bin/true %install [ -d "%{buildroot}" ] && chmod 777 -R %{buildroot} rm -rf %{buildroot} %make VERBOSE=1 PREFIX=%{buildroot} install %make -C utils VERBOSE=1 PREFIX=%{buildroot} utils_install # be sure that we don't package any backup files find %{buildroot} -name \*~|xargs rm -f install -d %{buildroot}%{_bindir} # using 'rpm --eval' here for multilib purposes.. #TODO: figure out binutils --sysroot + multilib in binutils package? cat > %{buildroot}%{_bindir}/%{uclibc_cc} << EOF #!/bin/sh export C_INCLUDE_PATH="\$(rpm --eval %%{uclibc_root}%%{_includedir}):\$(gcc -print-search-dirs|grep install:|cut -d\ -f2)include" export LD_RUN_PATH="\$(rpm --eval %%{uclibc_root}/%%{_lib}:%%{uclibc_root}%%{_libdir})" export LIBRARY_PATH="\$LD_RUN_PATH" export GCC_EXEC_PREFIX="\$LD_RUN_PATH" gcc -muclibc \$(rpm --eval "-Wl,--dynamic-linker,%%{uclibc_root}/%%{_lib}/%%{_lib}-uClibc.so.0"|sed -e 's#lib-uClibc#ld-uClibc#g' -e 's#lib64-uClibc#ld64-uClibc#g') \$@ EOF chmod +x %{buildroot}%{_bindir}/%{uclibc_cc} install -d %{buildroot}%{_sysconfdir}/rpm/macros.d cat > %{buildroot}%{_sysconfdir}/rpm/macros.d/uclibc.macros << EOF %%uclibc_root %{uclibc_root} %%uclibc_cc %{uclibc_cc} %%uclibc_cflags %%{optflags} -fno-stack-protector EOF #(peroyvind) rpm will make these symlinks relative ln -snf %{_includedir}/{asm,asm-generic,linux} %{buildroot}%{uclibc_root}%{_includedir} %if "%{_lib}" == "lib64" ln -s ld64-uClibc.so.%{version} %{buildroot}%{uclibc_root}/%{_lib}/ld64-uClibc.so.0 %else ln -s ld-uClibc.so.%{version} %{buildroot}%{uclibc_root}/lib/ld-uClibc.so.0 %endif ln -s libc.so.%{version} %{buildroot}%{uclibc_root}/%{_lib}/libc.so.0 for dir in /bin /sbin %{_prefix} %{_bindir} %{_sbindir}; do mkdir -p %{buildroot}%{uclibc_root}$dir done mkdir -p %{buildroot}%{uclibc_root}%{_sysconfdir} touch %{buildroot}%{uclibc_root}%{_sysconfdir}/ld.so.{conf,cache} # automatic ldconfig cache update on rpm installs/removals # (see http://wiki.mandriva.com/en/Rpm_filetriggers) install -d %{buildroot}%{_var}/lib/rpm/filetriggers cat > %{buildroot}%{_var}/lib/rpm/filetriggers/uclibc.ldconfig.filter << EOF ^.(%{uclibc_root}/lib|%{uclibc_root}%{_prefix}/lib)(64)?/[^/]*\.so\. EOF cat > %{buildroot}%{_var}/lib/rpm/filetriggers/uclibc.ldconfig.script << EOF #!/bin/sh %{uclibc_root}/sbin/ldconfig -X EOF chmod 755 %{buildroot}%{_var}/lib/rpm/filetriggers/uclibc.ldconfig.script %post -p %{uclibc_root}/sbin/ldconfig %clean rm -rf %{buildroot} %files %defattr(-,root,root,755) %doc README %dir %{uclibc_root} %dir %{uclibc_root}/bin %dir %{uclibc_root}/sbin %dir %{uclibc_root}%{_prefix} %dir %{uclibc_root}%{_bindir} %dir %{uclibc_root}%{_sbindir} %dir %{uclibc_root}/%{_lib} %dir %{uclibc_root}%{_libdir} %verify(not md5 size mtime) %config(noreplace) %{uclibc_root}%{_sysconfdir}/ld.so.conf %ghost %{uclibc_root}%{_sysconfdir}/ld.so.cache %{uclibc_root}%{_bindir}/ldd %{uclibc_root}/sbin/ldconfig %if "%{_lib}" == "lib64" %dir %{uclibc_root}/lib64 %{uclibc_root}/lib64/libc.so.0 %{uclibc_root}/lib64/ld64-uClibc.so.0 %else %{uclibc_root}/lib/ld-uClibc.so.0 %{uclibc_root}/lib/libc.so.0 %endif %{_var}/lib/rpm/filetriggers/uclibc.ldconfig.filter %{_var}/lib/rpm/filetriggers/uclibc.ldconfig.script %files -n %{libname} %defattr(-,root,root) %ifnarch %{sparcx} %{uclibc_root}/%{_lib}/*-*%{version}.so %{uclibc_root}/%{_lib}/*.so.%{version} %endif %files -n %{libdev} %defattr(-,root,root) %doc docs/* Changelog TODO %{_bindir}/%{uclibc_cc} %{_sysconfdir}/rpm/macros.d/uclibc.macros %{uclibc_root}%{_includedir} %{uclibc_root}%{_libdir}/crt1.o %{uclibc_root}%{_libdir}/crti.o %{uclibc_root}%{_libdir}/crtn.o %ifnarch %{sparcx} %{uclibc_root}%{_libdir}/Scrt1.o %{uclibc_root}%{_libdir}/librt.so %{uclibc_root}%{_libdir}/libnsl.so %{uclibc_root}%{_libdir}/libpthread.so %{uclibc_root}%{_libdir}/libc.so %{uclibc_root}%{_libdir}/libcrypt.so %{uclibc_root}%{_libdir}/libdl.so %{uclibc_root}%{_libdir}/libm.so %{uclibc_root}%{_libdir}/libresolv.so %{uclibc_root}%{_libdir}/libutil.so %endif %defattr(-,root,root) %{uclibc_root}%{_libdir}/lib*.a %{uclibc_root}%{_libdir}/uclibc_nonshared.a %changelog * Tue Mar 23 2010 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-12mdv2010.1 + Revision: 526921 - fix %%files list - ditch feeble multilib hack... - fix license - fix double '/' in include path for uclibc-gcc wrapper, resulting in debugedit erroring out with "canonicalization unexpectedly shrank by one character" * Sat Jan 30 2010 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-11mdv2010.1 + Revision: 498464 - call correct ldconfig (#56934) * Fri Jan 29 2010 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-10mdv2010.1 + Revision: 498316 - fix ldconfig filetrigger filter match (#56934) * Fri Dec 11 2009 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-9mdv2010.1 + Revision: 476575 - add /etc/ld.so.{cache,conf} & corresponding filetrigger script/filter - add back -W,--dynamic-linker to wrapper for now - move around symlinks created and fix ownership of directories - ditch -Os from %%{uclibc_cflags} as __OPTIMIZE_SIZE__ which implies the same is already defined in %%{uclibc_root}%%{_includedir}/features.h - don't disable debugging symbols in uclibc-gcc wrapper - create a uClibc package required by library which contains ldconfig, ldd & symlink to elf interpreter at the location gcc has hardcoded with -muclibc - git snapshot gave too many new issues to deal with.. cowardly revert.. :/ - don't pass -Wl,--dynamic-linker to gcc in the wrapper anymore - drop o0ld patches - ABI isn't stable, so change ABI major to version (P4) - don't build with -fstack-protector, seems to break even though it shouldn't..:/ - trim double slashes - enable debug packages - enable ssp update to git snapshot to save a lot of trouble with wrappers etc.. - revert LDSO_BASE_FILENAME back to 'ld.so', as we're installing uclibc to a different chroot anyways... - fix another typo in lib64 patch - fix typo * Mon Dec 07 2009 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-8mdv2010.1 + Revision: 474298 - add version to package name as cases where dynamic linking is preferred seems to exist :) - fix build of memcmp-stat stet (P109, from git) - add scalbf(), gammaf(), significandf() wrappers (P108, from git) - add support for scanf %%a modifier (P3) - enable some more glibc stdio compatibility - fetch .config in %%prep rather than %%build - enable LDSO_PRELOAD_FILE_SUPPORT - set LDSO_BASE_FILENAME to "ld-uClibc.so" - add -muclibc flag to uclic-gcc wrapper * Sat Dec 05 2009 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-7mdv2010.1 + Revision: 473694 - add -g0 to %%{uclibc_cflags} - enable wide character support - add strverscmp() and versionsort[64]() (P107, backport from git) * Thu Dec 03 2009 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-6mdv2010.1 + Revision: 472779 - merge static-devel & devel package * Thu Dec 03 2009 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-5mdv2010.1 + Revision: 472773 - enable MALLOC_GLIBC_COMPAT - make %%{uclibc_cflags} into a macro to be passed rather than part of wrapper - set gcc options through environment variables where possible for wrapper script - fix dynamic linking in wrapper script * Tue Dec 01 2009 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-4mdv2010.1 + Revision: 472156 - add %%{uclibc_cc} & %%{uclibc_cflags} macros - create a uclibc.macros - backport nanosecond stat support from git - force disabling of stack protector in uclibc-gcc wrapper - add rpmatch() (P2, needed to build plymouth against uclibc) * Mon Nov 30 2009 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-3mdv2010.1 + Revision: 471728 - be sure to own %%{uclibc_root}%%{_prefix} - ditch COPYING.LIB, it (LGPL) comes with common-licenses already - libify package (P1) - remove _requires_exception, it's fixed in /usr/lib/rpm/find-requires now * Mon Nov 30 2009 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-2mdv2010.1 + Revision: 471625 - don't hardcode 'x86_64' in wrapper - be sure that we don't include any backup files - set CPU_CFLAGS to "" so that it won't override -march=cpu from our %%optflags * Sun Nov 29 2009 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.30.1-1mdv2010.1 + Revision: 471031 - pick up patches from buildroot project to solve various issues.. - fix architecture prefix for paths - fix confic file SPECS/uClibc.spec modified file SOURCES/uClibc-0.9.30.1-arm-fix-linuxthreads-sysdep.patch added file SOURCES/uClibc-0.9.30.1-dl-sysdep-inline.patch added file SOURCES/uClibc-0.9.30.1-c99-ldbl-math.patch added file SOURCES/uClibc-0.9.30.1-config removed file SOURCES/uClibc-0.9.30.1-64bit-strtouq.patch added file SOURCES/uClibc-0.9.30.2-config added file SOURCES/uClibc-0.9.30.1-fix-getaddrinfo.patch added - new release: 0.9.31 - replace the old & deprecated gcc wrapper with a simpler shell script - run test suite - clean up quite a bit + Funda Wang <fwang@mandriva.org> - rediff toolchain wrapper patch - rediff mdkconf patch + Antoine Ginies <aginies@mandriva.com> - rebuild * Wed Jun 18 2008 Thierry Vignaud <tv@mandriva.org> 0.9.28.1-5mdv2009.0 + Revision: 225895 - rebuild * Mon Mar 24 2008 Per Ãyvind Karlsen <peroyvind@mandriva.org> 0.9.28.1-4mdv2008.1 + Revision: 189752 - rebuild against gcc 4.2.3 - s/-mtune=pentiumpro/-mtune=generic/ * Tue Mar 04 2008 Oden Eriksson <oeriksson@mandriva.com> 0.9.28.1-3mdv2008.1 + Revision: 178883 - rebuild + Olivier Blin <oblin@mandriva.com> - restore BuildRoot + Thierry Vignaud <tv@mandriva.org> - kill re-definition of %%buildroot on Pixel's request * Wed Aug 22 2007 Herton Ronaldo Krzesinski <herton@mandriva.com.br> 0.9.28.1-2mdv2008.0 + Revision: 68745 - Rebuild, and disable _ssp_cflags as build doesn't work with it. * Tue Feb 06 2007 Per Ãyvind Karlsen <pkarlsen@mandriva.com> 0.9.28.1-1mdv2007.0 + Revision: 116708 - update to 0.9.28.1 fix x86_64 build (P7) build on all archs * Tue Feb 06 2007 Oden Eriksson <oeriksson@mandriva.com> 0.9.28-8mdv2007.1 + Revision: 116671 - fix deps - remove the gcc_version macro expansion - disable the unused gcc_version macro expansion (second try) - disable the unused gcc_version macro expansion - Import uClibc * Sun Oct 01 2006 Oden Eriksson <oeriksson@mandriva.com> 0.9.28-8mdv2007.0 - x86_64 is not well supported, so exclude it * Thu Sep 28 2006 Oden Eriksson <oeriksson@mandriva.com> 0.9.28-7mdv2007.0 - rebuild * Thu Sep 28 2006 Oden Eriksson <oeriksson@mandriva.com> 0.9.28-6mdv2007.0 - sync with the mille-xterm project (0.9.26-5mdk) * Wed Sep 27 2006 Per Ãyvind Karlsen <pkarlsen@mandriva.com> 0.9.28-5mdv2007.0 - split out toolchain wrapper from one huge patch, use patches from PLD - force correct gcc for toolchain to use - cleanups * Tue Aug 22 2006 Oden Eriksson <oeriksson@mandriva.com> 0.9.28-4mdv2007.0 - rebuild * Sat Apr 08 2006 Per Ãyvind Karlsen <pkarlsen@mandriva.com> 0.9.28-3mdk - rebuild against new gcc - force dependecy on current gcc version * Thu Jan 19 2006 Stew Benedict <sbenedict@mandriva.com> 0.9.28-2mdk - buildrequires, x86_64 build (missing x86_64/resolve.S) * Wed Aug 31 2005 Per Ãyvind Karlsen <pkarlsen@mandriva.com> 0.9.28-1mdk - 0.9.28 - move test to new %%check stage (disabled) - minor tweak to P0 - get rid of warning about obsoletes -malign-{loops,jumps} * Fri Apr 29 2005 Per Ãyvind Karlsen <pkarlsen@mandriva.com> 0.9.27-5.20050428mdk - update to latest svn snapshot to fix x86_64 build * Wed Apr 27 2005 Per Ãyvind Karlsen <peroyvind@linux-mandrake.com> 0.9.27-4mdk - fix sparc build * Tue Mar 08 2005 Per Ãyvind Karlsen <peroyvind@linux-mandrake.com> 0.9.27-2mdk - no multiarch, rebuild for latest multiarch-utils - compile for i586 with optimizations - get rid of gcc warnings * Tue Feb 15 2005 Per Ãyvind Karlsen <peroyvind@linux-mandrake.com> 0.9.27-1mdk - 0.9.27 - regenerate P0 - drop P1 & P2 - multiarch * Sat Dec 25 2004 Per Ãyvind Karlsen <peroyvind@linux-mandrake.com> 0.9.26-5mdk - fix problem with kernel_types.h (P2 from CVS) * Sat Dec 25 2004 Per Ãyvind Karlsen <peroyvind@linux-mandrake.com> 0.9.26-4mdk - do not ship own kernel-headers, compile against systems (less hackish:) - require also %%{release} for subpackages - cleanups * Fri Dec 24 2004 Per Ãyvind Karlsen <peroyvind@linux-mandrake.com> 0.9.26-3mdk - urg?!?!? get rid of weird dependency that came out of nowhere:( * Fri Dec 24 2004 Per Ãyvind Karlsen <peroyvind@linux-mandrake.com> 0.9.26-2mdk - fix paths.. * Fri Dec 24 2004 Per Ãyvind Karlsen <peroyvind@linux-mandrake.com> 0.9.26-1mdk - 0.9.26 (with lots of suse hacks to make it build, probably needs some more tweaking..:\)