LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File dietlibc.spec of Package dietlibc (Project devel:libraries:c_c++)

# spec file for package dietlibc
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/

ExcludeArch:    %arm ppc64le

Name:           dietlibc
Provides:       diet
Version:        0.31
Release:        0
Source0:        http://www.fefe.de/dietlibc/%{name}-%{version}.tar.bz2
Source1:        http://www.fefe.de/dietlibc/%{name}-%{version}.tar.bz2.sig
# See README.maintainers to understand next four source files
Source9:        README.maintainers
Source10:       dietlibc-0.32.tar.bz2
Source11:       dietlibc-0.32.tar.bz2.sig
Source12:       %{name}.keyring
Source23:       %{name}-0.30-setjmp-longjmpg.diff
Patch:          %{name}-0.31-tls.diff
Patch1:         %{name}-0.30-tcsetattr.diff
Patch6:         long-double-workaround.diff
Patch7:         %{name}-0.30-features.diff
Patch31:        %{name}-0.30-ppc-syscall.diff
Patch32:        %{name}-0.30-pause.diff
Patch33:        parisc-clone.S-fix-build-failure-on-hppa.diff
Patch34:        fix-arm-regex-in-makefile.diff
Patch35:        dietlibc-ppc.patch
BuildRequires:  gpg-offline
Url:            http://www.fefe.de/dietlibc/
Summary:        A Libc Optimized for Small Size
License:        GPL-2.0+
Group:          Development/Languages/C and C++
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Diet libc is optimized for small size. It can be used to create small
statically-linked binaries for Linux on many platforms.

%define prefix   /opt/dietlibc

%gpg_verify %{S:11}
%setup -q
%patch33 -p1
%patch35 -p1

MY_RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's,-O2,-Os,' \
   -e 's/-D_FORTIFY_SOURCE[=0-9]*//' \
   -e 's/-ffortify[=0-9]*//' \
# Makefile relies on `uname -m` to determine bitness (bad),
# so need extra args to rectify.
make %{?_smp_mflags} \
%ifarch sparc sparcv9
	MYARCH=sparc ARCH=sparc \
	prefix=%{prefix} CFLAGS="$CFLAGS $MY_RPM_OPT_FLAGS -fno-strict-aliasing"

%ifarch hppa
export RPM_ARCH=parisc
%ifarch %arm
export RPM_ARCH=arm
%ifarch sparc sparcv9
export RPM_ARCH=sparc
mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{prefix}/{bin-$RPM_ARCH,lib-$RPM_ARCH},%{_mandir}/man1}
cd bin-$RPM_ARCH
mv -f dietlibc.a libc.a
mv -f diet-i diet
install -m644 start.o lib*.a $RPM_BUILD_ROOT/%{prefix}/lib-$RPM_ARCH
install -m755 diet elftrunc $RPM_BUILD_ROOT/%{prefix}/bin-$RPM_ARCH
install -m644 ../diet.1 $RPM_BUILD_ROOT/%{_mandir}/man1
cp -a ../include $RPM_BUILD_ROOT/%{prefix}
ln -sfv lib-$RPM_ARCH $RPM_BUILD_ROOT/%{prefix}/lib
ln -sfv bin-$RPM_ARCH $RPM_BUILD_ROOT/%{prefix}/bin
ln -sfv %{prefix}/bin-$RPM_ARCH/{diet,elftrunc} $RPM_BUILD_ROOT%{_bindir}

%defattr(-, root, root)
%doc %{_mandir}/man?/*