## $Id: dietlibc.spec,v 1.3 2005/02/01 12:03:17 ensc Exp $ ## This package understands the following switches: ## --with cross ... enable crossbuild ## --define 'crossarch ' ... set cross-architecture (only valid with ## '--with cross'; defaults to 'arm-linux') ## Fedora Extras specific customization below... %global crossarch %{!?crossarch:arm-linux}%{?crossarch} ## %global NAME dietlibc %global do_crossbuild %{?_with_cross:1}%{!?_with_cross:0} %ifarch %ix86 x86_64 arm %global noncross_do_dyn 1 %else %global noncross_do_dyn 0 %endif %ifarch %ix86 %global target_cpu i386 %else %global target_cpu %_target_cpu %endif %global target_cpu %(test "%do_crossbuild" = 1 && echo %crossarch | sed -e 's!-.*!!' || echo %target_cpu) %global do_dyn %(test "%do_crossbuild" = 1 && case "%target_cpu" in (x86_86|arm|i?86) echo 1;; (*) echo 0;; esac || echo %noncross_do_dyn) %if %do_dyn %global with_dyn 1 %endif %{!?release_func:%global release_func() %1%{?dist}} Summary: Small libc implementation Name: %{?_with_cross:cross-%crossarch-}%NAME Version: 0.29 Release: %release_func 6 License: GPL Group: Development/Libraries URL: http://www.fefe.de/dietlibc/ Source0: http://www.kernel.org/pub/linux/libs/dietlibc/%NAME-%version.tar.bz2 Source1: http://www.fefe.de/dietlibc/%NAME-%version.tar.bz2.sig Patch1: dietlibc-0.28-setpriority.patch Patch10: dietlibc-0.29-scall.patch Patch20: dietlibc-0.29-nostackprotector.patch BuildRoot: %_tmppath/%name-%version-%release-buildroot %{?with_dyn:Requires: dietlibc-lib = %version-%release} %if %do_crossbuild BuildRequires: dietlibc Requires: dietlibc = %version-%release %endif # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=182118 ExcludeArch: ppc %package lib Summary: Dynamic libraries for dietlibc Group: System Environment/Libraries %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 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 -n %NAME-%version %patch1 -p1 -b .nice %patch10 -p1 -b .scall %patch20 -p1 -b .nostackprotector %global fixcflags -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-stack-protector -Os %global basemakeflags prefix=%_libdir/dietlibc BINDIR=%_bindir MAN1DIR=%_mandir/man1 COMMENT=: %{!?_with_cross:CFLAGS="$RPM_OPT_FLAGS %fixcflags"} %global makeflags %basemakeflags %{?_with_cross:CROSS=%crossarch- ARCH=%target_cpu} %build %if %do_crossbuild mkdir -p bin-%_arch diet gcc diet.c -DDIETHOME=\"`pwd`\" -DVERSION=\"X\" -o bin-%_arch/diet %endif %__make %makeflags all %{?with_dyn:dyn} %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT %__install -d -m755 $RPM_BUILD_ROOT/etc %__make %makeflags DESTDIR=$RPM_BUILD_ROOT install %if !%do_crossbuild ln -s lib-%_arch ${RPM_BUILD_ROOT}%_libdir/dietlibc/lib-%_arch-%_vendor %endif %if %do_crossbuild rm -rf ${RPM_BUILD_ROOT}%_libdir/dietlibc/include \ ${RPM_BUILD_ROOT}%_mandir %endif %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %{?with_dyn:%exclude %_libdir/dietlibc/*/*.so} %if %do_crossbuild %_libdir/dietlibc/lib-* %else %doc AUTHOR BUGS CAVEAT CHANGES COPYING FAQ PORTING README* %doc SECURITY THANKS TODO %doc %_mandir/*/* %_bindir/* %_libdir/dietlibc %endif %if %do_dyn %files lib %defattr(-,root,root,-) %config(noreplace) %_sysconfdir/* %dir %_libdir/dietlibc %dir %_libdir/dietlibc/lib-* %_libdir/dietlibc/lib-%target_cpu/*.so %endif %changelog * 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.