## This package understands the following switches: ## --with[out] ssp ... enable/disable SSP; default depends ## on target architecture ## --with dynamic ... enable dynamic lib support %global snapshot 20081017 %global pkglibdir %_prefix/lib/dietlibc %ifarch %ix86 x86_64 %bcond_without ssp %else %bcond_with ssp %endif %ifarch %ix86 x86_64 arm %bcond_with dynamic %endif %ifarch %ix86 %global target_cpu i386 %else %global target_cpu %_target_cpu %endif %{!?release_func:%global release_func() %1%{?dist}} Summary: Small libc implementation Name: dietlibc Version: 0.31 Release: %release_func 6%{?snapshot:.%snapshot} License: GPLv2 Group: Development/Libraries URL: http://www.fefe.de/dietlibc/ %if !0%{?snapshot:1} Source0: http://www.kernel.org/pub/linux/libs/dietlibc/%name-%version.tar.bz2 Source1: http://www.fefe.de/dietlibc/%name-%version.tar.bz2.sig %else # generated by 'make cvs-sources [CVS_DATE=....]' Source0: %name-%version.%snapshot.tar.bz2 %endif Source10: runtests-X.sh Patch1: dietlibc-0.28-setpriority.patch Patch10: dietlibc-0.29-scall.patch Patch20: dietlibc-0.29-nostackprotector.patch Patch30: dietlibc-0.30-longdouble.patch Patch31: dietlibc-0.31-defpath.patch Patch32: dietlibc-0.31-stacksmash.patch Patch33: dietlibc-0.31-stacksmash-dyn.patch Patch41: dietlibc-0.31.20080212-teststdout.patch Patch43: dietlibc-0.31-pagesize.patch Patch44: dietlibc-0.31-printFG.patch Patch46: dietlibc-0.31-testsuite.patch Patch47: dietlibc-0.31-lcctime.patch Patch48: dietlibc-0.31-implicitfunc.patch Patch49: dietlibc-0.31-noreturn.patch BuildRoot: %_tmppath/%name-%version-%release-buildroot %{?with_dynamic:Requires: dietlibc-lib = %version-%release} %{!?with_dynamic:Obsoletes: dietlibc-lib < %version-%release} Requires: %name-devel = %version-%release BuildRequires: gdb %package devel Summary: dietlibc development files Group: Development/Libraries Requires: %name = %version-%release %package lib Summary: Dynamic libraries for dietlibc Group: System Environment/Libraries Conflicts: %name < %version-%release Conflicts: %name > %version-%release %description The diet libc is a libc that is optimized for small size. It can be used to create small statically linked binaries for Linux on alpha, arm, hppa, ia64, i386, mips, s390, sparc, sparc64, ppc and x86_64. %description devel The diet libc is a libc that is optimized for small size. It can be used to create small statically linked binaries for Linux on alpha, arm, hppa, ia64, i386, mips, s390, sparc, sparc64, ppc and x86_64. This package contains the header and object files for dietlibc. %description lib The diet libc is a libc that is optimized for small size. It can be used to create small statically linked binaries for Linux on alpha, arm, hppa, ia64, i386, mips, s390, sparc, sparc64, ppc and x86_64. This package contains the dynamic libraries for dietlibc. %prep %setup -q %{?snapshot:-n %name-%version.%snapshot} %patch1 -p1 -b .nice %patch10 -p1 -b .scall %patch30 -p1 -b .longdouble %patch31 -p1 -b .defpath %patch32 -p1 -b .stacksmash %patch33 -p1 -b .stacksmash-dyn %patch41 -p1 -b .teststdout %patch43 -p1 -b .pagesize %patch44 -p1 -b .printFG %patch46 -p1 -b .testsuite %patch47 -p1 -b .lcctime %patch48 -p1 -b .implicitfunc %patch49 -p1 -b .noreturn %if %{without ssp} %patch20 -p1 -b .nostackprotector sed -i -e 's!^#define WANT_SSP$!// \0!g; s!.*\(#define WANT_STACKGAP\).*!\1!g' dietfeatures.h %global xtra_fixcflags -fno-stack-protector %else %global xtra_fixcflags %nil %endif %ifarch %ix86 sed -i \ -e '/#define WANT_DYN_PAGESIZE/{c\' \ -e '#define WANT_ELFINFO' \ -e '}' \ dietfeatures.h %endif sed -i -e 's!strip !: !g' Makefile %global fixcflags -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables %xtra_fixcflags -Os -g3 -Werror-implicit-function-declaration %global basemakeflags prefix=%pkglibdir BINDIR=%_bindir MAN1DIR=%_mandir/man1 COMMENT=: CFLAGS="$RPM_OPT_FLAGS %fixcflags $XTRA_CFLAGS" PDIET=%pkglibdir %global makeflags %basemakeflags for i in `find test -name 'runtests.sh'`; do ln -s %SOURCE10 `dirname $i`/runtests-X.sh done %build make %makeflags all %{?_smp_mflags} # 'dyn' target is not SMP safe %{?with_dynamic:make %makeflags dyn} %install rm -rf $RPM_BUILD_ROOT install -d -m755 $RPM_BUILD_ROOT/etc make %makeflags DESTDIR=$RPM_BUILD_ROOT install ln -s lib-%_arch ${RPM_BUILD_ROOT}%pkglibdir/lib-%_arch-%_vendor chmod a-x $RPM_BUILD_ROOT%pkglibdir/lib-*/*.o rm -f $RPM_BUILD_ROOT%_bindir/dnsd %check XTRA_CFLAGS='-fno-builtin' make %makeflags -C test all %{?_smp_mflags} DIET=$(echo `pwd`/bin-*/diet) -k || : make %makeflags -C test/inet all %{?_smp_mflags} DIET=$(echo `pwd`/bin-*/diet) || : cd test ulimit -m $[ 128*1024 ] -v $[ 256*1024 ] -d $[ 128*1024 ] bash ./runtests-X.sh %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc AUTHOR BUGS CAVEAT CHANGES COPYING FAQ PORTING README* %doc SECURITY THANKS TODO %doc %_mandir/*/* %_bindir/* %files devel %defattr(-,root,root,-) %pkglibdir %{?with_dynamic:%exclude %pkglibdir/*/*.so} %if %{with dynamic} %files lib %defattr(-,root,root,-) %config(noreplace) %_sysconfdir/* %dir %pkglibdir %dir %pkglibdir/lib-* %pkglibdir/lib-%target_cpu/*.so %endif %changelog * Sat Oct 18 2008 Enrico Scholz - 0.31-6.20081017 - updated to 20081017 CVS snapshot - relaxed some sanity checks on architecture not supported by Fedora and use '#warning' instead of '#error' - fixed ARM dynlib code * Wed Jul 16 2008 Tom "spot" Callaway - 0.31-6.20080517 - fix license tag * Sun May 18 2008 Enrico Scholz - 0.31-5.20080517 - updated to 20080517 snapshot - use patches from git repository * Sun May 18 2008 Enrico Scholz - 0.31-5.20080409 - fixed __signalfd() prototype * Sat Apr 19 2008 Enrico Scholz - 0.31-4.20080409 - update -pagesize patch * Mon Apr 14 2008 Enrico Scholz - 0.31-3.20080409 - removed debug stuff from specfile - updated patches to work with new isinf() behavior of gcc 4.3 * Sun Apr 13 2008 Enrico Scholz - 0.31-2.20080409 - added patch for dynamic PAGE_SIZE support - fixed/enhanced testsuite and removed the '|| :' in %%check - improved/fixed floating point support *printf(3) * Thu Apr 10 2008 Enrico Scholz - 0.31-1.20080409 - updated to CVS snapshot 20080409 * Fri Feb 22 2008 Enrico Scholz - 0.31-1.20080221 - updated to CVS snapshot 20080221; removed most of the last patches as they are now in upstream - moved files into platform neutral /usr/lib dir (not using %%_lib or %%_libdir macro) - added -devel subpackage due to multiarch issues; main package contains only the 'diet' binary plus some tools while -devel holds all the header and object files. - fixed optimized memcpy(3) * Wed Feb 13 2008 Enrico Scholz - 0.31-1.20080212 - updated to CVS snapshot 20080212 - fixed printf regression for '%+04i' style formats - added %%check and run a testsuite; it does not succeed now so it is for informational purposes only... - added bunch of patches to fixes big-endian issues in string routines * Sat Sep 1 2007 Enrico Scholz - 0.31-1 - updated to 0.31 - removed the no-stack-protector bits for i386 and x86_64 archs - improved stack-smash code a little bit - disabled dynamic lib for all arches - made objects non-executable to avoid "No build ID note" errors * Wed Jan 17 2007 David Woodhouse 0.30-4 - Bump release to be higher than unexplained 0.30-3.fc6 * Wed Jan 17 2007 David Woodhouse 0.30-3 - Apply workaround for GCC PR26374 to build on PPC again (#182118) * Fri Sep 15 2006 Enrico Scholz - 0.30-2 - rebuilt * Sun Jul 9 2006 Enrico Scholz - 0.30-1 - updated to 0.30 - removed cross-arch support - disable (non-working) SSP support; enable old stackgap code instead of * Sat Feb 18 2006 Enrico Scholz - 0.29-6 - added '-Os' to the CFLAGS - exclude PPC arch due to strange compilation errors * Sun Oct 30 2005 Enrico Scholz - 0.29-4 - added '-fno-stack-protector' to the CFLAGS * Sun Oct 30 2005 Enrico Scholz - 0.29-3 - removed '-fstack-protector' from CLI because it uses __stack_chk_fail which is not provided by dietlibc * Thu May 26 2005 Enrico Scholz - 0.29-2 - rebuilt * Tue May 24 2005 Enrico Scholz - 0.29-1 - updated to 0.29 - unset some compiler options which cause errors with gcc4 - rediffed -scall patch - removed most patches as already in upstream * Thu May 19 2005 Enrico Scholz - 0.28-6 - use %%dist instead of %%disttag - package some more %%doc files (reported by Chris Ricker) - add %%release to the BuildRoot (reported by Chris Ricker) - fixed URLs of the sources (reported by Chris Ricker) * Sun May 1 2005 Enrico Scholz - 0.28-5 - added Herbert Poetzl's syscall(2) implementation for x86_64 and sparc* architectures (see http://vserver.13thfloor.at/Experimental/delta-diet.diff); rediffed the .call patch - catch the case when syscall(2) is used on archs where it is not implemented yet - define MADV_* constants on HPPA and IA64 archs - fix *truncate64() handling on 64bit archs * Fri Mar 4 2005 Enrico Scholz - 0.28-4 - rebuild - fixed compilation with gcc4 - made nice(2) SUSv3 compliantly on x86_64 and other platforms (patch provided by Colin Hill) - build the dynamic libs for x86, x86_64 and arm only - fixed PPC issues in ISO mode (do not use the 'powerpc' macro but the '__powerpc__' one) - added some O_* -flags for the HPPA arch - use more modern flags for '-Os' * Tue Feb 1 2005 Enrico Scholz - 1:0.28-1 - updated to 0.28 - unset LD_RUN_PATH which would result in empty rpaths else - removed the waitpid patch; it is solved upstream * Tue Aug 17 2004 Enrico Scholz - 1:0.27-1 - updated to 0.27 * Fri Jun 11 2004 Enrico Scholz - 1:0.26-1 - updated to 0.26 * Fri Apr 9 2004 Enrico Scholz - 1:0.25-1 - updated to 0.25 * Sat Jan 17 2004 Enrico Scholz - 1:%VERSION.90.%DATE}-5 - renewed -snprintf patch * Tue Jan 6 2004 Enrico Scholz - 1:%VERSION.90.%DATE}-4 - applied -snprintf patch (from fedora dietlibc-0.24-2 package) * Tue Dec 30 2003 Enrico Scholz - 1:%VERSION.90.%DATE}-2 - added C99 patch * Thu Dec 4 2003 Enrico Scholz - 1:0.24-1 - updated to 0.24 * Tue Sep 16 2003 Enrico Scholz - 1:0.23-1 - updated to 0.23 * Fri Nov 8 2002 Enrico Scholz 1:0.21-1 - updated to 0.21 - removed unpackaged files in %%install-stage * Thu Jul 11 2002 Enrico Scholz 1:0.18-1 - updated to 0.18 * Thu Jul 4 2002 Enrico Scholz - Initial build.