dietlibc/dietlibc.spec

286 lines
9.2 KiB
RPMSpec

## $Id: dietlibc.spec,v 1.3 2005/02/01 12:03:17 ensc Exp $
## 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 20080212
%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 1%{?snapshot:.%snapshot}
License: GPL
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
Patch34: dietlibc-0.31.20080212-printffmt.patch
Patch40: dietlibc-0.31-printftest.patch
Patch41: dietlibc-0.31.20080212-teststdout.patch
Patch42: dietlibc-0.31.20080212-strlen.patch
Patch43: dietlibc-0.31.20080212-ulong.patch
Patch44: dietlibc-0.31.20080212-strend.patch
BuildRoot: %_tmppath/%name-%version-%release-buildroot
%{?with_dynamic:Requires: dietlibc-lib = %version-%release}
%{!?with_dynamic:Obsoletes: dietlibc-lib < %version-%release}
#### HACK!!
BuildRequires: strace gdb
%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 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
%patch34 -p1 -b .printffmt
%patch40 -p1 -b .printftest
%patch41 -p1 -b .teststdout
%patch42 -p1 -b .strlen
%patch43 -p1 -b .ulong
%patch44 -p1 -b .strend
%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
sed -i -e 's!strip !: !g' Makefile
%global fixcflags -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables %xtra_fixcflags -Os -g3
%global basemakeflags prefix=%_libdir/dietlibc BINDIR=%_bindir MAN1DIR=%_mandir/man1 COMMENT=: CFLAGS="$RPM_OPT_FLAGS %fixcflags $XTRA_CFLAGS" PDIET=%_libdir/dietlibc
%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}%_libdir/dietlibc/lib-%_arch-%_vendor
chmod a-x $RPM_BUILD_ROOT%_libdir/dietlibc/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 $[ 50*1024 ] -v $[ 100*1024 ] -d $[ 50*1024 ]
bash ./runtests-X.sh || :
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{?with_dynamic:%exclude %_libdir/dietlibc/*/*.so}
%doc AUTHOR BUGS CAVEAT CHANGES COPYING FAQ PORTING README*
%doc SECURITY THANKS TODO
%doc %_mandir/*/*
%_bindir/*
%_libdir/dietlibc
%if %{with dynamic}
%files lib
%defattr(-,root,root,-)
%config(noreplace) %_sysconfdir/*
%dir %_libdir/dietlibc
%dir %_libdir/dietlibc/lib-*
%_libdir/dietlibc/lib-%target_cpu/*.so
%endif
%changelog
* Wed Feb 13 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 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 <enrico.scholz@informatik.tu-chemnitz.de> - 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 <dwmw2@infradead.org> 0.30-4
- Bump release to be higher than unexplained 0.30-3.fc6
* Wed Jan 17 2007 David Woodhouse <dwmw2@infradead.org> 0.30-3
- Apply workaround for GCC PR26374 to build on PPC again (#182118)
* Fri Sep 15 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30-2
- rebuilt
* Sun Jul 9 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 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 <enrico.scholz@informatik.tu-chemnitz.de> - 0.29-6
- added '-Os' to the CFLAGS
- exclude PPC arch due to strange compilation errors
* Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.29-4
- added '-fno-stack-protector' to the CFLAGS
* Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 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 <enrico.scholz@informatik.tu-chemnitz.de> - 0.29-2
- rebuilt
* Tue May 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 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 <enrico.scholz@informatik.tu-chemnitz.de> - 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 <enrico.scholz@informatik.tu-chemnitz.de> - 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 <enrico.scholz@informatik.tu-chemnitz.de> - 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 <enrico.scholz@informatik.tu-chemnitz.de> - 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 <enrico.scholz@informatik.tu-chemnitz.de> - 1:0.27-1
- updated to 0.27
* Fri Jun 11 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:0.26-1
- updated to 0.26
* Fri Apr 9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:0.25-1
- updated to 0.25
* Sat Jan 17 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:%VERSION.90.%DATE}-5
- renewed -snprintf patch
* Tue Jan 6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:%VERSION.90.%DATE}-4
- applied -snprintf patch (from fedora dietlibc-0.24-2 package)
* Tue Dec 30 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:%VERSION.90.%DATE}-2
- added C99 patch
* Thu Dec 4 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:0.24-1
- updated to 0.24
* Tue Sep 16 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1:0.23-1
- updated to 0.23
* Fri Nov 8 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 1:0.21-1
- updated to 0.21
- removed unpackaged files in %%install-stage
* Thu Jul 11 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 1:0.18-1
- updated to 0.18
* Thu Jul 4 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
- Initial build.