Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 741d673bcb95c5664e7c2a84750d540a > files > 141

glibc-2.22-26.mga6.src.rpm

# RH 2.2.4-20, SuSE 2.3.1-32

# <epoch>:<version>-<release> tags for glibc main package
%define glibcversion	2.22
%define __glibcrelease	26
%define glibcepoch	6

# CVS snapshots of glibc
%define RELEASE		1
%if %{RELEASE}
%define source_package	glibc-%{glibcversion}
%define source_dir	glibc-%{glibcversion}
%define _glibcrelease	%{__glibcrelease}
%else
%define snapshot	20081113
%define source_package	glibc-%{glibcversion}-%{snapshot}
%define source_dir	glibc-%{glibcversion}
%define _glibcrelease	0.%{snapshot}.%{__glibcrelease}
%endif

%define glibcrelease	%mkrel %{_glibcrelease}

# crypt blowfish support
%define crypt_bf_ver	1.3

# Define "cross" to an architecture to which glibc is to be
# cross-compiled
%define build_cross		0
%{expand: %{?cross:		%%global build_cross 1}}

%if %{build_cross}
%define target_cpu	%{cross}
%define cross_prefix	cross-%{target_cpu}-
%define _prefix		/usr/%{target_cpu}-%{_real_vendor}-linux%{gnuext}
%define cross_program_prefix	%{target_cpu}-%{_real_vendor}-linux%{gnuext}-
%define _exec_prefix	%{_prefix}
# brain damage alert: should not be needed imho
# overriding _prefix and _exec_prefix should be enough
%define _bindir		%{_exec_prefix}/bin
%define _sbindir	%{_exec_prefix}/sbin
%define _libexecdir	%{_exec_prefix}/libexec
%define _datadir	%{_prefix}/share
%define _sharedstatedir	%{_prefix}/com
%define _localstatedir	%{_prefix}/var
%define _lib		lib
%define _libdir		%{_exec_prefix}/%{_lib}
%define _slibdir	%{_exec_prefix}/%{_lib}
%define _slibdir32	%{_exec_prefix}/lib
%define _includedir	%{_prefix}/include
%else
%define gnuext		%{_gnu}
%define target_cpu	%{_target_cpu}
%define cross_prefix	%{nil}
%define cross_program_prefix	%{nil}
%define _slibdir	/%{_lib}
%define _slibdir32	/lib
%endif

# Define target (base) architecture
%define arch		%(echo %{target_cpu}|sed -e "s/\\(i.86\\|athlon\\)/i386/" -e "s/amd64/x86_64/")
%define isarch()	%(case " %* " in (*" %{arch} "*) echo 1;; (*) echo 0;; esac)

%if %{build_cross}
%if %isarch %arm
%define gnuext          -gnueabi
%else
%define gnuext          -gnu
%endif
%endif

# Define Xen arches to build with -mno-tls-direct-direct-seg-refs
%define xenarches	%{ix86} x86_64

# arches which requires glibc-port
%define ports_arch	%arm %mips

# Define to build nscd with selinux support
%define build_selinux	0

# Flag for build_pdf_doc:
# 1	build glibc with PDF documentation
# 0	don't build PDF glibc documentation (e.g. for bootstrap build)
%define build_pdf_doc	0

# Enable checking by default for arches where we know tests all pass
%define build_check	0

# Allow make check to fail only when running kernels where we know
# tests must pass (no missing features or bugs in the kernel)
%define check_min_kver 2.6.32

# Define to build a biarch package
%define build_biarch	0
%if %isarch x86_64 mips64 mips64el
%define build_biarch	1
%endif

# Define to build glibc-debug package
%define build_debug	1
%define _enable_debug_packages 1
%if "%{_enable_debug_packages}" == "1"
%define build_debug	0
%endif

# Define to bootstrap new glibc
%define build_bootstrap	0
%{expand: %{!?build_cross_bootstrap: %global build_cross_bootstrap 0}}

%define build_profile	1
%define build_nscd	1
%define build_doc	1
%define build_utils	1
%define build_i18ndata	1
%define build_timezone	0

# Disable a few defaults when cross-compiling a glibc
%if %{build_cross}
%define build_doc	0
%define build_pdf_doc	0
%define build_biarch	0
%define build_check	0
%define build_debug	0
%define build_nscd	0
%define build_profile	0
%define build_utils	0
%define build_i18ndata	0
%define build_timezone	0
%endif

# Allow --with[out] <feature> at rpm command line build
%{expand: %{?_without_PDF:	%%global build_pdf_doc 0}}
%{expand: %{?_without_CHECK:	%%global build_check 0}}
%{expand: %{?_without_UTILS:	%%global build_utils 0}}
%{expand: %{?_without_BOOTSTRAP:%%global build_bootstrap 0}}
%{expand: %{?_with_PDF:		%%global build_pdf_doc 1}}
%{expand: %{?_with_CHECK:	%%global build_check 1}}
%{expand: %{?_with_UTILS:	%%global build_utils 1}}
%{expand: %{?_with_BOOTSTRAP:	%%global build_bootstrap 1}}

Summary:	The GNU libc libraries
Name:		%{cross_prefix}glibc
Version:	%{glibcversion}
Release:	%{glibcrelease}
Epoch:		%{glibcepoch}
License:	LGPL
Group:		System/Libraries
Url:		http://www.gnu.org/software/libc/

# FSF source
Source0:	http://ftp.gnu.org/gnu/glibc/%{source_package}.tar.xz
Source1:	http://ftp.gnu.org/gnu/glibc/%{source_package}.tar.xz.sig
Source2:	libc-lock.h

Source4:	glibc-find-requires.sh
Source5:	glibc-check.sh
Source6:	nscd.service
Source7:	nscd.socket
Source8:	nsswitch.conf
Source9:	nscd.conf

# wrapper to avoid rpm circular dependencies
Source14:	glibc-post-wrapper.c

# Blowfish support
Source16:	http://www.openwall.com/crypt/crypt_blowfish-%{crypt_bf_ver}.tar.gz
Source17:	http://www.openwall.com/crypt/crypt_blowfish-%{crypt_bf_ver}.tar.gz.sign
Source18:	http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/glibc/crypt_freesec.c
Source19:	http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/glibc/crypt_freesec.h

%if %{build_cross}
Autoreq:	false
Autoprov:	false
%else
Provides:	glibc-crypt_blowfish = %{crypt_bf_ver}
Provides:	should-restart = system
%if %isarch %{xenarches}
Obsoletes:	%{name}-xen
Provides:	%{name}-xen
%endif
# The dynamic linker supports DT_GNU_HASH
Provides: rtld(GNU_HASH)
Autoreq:	false
%endif
BuildRequires:	patch
BuildRequires:	gettext
BuildRequires:	perl
BuildRequires:	kernel-userspace-headers
BuildRequires:	libstdc++-static-devel
BuildRequires:	hardlink
%if %{build_selinux}
BuildRequires:	pkgconfig(libselinux) >= 1.17.10
%endif
# (tmb) force latest binutils
BuildRequires:	%{cross_prefix}binutils >= 1:2.25.1
# we need the static dash
%define ash_bin		/usr/bin/dash.static
Requires(post):		dash-static
Requires(post):		grep
Requires:		filesystem >= 2.1.9-18
# (tmb) force new gcc-5.4.0-2
BuildRequires:	%{cross_prefix}gcc >= 5.4.0-2
%if !%{build_cross}
%ifarch mips mipsel
Provides:	ld.so.1
%endif
%endif

# Old prelink versions brakes the system with glibc 2.11
Conflicts:	prelink < 1:0.4.2-1.20091104.1

BuildRequires:	texinfo
BuildRequires:	texinfo-tex
%if %{build_pdf_doc}
BuildRequires:	texlive
%endif
%if %{build_utils}
BuildRequires:	pkgconfig(gdlib)
%endif
BuildRequires:	autoconf2.5
BuildRequires:	pkgconfig(libcap)
BuildRequires:	rpm-mageia-setup-build >= 1.147
BuildRequires:	spec-helper >= 0.31.2

# make "localedef --add-to-archive" to follow symlink
# safe to send ustream, need to be kept for locales
Patch00:	glibc-2.11.1-localedef-archive-follow-symlinks.patch

# various path fix, according to usrmove
Patch01:	glibc-2.17-fhs-usrmove.patch
Patch02:	glibc-2.9-ldd-non-exec.patch
# try to fallback on loading /lib/libnss_*.so.X.Y when the loading 
# of /lib/libnss_*.so.X failed. Should be dropped, IMHO.
# (tmb) disable as obsolete
#Patch04:	glibc-2.17-nss-upgrade.patch

Patch06:	glibc-2.20-share-locale.patch
# use xvt instead of xterm in xtrace.sh
# cannot be pushed upstream as xvt is Ma* specific 
Patch09:	glibc-2.2.4-xterm-xvt.patch

# add transliteration for "COLON SIGN"
# ( used for the money of money of san salvador )
Patch11:	glibc-2.19-compat-EUR-currencies.patch

# fix the chkconfig header, should be sent upstream
Patch13:	glibc-2.3.3-nscd-enable.patch

# disable cache for hosts on nscd, as this is seen as insecure
# if the system relie on reverse dns for security
Patch14:	glibc-2.9-nscd-no-host-cache.patch

Patch17:	glibc-2.18-i386-hwcapinfo.patch

# add some new timezone for various cities
# Halifax, Montreal, Johannesburg 
# should be sent upstream ( I guess )
Patch23:	glibc-2.3.4-timezone.patch
Patch24:	glibc-2.10.1-biarch-cpp-defines.patch
Patch26:	glibc-2.22-nice_fix.patch

# fix a typo, safe to send upstream
Patch27:	glibc-2.20-ENOTTY-fr-translation.patch
Patch29:	glibc-2.3.5-biarch-utils.patch

# remove multiarch header, Ma* specific patch
# check if still needed or if the work was finished
Patch30:	glibc-2.22-multiarch.patch
Patch31:	glibc-2.20-i586-hptiming.patch

# do not use i686 optimised library if the processor do not support
# cmov ( some i686 cpu don't, from VIA iirc )
# shuld be sent upstream, IMHO
Patch32:	glibc-2.3.4-i586-if-no-cmov.patch

# translation fixes, need to be checked with some i18n team member
# should be safe to send upstream once checked
Patch33:	glibc-2.22-pt_BR-i18nfixes.patch
Patch35:	glibc-2.16.0-force-gb18030-for-zh_CN.patch

# disable parallel testsuite of rt on powerpc with SMT
Patch38:	glibc-2.18-testsuite-rt-notparallel.patch
# freesec crypt
Patch39:	glibc-2.17-mga-owl-crypt_freesec.patch
Patch40:	glibc-2.14.1-avx-relocate_fcrypt.patch
Patch41:	glibc-2.14.1-avx-increase_BF_FRAME.patch
Patch42:	glibc-2.22-mga-avx-owl-crypt.patch

# add support for sha256 and sha512 in crypt
# likely coming from owl
Patch43:	glibc-2.16.0-mga-wrapper_handle_sha.patch
Patch45:	glibc-2.22-owl-crypt-fixes.patch
Patch46:	glibc-2.22-crypt_freesec-fixes.patch
Patch50:	crypt_blowfish_arm.patch

# check for libcap, even if selinux is disabled
# should be sent upstream
Patch44:	glibc-2.19-dont-tie-libcap-with-selinux.patch

# fixes from upstream 2.22 branch
Patch101:	101-Correct-comments-about-the-history-of-regexp.h.patch
Patch102:	102-hppa-_dl_symbol_address-add-missing-hidden-def.patch
Patch103:	103-microblaze-include-unix-sysdep.h.patch
Patch104:	104-hppa-Fix-reload-error-with-atomic-code-BZ-18787.patch
Patch105:	105-Readd-O_LARGEFILE-flag-for-openat64-bug-18781.patch
Patch106:	106-Clear-DF_1_NODELETE-flag-only-for-failed-to-load-lib.patch
Patch107:	107-BZ-18796.patch
Patch108:	108-NaCl-Call-__nacl_main-in-preference-to-main.patch
Patch109:	109-getmntent-fix-memory-corruption-w-blank-lines-BZ-188.patch
Patch110:	110-Fix-non-v9-32-bit-sparc-build.patch
Patch111:	111-BZ-18921-Fix-opendir-inverted-o_directory_works-test.patch
Patch112:	112-BZ-18921-Mark-fixed-in-NEWS.patch
Patch113:	113-NaCl-Do-not-install-sys-mtio.h.patch
Patch114:	114-Use-HOST_NAME_MAX-for-MAXHOSTNAMELEN-in-sys-param.h.patch
Patch115:	115-strcoll-Remove-incorrect-STRDIFF-based-optimization-.patch
Patch116:	116-Let-make-check-subdirs-string-succeed-even-when-it-s.patch
Patch117:	117-strcoll-Add-bug-strcoll2-to-testsuite-Bug-18589.patch
Patch118:	118-Fix-typo-in-bug-strcoll2-Bug-18589.patch
Patch119:	119-Always-enable-pointer-guard-BZ-18928.patch
Patch120:	120-Harden-tls_dtor_list-with-pointer-mangling-BZ-19018.patch
Patch121:	121-PowerPC-Fix-a-race-condition-when-eliding-a-lock.patch
Patch122:	122-Keep-only-ELF_RTYPE_CLASS_-PLT-COPY-bits-for-prelink.patch
Patch123:	123-Add-a-test-for-prelink-output.patch
Patch124:	124-NaCl-Use-open_resource-API-for-shared-objects.patch
Patch125:	125-Run-tst-prelink-test-for-GLOB_DAT-reloc.patch
Patch126:	126-NaCl-Use-allocate_code_data-after-dyncode_create.patch
Patch127:	127-Better-workaround-for-aliases-of-_finite-symbols-in-.patch
Patch128:	128-Corrected-path-to-installed-libmvec_nonshared.a.patch
Patch129:	129-powerpc-Fix-usage-of-elision-transient-failure-adapt.patch
Patch130:	130-alpha-hppa-fix-libc.abilist-sorting-wrt-fmemopen.patch
Patch131:	131-Fix-BZ-17905.patch
Patch132:	132-Fix-trailing-space.patch
Patch133:	133-Fix-BZ-18985-out-of-range-data-to-strftime-causes-a-.patch
Patch134:	134-hppa-Fix-miscompilation-of-sched_setaffinity-BZ-1848.patch
Patch135:	135-hppa-start.S-rework-references-to-fix-PIE-TEXTRELs-B.patch
Patch136:	136-Gracefully-handle-incompatible-locale-data.patch
Patch137:	137-Handle-overflow-in-__hcreate_r.patch
Patch138:	138-Improve-check-against-integer-wraparound-in-hcreate_.patch
Patch139:	139-hsearch_r-Apply-VM-size-limit-in-test-case.patch
# CVE-2015-7547
Patch140:	140-CVE-2015-7547-getaddrinfo-stack-based-buffer-overflo.patch
Patch141:	141-powerpc-Enforce-compiler-barriers-on-hardware-transa.patch
Patch142:	142-powerpc-Fix-macro-usage-of-htm-builtins.patch
Patch143:	143-Regenerate-Alpha-ULPs.patch
Patch144:	144-S390-Do-not-use-direct-socket-syscalls-if-build-on-k.patch
Patch145:	145-sln-use-stat64.patch
Patch146:	146-Fix-x86_64-fma4-pow-inappropriate-contraction-bug-19.patch
Patch147:	147-Use-PIC-relocation-in-ALIAS_IMPL.patch
# CVE-2016-5417
Patch148:	148-Fix-resource-leak-in-resolver-bug-19257.patch
Patch149:	149-math-don-t-clobber-old-libm.so-on-install-BZ-19822.patch
Patch150:	150-resolv-Always-set-resplen2-out-parameter-in-send_dg-.patch
# CVE-2016-3075
Patch151:	151-CVE-2016-3075-Stack-overflow-in-_nss_dns_getnetbynam.patch
Patch152:	152-NEWS-update-from-previous-commit.patch
Patch153:	153-S390-Add-hwcaps-value-for-vector-facility.patch
Patch154:	154-S390-Add-new-s390-platform.patch
Patch155:	155-S390-configure-check-for-vector-instruction-support-.patch
Patch156:	156-S390-Save-and-restore-fprs-vrs-while-resolving-symbo.patch
Patch157:	157-S390-Extend-structs-La_s390_regs-La_s390_retval-with.patch
Patch158:	158-powerpc-Fix-tabort-usage-in-syscalls.patch
Patch159:	159-configure-fix-test-usage.patch
Patch160:	160-Increase-internal-precision-of-ldbl-128ibm-decimal-p.patch
Patch161:	161-malloc-Prevent-arena-free_list-from-turning-cyclic-B.patch
Patch162:	162-malloc-Fix-attached-thread-reference-count-handling-.patch
Patch163:	163-malloc-Fix-list_lock-arena-lock-deadlock-BZ-19182.patch
Patch164:	164-tst-malloc-thread-exit-Use-fewer-system-resources.patch
Patch165:	165-malloc-Update-comment-for-list_lock.patch
Patch166:	166-glob-Simplify-the-interface-for-the-GLOB_ALTDIRFUNC-.patch
# CVE-2016-1234
Patch167:	167-CVE-2016-1234-glob-Do-not-copy-d_name-field-of-struc.patch
# CVE-2016-3706
Patch168:	168-CVE-2016-3706-getaddrinfo-stack-overflow-in-hostent-.patch
Patch169:	169-hesiod-Remove-RCS-keywords.patch
Patch170:	170-hesiod-Always-use-thread-local-resolver-state-BZ-195.patch
# CVE-2016-4429
Patch171:	171-CVE-2016-4429-sunrpc-Do-not-use-alloca-in-clntudp_ca.patch
Patch172:	172-fork-in-libpthread-cannot-use-IFUNC-resolver-BZ-1986.patch
Patch173:	173-malloc-Preserve-arena-free-list-thread-count-invaria.patch
Patch174:	174-Do-not-override-objects-in-libc.a-in-other-static-li.patch
Patch175:	175-malloc-Avoid-premature-fallback-to-mmap-BZ-20284.patch
# CVE-2016-6323
Patch176:	176-arm-mark-__startcontext-as-.cantunwind-bug-20435.patch
Patch177:	177-Return-proper-status-from-_nss_nis_initgroups_dyn-bu.patch
Patch178:	178-nss_db-Fix-initialization-of-iteration-position-BZ-2.patch
Patch179:	179-nss_db-Propagate-ERANGE-error-if-parse_line-fails-BZ.patch
Patch180:	180-fopencookie-Mangle-function-pointers-stored-on-the-h.patch
Patch181:	181-argp-Do-not-override-GCC-keywords-with-macros-BZ-169.patch
Patch182:	182-nptl-tst-once5-Reduce-time-to-expected-failure.patch
Patch183:	183-Fixed-x86_64-vector-sincos-sincosf-ABI.patch
Patch184:	184-Don-t-compile-do_test-with-mavx-mavx2-mavx512.patch

# fixes from upstream master branch
Patch201:	201-BZ-17250-Fix-static-dlopen-default-library-search-pa.patch
Patch202:	202-grantpt-trust-the-kernel-about-pty-group-and-permiss.patch
Patch203:	203-CVE-2015-5180-resolv-Fix-crash-with-internal-QTYPE-B.patch
Patch204:	204-CVE-2017-8804-xdr_bytes_xdr_string-need-to-free-buffer-on-error.patch
# (P205-P208) CVE-2017-1000366 fixes / mitigations
Patch205:	205-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch
Patch206:	206-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch
Patch207:	207-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch
Patch208:	208-Ignore-and-remove-LD_HWCAP_MASK-for-AT_SECURE-progra.patch
# CVE-2017-12132
Patch209:	209-resolv-Reduce-EDNS-payload-size-to-1200-bytes-BZ-213_CVE-2017-12132.patch
# CVE-2017-12133
Patch210:	210-sunrpc-Avoid-use-after-free-read-access-in-clntudp_c_CVE-2017-12133.patch
Patch211:	211-i386-Hide-__old_glob64-BZ-18822.patch
Patch212:	212-posix-Sync-glob-with-gnulib-BZ-1062.patch
# CVE-2017-1567[01]
Patch213:	213-CVE-2017-15670-glob-Fix-one-byte-overflow-BZ-22320.patch
Patch214:	214-glob-Add-new-test-tst-glob-tilde.patch
Patch215:	215-Update-NEWS-and-ChangeLog-for-CVE-2017-15671.patch
# CVE-2017-15804
Patch216:	216-glob-Fix-buffer-overflow-during-GLOB_TILDE-unescapin.patch
Patch217:	217-posix-tst-glob-tilde.c-Add-test-for-bug-22332.patch
Patch218:	218-Update-NEWS-to-add-CVE-2017-15804-entry.patch

# Determine minium kernel versions
%define		enablekernel 2.6.32
Conflicts:	kernel < %{enablekernel}

# conflict nicrocode that breaks lock elision
Conflicts:	microcode < 0.20140913-2

# People changed location of rpm scripts...
%define rpmscripts	/usr/lib/rpm/%{_real_vendor}

# Don't try to explicitly provide GLIBC_PRIVATE versioned libraries
%define __find_provides	%{_builddir}/%{source_dir}/find_provides.sh
%define __find_requires %{_builddir}/%{source_dir}/find_requires.sh

%if !%{build_cross}
Obsoletes:	ld.so
Provides:	ld.so
%endif

Obsoletes:	ldconfig
Provides:	ldconfig = %{glibcepoch}:%{glibcversion}-%{glibcrelease} /sbin/ldconfig
# obsolete nss_db as it got merged again in 2.15
Obsoletes:	nss_db <= 2.2.3-0.pre1.9

%description
The glibc package contains standard libraries which are used by
multiple programs on the system. In order to save disk space and
memory, as well as to make upgrading easier, common system code is
kept in one place and shared between programs. This particular package
contains the most important sets of shared libraries: the standard C
library and the standard math library. Without these two libraries, a
Linux system will not function.  The glibc package also contains
national language (locale) support.

This package now also provides ldconfig which was package seperately in
the past. Ldconfig is a basic system program which determines run-time
link bindings between ld.so and shared libraries. Ldconfig scans a running
system and sets up the symbolic links that are used to load shared
libraries properly. It also creates a cache (/etc/ld.so.cache) which
speeds the loading of programs which use shared libraries.

%package devel
Summary:	Header and object files for development using standard C libraries
Group:		Development/C
Requires(post):	  info-install
Requires(preun):  info-install
Requires(post):   coreutils
Requires(postun): coreutils, awk
Obsoletes:	libc-debug, libc-headers, libc-devel, linuxthreads-devel, nptl-devel
# (tmb) filter out requires on self-provides
%global __requires_exclude devel\\(libm.*\\)
# (tmb) add virtual provides for old libm to ease builds... from glibc-2.22 libmvec is preferred
%ifarch x86_64
Provides: devel(libm(64bit))
%endif
%if !%{build_debug}
Obsoletes:	%{name}-debug < 6:2.3.2-15
%endif
Requires:	%{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
%if !%{build_cross}
Requires:	linux-userspace-headers
%endif
%if %{build_cross}
Autoreq:	false
Autoprov:	false
%else
Autoreq:	true
%endif
Provides:	glibc-crypt_blowfish-devel = %{crypt_bf_ver}

%description devel
The glibc-devel package contains the header and object files necessary
for developing programs which use the standard C libraries (which are
used by nearly all programs).  If you are developing programs which
will use the standard C libraries, your system needs to have these
standard header and object files available in order to create the
executables.

This package also includes the C header files for the Linux kernel.
The header files define structures and constants that are needed for
building most standard programs. The header files are also needed for
rebuilding the kernel.

Install glibc-devel if you are going to develop programs which will
use the standard C libraries.

%package static-devel
Summary:	Static libraries for GNU C library
Group:		Development/C
Requires:	%{name}-devel = %{glibcepoch}:%{glibcversion}-%{glibcrelease}

%description static-devel
The glibc-static-devel package contains the static libraries necessary
for developing programs which use the standard C libraries. Install
glibc-static-devel if you need to statically link your program or
library.

%package profile
Summary:	The GNU libc libraries, including support for gprof profiling
Group:		Development/C
Obsoletes:	libc-profile
Provides:	libc-profile = %{glibcversion}-%{glibcrelease}
Autoreq:	true

%description profile
The glibc-profile package includes the GNU libc libraries and support
for profiling using the gprof program.  Profiling is analyzing a
program's functions to see how much CPU time they use and determining
which functions are calling other functions during execution.  To use
gprof to profile a program, your program needs to use the GNU libc
libraries included in glibc-profile (instead of the standard GNU libc
libraries included in the glibc package).

If you are going to use the gprof program to profile a program, you'll
need to install the glibc-profile program.

%package -n nscd
Summary:	A Name Service Caching Daemon (nscd)
Group:		System/Servers
Requires(post):  systemd >= %{systemd_required_version}
Requires(post):  rpm-helper >= 0.24.8-1
Requires(preun): rpm-helper >= 0.24.8-1
Autoreq:	true

%description -n nscd
Nscd caches name service lookups and can dramatically improve
performance with NIS+, and may help with DNS as well. Note that you
can't use nscd with 2.0 kernels because of bugs in the kernel-side
thread support. Unfortunately, nscd happens to hit these bugs
particularly hard.

Install nscd if you need a name service lookup caching daemon, and
you're not using a version 2.0 kernel.

%if %{build_debug}
%package	debug
Summary:	Shared standard C libraries with debugging information
Group:		System/Libraries
Requires:	%{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
Autoreq:	false

%description debug
The glibc-debug package contains shared standard C libraries with
debugging information. You need this only if you want to step into C
library routines during debugging.

To use these libraries, you need to add %{_libdir}/debug to your
LD_LIBRARY_PATH variable prior to starting the debugger.
%endif

%package utils
Summary:	Development utilities from GNU C library
Group:		Development/Other
Requires:	%{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}

%description utils
The glibc-utils package contains memusage, a memory usage profiler,
mtrace, a memory leak tracer and xtrace, a function call tracer which
can be helpful during program debugging.

If unsure if you need this, don't install this package.

%if %{build_i18ndata}
%package i18ndata
Summary:	Database sources for 'locale'
Group:		System/Libraries

%description i18ndata
This package contains the data needed to build the locale data files
to use the internationalization features of the GNU libc.
%endif

%if %{build_timezone}
%package -n timezone
Summary:	Time zone descriptions
Group:		System/Base

%description -n timezone
These are configuration files that describe possible
time zones.
%endif

%package doc
Summary:	GNU C library documentation
Group:		Development/Other
BuildArch:	noarch

%description doc
The glibc-doc package contains documentation for the GNU C library in
info format.

%if %{build_pdf_doc}
%package doc-pdf
Summary:	GNU C library documentation
Group:		Development/Other
BuildArch:	noarch

%description doc-pdf
The glibc-doc-pdf package contains the printable documentation for the
GNU C library in PDF format.
%endif

%prep
%setup -q -n %{source_dir} -a 16

# fixes from upstream 2.22 branch
%patch101 -p1 -b .p101
%patch102 -p1 -b .p102
%patch103 -p1 -b .p103
%patch104 -p1 -b .p104
%patch105 -p1 -b .p105
%patch106 -p1 -b .p106
%patch107 -p1 -b .p107
%patch108 -p1 -b .p108
%patch109 -p1 -b .p109
%patch110 -p1 -b .p110
%patch111 -p1 -b .p111
%patch112 -p1 -b .p112
%patch113 -p1 -b .p113
%patch114 -p1 -b .p114
%patch115 -p1 -b .p115
%patch116 -p1 -b .p116
%patch117 -p1 -b .p117
%patch118 -p1 -b .p118
%patch119 -p1 -b .p119
%patch120 -p1 -b .p120
%patch121 -p1 -b .p121
%patch122 -p1 -b .p122
%patch123 -p1 -b .p123
%patch124 -p1 -b .p124
%patch125 -p1 -b .p125
%patch126 -p1 -b .p126
%patch127 -p1 -b .p127
%patch128 -p1 -b .p128
%patch129 -p1 -b .p129
%patch130 -p1 -b .p130
%patch131 -p1 -b .p131
%patch132 -p1 -b .p132
%patch133 -p1 -b .p133
%patch134 -p1 -b .p134
%patch135 -p1 -b .p135
%patch136 -p1 -b .p136
%patch137 -p1 -b .p137
%patch138 -p1 -b .p138
%patch139 -p1 -b .p139
%patch140 -p1 -b .p140
%patch141 -p1 -b .p141
%patch142 -p1 -b .p142
%patch143 -p1 -b .p143
%patch144 -p1 -b .p144
%patch145 -p1 -b .p145
%patch146 -p1 -b .p146
%patch147 -p1 -b .p147
%patch148 -p1 -b .p148
%patch149 -p1 -b .p149
%patch150 -p1 -b .p150
%patch151 -p1 -b .p151
%patch152 -p1 -b .p152
%patch153 -p1 -b .p153
%patch154 -p1 -b .p154
%patch155 -p1 -b .p155
%patch156 -p1 -b .p156
%patch157 -p1 -b .p157
%patch158 -p1 -b .p158
%patch159 -p1 -b .p159
%patch160 -p1 -b .p160
%patch161 -p1 -b .p161
%patch162 -p1 -b .p162
%patch163 -p1 -b .p163
%patch164 -p1 -b .p164
%patch165 -p1 -b .p165
%patch166 -p1 -b .p166
%patch167 -p1 -b .p167
%patch168 -p1 -b .p168
%patch169 -p1 -b .p169
%patch170 -p1 -b .p170
%patch171 -p1 -b .p171
%patch172 -p1 -b .p172
%patch173 -p1 -b .p173
%patch174 -p1 -b .p174
%patch175 -p1 -b .p175
%patch176 -p1 -b .p176
%patch177 -p1 -b .p177
%patch178 -p1 -b .p178
%patch179 -p1 -b .p179
%patch180 -p1 -b .p180
%patch181 -p1 -b .p181
%patch182 -p1 -b .p182
%patch183 -p1 -b .p183
%patch184 -p1 -b .p184

# fixes from upstream master branch
%patch201 -p1 -b .p201
%patch202 -p1 -b .p202
%patch203 -p1 -b .p203
%patch204 -p1 -b .p204
%patch205 -p1 -b .p205
%patch206 -p1 -b .p206
%patch207 -p1 -b .p207
%patch208 -p1 -b .p208
%patch209 -p1 -b .p209
%patch210 -p1 -b .p210
%patch211 -p1 -b .p211
%patch212 -p1 -b .p212
%patch213 -p1 -b .p213
%patch214 -p1 -b .p214
#patch215 -p1 -b .p215
%patch216 -p1 -b .p216
%patch217 -p1 -b .p217
#patch218 -p1 -b .p218

# other patches
%patch00 -p1 -b .localedef-archive-follow-symlinks
%patch01 -p1 -b .fhs
%patch02 -p1 -b .ldd-non-exec
#patch04 -p1 -b .nss-upgrade
%patch06 -p1 -b .share-locale
%patch09 -p1 -b .xterm-xvt
%patch11 -p1 -b .compat-EUR-currencies
%patch13 -p1 -b .nscd-enable
%patch14 -p1 -b .nscd-no-host-cache
%patch17 -p1 -b .i386-hwcapinfo
%patch23 -p1 -b .timezone
%patch24 -p1 -b .biarch-cpp-defines
%patch26 -p1 -b .nice-fix
%patch27 -p1 -b .ENOTTY-fr-translation
%patch29 -p1 -b .biarch-utils
%patch30 -p1 -b .multiarch-check
%patch31 -p1 -b .i586-hptiming
%patch32 -p1 -b .i586-if-no-cmov
%patch33 -p1 -b .pt_BR-i18nfixes
%patch35 -p1 -b .zh_CN-charset-fixes
%patch38 -p1 -b .testsuite-rt-notparallel
%patch44 -p1 -b .dont-tie-libcap-with-selinux

# copy freesec source
cp %{_sourcedir}/crypt_freesec.[ch] crypt/
echo "Applying crypt_blowfish patch:"
%patch42 -p1 -b .mga-avx-owl-crypt
mv crypt/crypt.h crypt/gnu-crypt.h
cp -a crypt_blowfish-%{crypt_bf_ver}/*.[chS] crypt/

# FreeSec support for extended/new-style/BSDI hashes in crypt(3)
%patch39 -p1 -b .mga-owl-crypt_freesec
%patch40 -p1 -b .avx-relocate_fcrypt
%patch41 -p1 -b .avx-increase_BF_FRAME
# add sha256-crypt and sha512-crypt support to the Openwall wrapper
%patch43 -p1 -b .mga-wrapper_handle_sha
%patch45 -p1 -b .owl-sha-fixes
%patch46 -p1 -b .owl-crypt_freesec-fixes
%patch50 -p1 -b .crypt_arm_asm

%if %{build_selinux}
# XXX kludge to build nscd with selinux support as it added -nostdinc
# so /usr/include/selinux is not found
ln -s %{_includedir}/selinux selinux
%endif

find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \;

# \\(Anssi 03/2008\\) FIXME: use __provides_exclude
cat > find_provides.sh << EOF
#!/bin/sh
%{rpmscripts}/find-provides | grep -v GLIBC_PRIVATE
exit 0
EOF
chmod +x find_provides.sh

cat > find_requires.bootstrap.sh << EOF
/bin/sh %{SOURCE4} %{buildroot} %{_target_cpu} | grep -v "\(GLIBC_PRIVATE\|linux-gate\|linux-vdso\)"
exit 0
EOF
chmod +x find_requires.bootstrap.sh

# XXX: use better way later to avoid LD_LIBRARY_PATH issue
cat %{rpmscripts}/find-requires | sed '/.*LD_LIBRARY_PATH.*/d;' > find_requires
chmod +x find_requires
# \\(Anssi 03/2008\\) FIXME: use __requires_exclude
cat > find_requires.noprivate.sh << EOF
%{_builddir}/%{source_dir}/find_requires %{buildroot} %{_target_cpu} | \
	grep -v GLIBC_PRIVATE
exit 0
EOF
chmod +x find_requires.noprivate.sh

# FIXME: fix system rpm find-requires to use the prefix cross version
%if %{build_bootstrap} || "%{_target_cpu}" != "%{target_cpu}"
ln -s find_requires.bootstrap.sh find_requires.sh
%else
ln -s find_requires.noprivate.sh find_requires.sh
%endif

# Remove patch backups from files we ship in glibc packages
rm -f ChangeLog.[^0-9]*
rm -f localedata/locales/{???_??,??_??}.*
rm -f localedata/locales/[a-z_]*.*

%build
# Prepare test matrix in the next function
CheckList=$PWD/Check.list
rm -f $CheckList
touch $CheckList

#
# CompareKver <kernel version>
# function to compare the desired kernel version with running kernel
# version (package releases not taken into account in comparison). The
# function returns:
# -1 = <kernel version> is lesser than current running kernel
#  0 = <kernel version> is equal to the current running kernel
#  1 = <kernel version> is greater than current running kernel
#
function CompareKver() {
  v1=`echo $1 | sed 's/\.\?$/./'`
  v2=`uname -r | sed 's/[^.0-9].*//' | sed 's/\.\?$/./'`
  n=1
  s=0
  while true; do
    c1=`echo "$v1" | cut -d "." -f $n`
    c2=`echo "$v2" | cut -d "." -f $n`
    if [ -z "$c1" -a -z "$c2" ]; then
      break
    elif [ -z "$c1" ]; then
      s=-1
      break
    elif [ -z "$c2" ]; then
      s=1
      break
    elif [ "$c1" -gt "$c2" ]; then
      s=1
      break
    elif [ "$c2" -gt "$c1" ]; then
      s=-1
      break
    fi
    n=$((n + 1))
  done
  echo $s
}

#
# BuildGlibc <arch> [<extra_configure_options>+]
#
function BuildGlibc() {
  arch="$1"
  shift 1

  # PowerPC CPU add-on
  case $arch in
    cpu-addon,*)
      cpu=` echo "$arch" | sed -n "/.*,\([^,]*\),.*$/s//\1/p"`
      arch=`echo "$arch" | sed -n "/.*,.*,\([^,]*\)$/s//\1/p"`
      ;;
    *)
      cpu=$arch
      ;;
  esac

  # Select optimization flags and compiler to use
  BuildAltArch="no"
  BuildCompFlags=""
  BuildFlags=""
  case $arch in
    i[3456]86 | athlon)
      BuildFlags="-march=$arch -mtune=generic"
      if [[ "`uname -m`" = "x86_64" ]]; then
        BuildAltArch="yes"
        BuildCompFlags="-m32"
      fi
      ;;
    x86_64)
      BuildFlags="-mtune=generic"
      ;;
    mips|mipsel)
      BuildFlags="-march=mips3"
      BuildCompFlags="-march=mips3"
      ;;
    mips32|mips32el)
      BuildFlags="-march=mips3 -mabi=n32"
      BuildCompFlags="-march=mips3 -mabi=n32"
      ;;
    mips64|mips64el)
      BuildFlags="-march=mips3 -mabi=64"
      BuildCompFlags="-march=mips3 -mabi=64"
      ;;
    armv4t*)
      BuildFlags="-march=armv4t"
      BuildCompFlags="-march=armv4t"
      ;;
    armv5t*)
      BuildFlags="-march=armv5t"
      BuildCompFlags="-march=armv5t"
      ;;
    # to check
    armv7h*)
      BuildFlags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16"
      BuildCompFlags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16"
      ;;
  esac

  # Choose multiarch support
  MultiArchFlags=
  case $arch in
    i686 | x86_64)
      MultiArchFlags="--enable-multi-arch"
      ;;
  esac

  # Determine C & C++ compilers
  BuildCC="%{__cc} $BuildCompFlags"
  BuildCXX="%{__cxx} $BuildCompFlags"

  # Are we supposed to cross-compile?
  if [[ "%{target_cpu}" != "%{_target_cpu}" ]]; then
    # Can't use BuildCC anymore with previous changes.
    BuildCC="%{cross_program_prefix}gcc $BuildCompFlags"
    BuildCXX="%{cross_program_prefix}g++ $BuildCompFlags"
    BuildCross="--build=%{_target_platform}"
    export libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes
  fi

  BuildFlags="$BuildFlags -DNDEBUG=1 -O2 -finline-functions -g"

  # Do not use direct references against %gs when accessing tls data
  # XXX make it the default in GCC? (for other non glibc specific usage)
  case $arch in
    i[3456]86 | x86_64)
      BuildFlags="$BuildFlags -mno-tls-direct-seg-refs"
      ;;
  esac

  # Arch specific compilation flags
  if [[ "$arch" = "ppc64" ]]; then
    BuildFlags="$BuildFlags -fno-inline-functions -mno-minimal-toc"
  fi

  # Extra configure flags
  ExtraFlags=
  if [[ "%{build_profile}" != "0" ]]; then
    ExtraFlags="$ExtraFlags --enable-profile"
  fi

  # NPTL+TLS are now the default
  # check for other arches
  %if %isarch %ports_arch
    Pthreads="ports nptl"
  %else
    Pthreads="nptl"
  %endif

  # Add-ons
  AddOns="libidn"
  if [[ "$cpu" != "$arch" ]]; then
    AddOns="$AddOns,powerpc-cpu"
    BuildFlags="$BuildFlags -mcpu=$cpu"
    ExtraFlags="$ExtraFlags --with-cpu=$cpu"
  fi

  # Build with selinux support?
%if %{build_selinux}
  SElinuxFlags="--with-selinux"
%else
  SElinuxFlags="--without-selinux"
%endif

  # Kernel headers directory
  KernelHeaders=%{_includedir}

  # Determine library name
  glibc_cv_cc_64bit_output=no
  if echo ".text" | $BuildCC -c -o test.o -xassembler -; then
    case `/usr/bin/file test.o` in
    *"ELF 64"*)
      glibc_cv_cc_64bit_output=yes
      ;;
    esac
  fi
  rm -f test.o

  # Force a separate and clean object dir
  rm -rf build-$cpu-linux
  mkdir  build-$cpu-linux
  pushd  build-$cpu-linux
  [[ "$BuildAltArch" = "yes" ]] && touch ".alt" || touch ".main"
  CC="$BuildCC" CXX="$BuildCXX" CFLAGS="$BuildFlags -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function" ../configure \
    $arch-%{_real_vendor}-linux%{gnuext} $BuildCross \
    --prefix=%{_prefix} \
    --libexecdir=%{_prefix}/libexec \
    --infodir=%{_infodir} \
    --enable-add-ons="$AddOns" --without-cvs \
    $ExtraFlags $MultiArchFlags $SElinuxFlags \
    --enable-kernel=%{enablekernel} \
    --with-headers=$KernelHeaders ${1+"$@"} \
    --enable-obsolete-rpc
  %make -r -s
  popd

  # All tests are expected to pass on certain platforms, depending also
  # on the version of the kernel running
  case $arch in
  athlon | ia64 | ppc | ppc64)
    if [ "`CompareKver %{check_min_kver}`" -lt 0 ]; then
      check_flags=""
    else
      check_flags="-k"
    fi
    ;;
  *)
    check_flags="-k"
    ;;
  esac

  # Generate test matrix
  [[ -d "build-$arch-linux" ]] || {
    echo "ERROR: PrepareGlibcTest: build-$arch-linux does not exist!"
    return 1
  }
  local BuildJobs="-j`getconf _NPROCESSORS_ONLN`"
  echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList

  case $cpu in
  i686|athlon)	base_arch=i586;;
  power*)	base_arch=$arch;;
  *)		base_arch=none;;
  esac

  [[ -d "build-$base_arch-linux" ]] && {
    check_flags="$check_flags -l build-$base_arch-linux/elf/ld.so"
    echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList
  }
  return 0
}

# Build main glibc
BuildGlibc %{target_cpu}

%if %{build_biarch}
%if %isarch x86_64
BuildGlibc i686
%endif
%endif
%if %isarch mips
BuildGlibc mips64
BuildGlibc mips32
%endif
%if %isarch mipsel
BuildGlibc mips64el
BuildGlibc mips32el
%endif
%if %isarch mips64
BuildGlibc mips
BuildGlibc mips32
%endif
%if %isarch mips64el
BuildGlibc mipsel
BuildGlibc mips32el
%endif

# Build i686 libraries if not already building for i686/athlon
case %{target_cpu} in
  i686 | athlon)
    ;;
  i[3-6]86)
    BuildGlibc i686 --disable-profile
    ;;
esac

make -C crypt_blowfish-%{crypt_bf_ver} man

%if %{build_check}
export TMPDIR=/tmp
export TIMEOUTFACTOR=16
Check="$PWD/glibc-check.sh"
cat %{SOURCE5} > $Check
chmod +x $Check
while read arglist; do
  $Check $arglist || exit 1
done < $CheckList
%endif

%install
# force use of _NPROCESSORS_ONLN jobs since RPM_BUILD_NCPUS could be
# greater for icecream
BuildJobs="-j`getconf _NPROCESSORS_ONLN`"

make install_root=$RPM_BUILD_ROOT install -C build-%{target_cpu}-linux
%if %{build_i18ndata}
(cd build-%{target_cpu}-linux;
  make $BuildJobs -C ../localedata objdir=`pwd` \
	install_root=$RPM_BUILD_ROOT \
	install-locales
)
install -m 0644 localedata/SUPPORTED $RPM_BUILD_ROOT/%{_datadir}/i18n/
%endif

# Empty filelist for non i686/athlon targets
> extralibs.filelist

# Install biarch libraries
%if %{build_biarch} || %isarch mips mipsel
%if %isarch x86_64
ALT_ARCHES=i686-linux
%endif
%if %isarch mips
ALT_ARCHES="mips64-linux mips32-linux"
%endif
%if %isarch mipsel
ALT_ARCHES="mips64el-linux mips32el-linux"
%endif
%if %isarch mips64
ALT_ARCHES="mips-linux mips32-linux"
%endif
%if %isarch mips64el
ALT_ARCHES="mipsel-linux mips32el-linux"
%endif

for ALT_ARCH in $ALT_ARCHES; do
mkdir -p $RPM_BUILD_ROOT/$ALT_ARCH
make install_root=$RPM_BUILD_ROOT/$ALT_ARCH install -C build-$ALT_ARCH

# Dispatch */lib only
case "$ALT_ARCH" in
	mips32*)
		LIB="%{_slibdir}32"
		;;
	mips64*)
		LIB="%{_slibdir}64"
		;;
	*)
		LIB=/lib
		;;
esac
%if !%{build_cross}
mv     $RPM_BUILD_ROOT/$ALT_ARCH/$LIB $RPM_BUILD_ROOT/$LIB
mv     $RPM_BUILD_ROOT/$ALT_ARCH%{_prefix}/libexec/getconf/* \
       $RPM_BUILD_ROOT%{_prefix}/libexec/getconf/
[ ! -d $RPM_BUILD_ROOT/%{_prefix}/$LIB/ ] && mkdir -p $RPM_BUILD_ROOT/%{_prefix}/$LIB/
mv     $RPM_BUILD_ROOT/$ALT_ARCH/%{_prefix}/$LIB/* $RPM_BUILD_ROOT/%{_prefix}/$LIB/
%else
mv     $RPM_BUILD_ROOT/$ALT_ARCH/%{_prefix}/lib $RPM_BUILD_ROOT/$LIB
sed -i $RPM_BUILD_ROOT/$LIB/libc.so -e "s!%{_slibdir}!$LIB!g"
%endif

rm -rf $RPM_BUILD_ROOT/$ALT_ARCH
# XXX Dispatch 32-bit stubs
(sed '/^@/d' include/stubs-prologue.h; LC_ALL=C sort $(find build-$ALT_ARCH -name stubs)) \
> $RPM_BUILD_ROOT%{_includedir}/gnu/stubs-32.h
done
%endif

# Install extra glibc libraries
function InstallGlibc() {
  local BuildDir="$1"
  local SubDir="$2"
  local LibDir="$3"

  case $BuildDir in
  *)      Pthreads=nptl         ;;
  esac

  [[ -z "$LibDir" ]] && LibDir="%{_slibdir}"

  pushd $BuildDir
  mkdir -p $RPM_BUILD_ROOT$LibDir/$SubDir/
  install -m755 libc.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libc-*.so`
  ln -sf `basename $RPM_BUILD_ROOT$LibDir/libc-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libc.so.*`
  install -m755 math/libm.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libm-*.so`
  ln -sf `basename $RPM_BUILD_ROOT$LibDir/libm-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libm.so.*`
  install -m755 $Pthreads/libpthread.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libpthread-*.so`
  ln -sf `basename $RPM_BUILD_ROOT$LibDir/libpthread-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libpthread.so.*`
  install -m755 ${Pthreads}_db/libthread_db.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libthread_db-*.so`
  ln -sf `basename $RPM_BUILD_ROOT$LibDir/libthread_db-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libthread_db.so.*`
  install -m755 rt/librt.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/librt-*.so`
  ln -sf `basename $RPM_BUILD_ROOT$LibDir/librt-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/librt.so.*`
  echo "%dir $LibDir/$SubDir" >> ../extralibs.filelist
  find $RPM_BUILD_ROOT$LibDir/$SubDir -maxdepth 1  -type f -o -type l | sed -e "s|$RPM_BUILD_ROOT||" >> ../extralibs.filelist
  popd
}

# Install arch-specific optimized libraries
%if %isarch %{ix86}
case %{target_cpu} in
i[3-5]86)
  InstallGlibc build-i686-linux i686
  ;;
esac
%endif

# NPTL <bits/stdio-lock.h> is not usable outside of glibc, so include
# the generic one (RH#162634)
install -m644 bits/stdio-lock.h $RPM_BUILD_ROOT%{_includedir}/bits/stdio-lock.h
# And <bits/libc-lock.h> needs sanitizing as well.
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_includedir}/bits/libc-lock.h

# Compatibility hack: this locale has vanished from glibc, but some other
# programs are still using it. Normally we would handle it in the %pre
# section but with glibc that is simply not an option
mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale/ru_RU/LC_MESSAGES

# Remove the files we don't want to distribute
rm -f $RPM_BUILD_ROOT%{_libdir}/libNoVersion*
rm -f $RPM_BUILD_ROOT%{_slibdir}/libNoVersion*

%if "%{name}" == "glibc"
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/nsswitch.conf
%endif

# This is for ncsd - in glibc 2.2
%if %{build_nscd}
install -m 644 nscd/nscd.conf $RPM_BUILD_ROOT%{_sysconfdir}
install -d -m 755 %{buildroot}%{_unitdir}
install -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/nscd.service
install -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/nscd.socket
install -D -m 644 %{SOURCE9} %{buildroot}%{_tmpfilesdir}/nscd.conf
install -d -m 755 %{buildroot}%{_var}/db/nscd
%endif

# These man pages require special attention
mkdir -p %{buildroot}%{_mandir}/man3
install -p -m 0644 crypt_blowfish-%{crypt_bf_ver}/*.3 %{buildroot}%{_mandir}/man3/

# Useless and takes place
rm -rf %buildroot/%{_datadir}/zoneinfo/{posix,right}

# Include ld.so.conf
%if "%{name}" == "glibc"
%if %isarch mips mipsel
# needed to get a ldd which understands o32, n32, 64
install -m 755 $RPM_BUILD_DIR/%{source_dir}/build-mips64el-linux/elf/ldd $RPM_BUILD_ROOT/%{_bindir}/ldd
%endif
echo "include /etc/ld.so.conf.d/*.conf" > $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf
chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf
mkdir -p  $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d

# ldconfig cache
mkdir -p $RPM_BUILD_ROOT%{_var}/cache/ldconfig
touch $RPM_BUILD_ROOT%{_var}/cache/ldconfig/aux-cache

%endif

# Include %{_libdir}/gconv/gconv-modules.cache
> $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache
chmod 644 $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache

%if "%{name}" == "glibc"
touch $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.cache
%endif

# Add libraries to debug sub-package
%if %{build_debug}
mkdir $RPM_BUILD_ROOT%{_libdir}/debug
#cp -a $RPM_BUILD_ROOT%{_libdir}/*.a $RPM_BUILD_ROOT%{_libdir}/debug/
#rm -f $RPM_BUILD_ROOT%{_libdir}/debug/*_p.a
cp -a $RPM_BUILD_ROOT%{_slibdir}/lib*.so* $RPM_BUILD_ROOT%{_libdir}/debug/

pushd $RPM_BUILD_ROOT%{_libdir}/debug
for lib in *.so*; do
  [[ -f "$lib" ]] && DEBUG_LIBS="$DEBUG_LIBS %{_libdir}/debug/$lib"
done
popd
%endif

# Are we cross-compiling?
Strip="strip"
if [[ "%{_target_cpu}" != "%{target_cpu}" ]]; then
  Strip="%{cross_program_prefix}$Strip"
fi

# Strip debugging info from all static libraries
pushd $RPM_BUILD_ROOT%{_slibdir}
for i in *.a; do
  if [ -f "$i" ]; then
    case "$i" in
    *_p.a) ;;
    *) $Strip -g -R .comment $i ;;
    esac
  fi
done
popd

# post install wrapper
%__cc -Os -DSLIBDIR="\"%{_slibdir}\"" -DASH_BIN="\"%{ash_bin}\"" %{SOURCE14} -static \
	-L $RPM_BUILD_ROOT%{_libdir}/ \
	-o $RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper
chmod 700 $RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper

# rquota.x and rquota.h are now provided by quota
rm -f $RPM_BUILD_ROOT%{_includedir}/rpcsvc/rquota.[hx]

# Hardlink identical locale files together
%if %{build_i18ndata}
%{_sbindir}/hardlink -vc $RPM_BUILD_ROOT%{_datadir}/locale
%endif

rm -rf $RPM_BUILD_ROOT%{_includedir}/netatalk/

# Build file list for devel package
find $RPM_BUILD_ROOT%{_includedir} -type f -or -type l > devel.filelist
find $RPM_BUILD_ROOT%{_includedir} -type d  | sed "s/^/%dir /" | \
  grep -v "%{_libdir}/libnss1.*.so$" | \
  grep -v "%{_includedir}$" | >> devel.filelist
find $RPM_BUILD_ROOT%{_libdir} -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
# biarch libs
%if %{build_biarch}
find $RPM_BUILD_ROOT%{_prefix}/lib -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
%endif
%if %isarch mips mipsel
find $RPM_BUILD_ROOT%{_libdir}32 -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
find $RPM_BUILD_ROOT%{_libdir}64 -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
%endif
perl -pi -e "s|$RPM_BUILD_ROOT||" devel.filelist

# /etc/localtime - we're proud of our timezone #Well we may put Paris
%if %{build_timezone}
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime
cp -f $RPM_BUILD_ROOT%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime
#ln -sf ..%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime
%endif

# [gg] build PDF documentation
%if %{build_pdf_doc}
(cd manual; texi2dvi -p -t @afourpaper -t @finalout libc.texinfo)
%endif

# the last bit: more documentation
rm -rf documentation
mkdir documentation
cp timezone/README documentation/README.timezone
cp ChangeLog* documentation
gzip -9 documentation/ChangeLog*
mkdir documentation/crypt_blowfish-%{crypt_bf_ver}
install -m 644 crypt_blowfish-%{crypt_bf_ver}/{README,LINKS,PERFORMANCE} \
	documentation/crypt_blowfish-%{crypt_bf_ver}

# Leave a compatibility symlink for the dynamic loader on armhfp targets,
# at least until the world gets rebuilt
%ifarch armv7hl
ln -sf %{_slibdir}/ld-linux-armhf.so.3 $RPM_BUILD_ROOT%{_slibdir}/ld-linux.so.3
%endif

# Generate final rpm filelist, with localized libc.mo files
rm -f rpm.filelist
%if "%{name}" == "glibc"
%find_lang libc
perl -ne '/^\s*$/ or print' libc.lang > rpm.filelist
%endif
cat extralibs.filelist >> rpm.filelist

# Remove unpackaged files
rm -f  $RPM_BUILD_ROOT%{_infodir}/dir.old*
rm -rf $RPM_BUILD_ROOT%{_includedir}/asm-*/mach-*/
rm -f  $RPM_BUILD_ROOT%{_datadir}/locale/locale-archive*
rm -f  $RPM_BUILD_ROOT%{_var}/db/Makefile

%if !%{build_utils}
%if %{build_biarch}
rm -f  $RPM_BUILD_ROOT%{_slibdir32}/libmemusage.so
rm -f  $RPM_BUILD_ROOT%{_slibdir32}/libpcprofile.so
%endif
%if %isarch mips mipsel
rm -f  $RPM_BUILD_ROOT%{_slibdir}32/libmemusage.so
rm -f  $RPM_BUILD_ROOT%{_slibdir}32/libpcprofile.so
rm -f  $RPM_BUILD_ROOT%{_slibdir}64/libmemusage.so
rm -f  $RPM_BUILD_ROOT%{_slibdir}64/libpcprofile.so
%endif
rm -f  $RPM_BUILD_ROOT%{_slibdir}/libmemusage.so
rm -f  $RPM_BUILD_ROOT%{_slibdir}/libpcprofile.so
rm -f  $RPM_BUILD_ROOT%{_bindir}/memusage
rm -f  $RPM_BUILD_ROOT%{_bindir}/memusagestat
rm -f  $RPM_BUILD_ROOT%{_bindir}/mtrace
rm -f  $RPM_BUILD_ROOT%{_bindir}/pcprofiledump
rm -f  $RPM_BUILD_ROOT%{_bindir}/xtrace
%endif

%if !%{build_timezone}
rm -f  $RPM_BUILD_ROOT%{_sysconfdir}/localtime
rm -f  $RPM_BUILD_ROOT%{_sbindir}/zdump
rm -f  $RPM_BUILD_ROOT%{_sbindir}/zic
rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo
%endif

%if !%{build_i18ndata}
rm -rf $RPM_BUILD_ROOT%{_datadir}/i18n
%endif

%if "%{name}" != "glibc"
rm -rf $RPM_BUILD_ROOT/boot
rm -rf $RPM_BUILD_ROOT/sbin
rm -rf $RPM_BUILD_ROOT/usr/share
rm -rf $RPM_BUILD_ROOT%{_bindir}
rm -rf $RPM_BUILD_ROOT%{_sbindir}
rm -rf $RPM_BUILD_ROOT%{_datadir}
rm -rf $RPM_BUILD_ROOT%{_infodir}
rm -rf $RPM_BUILD_ROOT%{_prefix}/etc
rm -rf $RPM_BUILD_ROOT%{_libdir}/gconv
%endif

# In case we are cross-compiling, don't bother to remake symlinks and
# fool spec-helper when stripping files
%if "%{name}" != "glibc"
export DONT_SYMLINK_LIBS=1
export PATH=%{_bindir}:$PATH
%endif

%if %build_debug
export EXCLUDE_FROM_STRIP="$DEBUG_LIBS"
%endif

# This will make the '-g' argument to be passed to eu-strip for these
# libraries, so that only debug symbols are stripped and gdb/valgrind continue
# to work without needing glibc-debug package to be installed.
export EXCLUDE_FROM_FULL_STRIP="ld-%{glibcversion}.so libpthread libc-%{glibcversion}.so"

%if "%{name}" == "glibc"
%define upgradestamp %{_slibdir}/glibc.upgraded
%define broken_link %{_slibdir}/libnss_nis.so.1 %{_slibdir}/libnss_files.so.1 %{_slibdir}/libnss_dns.so.1 %{_slibdir}/libnss_compat.so.1


%pre -p <lua>
if posix.stat("/usr%{_slibdir}", "type") == 'directory' then
  if not posix.stat("/usr%{_slibdir}/libnss_files-%{glibcversion}.so") then
     io.open("%{upgradestamp}", "w"):close()
  end
end

%post -p %{_sbindir}/glibc-post-wrapper
export LC_ALL=C

if [ "$1" -gt 1 ]; then
  # migrate /etc/ld.so.conf to include the new /etc/ld.so.conf.d/
  # without external commands but for removing the temporary file
  ldso_conf=/etc/ld.so.conf
  while read i; do
    [ "$i" = "include /etc/ld.so.conf.d/*.conf" ] && keep=1
    # Remove previously used include line without absolute path
    [ "$i" = "include ld.so.conf.d/*.conf" ] || echo $i
  done < $ldso_conf > $ldso_conf-
  if [ -z "$keep" ]; then
    echo "include /etc/ld.so.conf.d/*.conf" > $ldso_conf
    while read i; do
      echo $i
    done < $ldso_conf- >> $ldso_conf
  fi
  [ -x /bin/rm ] && /bin/rm -f $ldso_conf-
fi
/sbin/ldconfig

if [ "$1" -gt 1 ]; then
  # On upgrade the services doesn't work because libnss couldn't be
  # loaded anymore.
  if [ -f %{upgradestamp} ]; then
    if /usr/bin/readlink /proc/1/exe >/dev/null && \
       /usr/bin/readlink /proc/1/root >/dev/null; then
       if [ -x /sbin/telinit -a -p /dev/initctl ]; then
         /sbin/telinit u
       fi
       if [ -x /etc/init.d/sshd -a \
            -x /usr/sbin/sshd -a \
            -x /bin/bash ]; then
         /etc/init.d/sshd condrestart
       fi
    fi
  fi
  if [ -f /bin/rm ]; then
    for i in %broken_link; do
      if [ -e $i ] && [ ! -L $i ]; then
        /bin/rm -f $i
      fi
    done
  fi
fi
[ -x /bin/rm ] && /bin/rm -f %{upgradestamp}

# always generate the gconv-modules.cache
%{_sbindir}/iconvconfig -o %{_libdir}/gconv/gconv-modules.cache --nostdlib %{_libdir}/gconv

# automatic ldconfig cache update on rpm installs/removals
# (see http://www.rpm.org/wiki/FileTriggers)
# FIXME: port to lua to remove circular dependency with grep
%transfiletriggerin -p %{ash_bin} -P 2000000 -- /lib/ /lib64/
grep -F '.so.' | ldconfig -X

%transfiletriggerin -p %{ash_bin} -P 2000000 -- /etc/ld.so.conf.d/
ldconfig -X

%endif

%pre devel
if [ -L %{_includedir}/scsi ]; then
  rm -f %{_includedir}/scsi
fi
if [ -L %{_includedir}/sound ]; then
  rm -f %{_includedir}/sound
fi
if [ -L %{_includedir}/linux ]; then
  rm -f %{_includedir}/linux
fi
if [ -L %{_includedir}/asm ]; then
  rm -f %{_includedir}/asm
fi
if [ -L %{_includedir}/asm-generic ]; then
  rm -f %{_includedir}/asm-generic
fi
%if %isarch x86_64
if [ -L %{_includedir}/asm-x86_64 ]; then
  rm -f %{_includedir}/asm-x86_64
fi
if [ -L %{_includedir}/asm-i386 ]; then
  rm -f %{_includedir}/asm-i386
fi
%endif
%if %isarch %mips
if [ -L %{_includedir}/asm-mips ]; then
  rm -f %{_includedir}/asm-mips
fi
%endif
%if %isarch %arm
if [ -L %{_includedir}/asm-arm ]; then
  rm -f %{_includedir}/asm-arm
fi
%endif
exit 0

%if %{build_doc}
%post doc
%_install_info libc.info

%preun doc
%_remove_install_info libc.info
%endif

%if %{build_nscd}
%pre -n nscd
%_pre_useradd nscd / /bin/false

%post -n nscd
%_tmpfilescreate nscd
%_post_service nscd

%preun -n nscd
%_preun_service nscd

%postun -n nscd
%_postun_userdel nscd

if [ "$1" -ge "1" ]; then
  /sbin/service nscd condrestart > /dev/null 2>&1 || :
fi
%endif

%clean
#rm -rf "$RPM_BUILD_ROOT"
#rm -f *.filelist*

#
# glibc
#
%files -f rpm.filelist
%if "%{name}" == "glibc"
%if %{build_timezone}
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/localtime
%endif
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/nsswitch.conf
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ld.so.conf
%dir %{_sysconfdir}/ld.so.conf.d
%config(noreplace) %{_sysconfdir}/rpc
%doc nis/nss
%doc posix/gai.conf
%{_datadir}/locale/locale.alias
/sbin/sln
%dir %{_prefix}/libexec/getconf
%{_prefix}/libexec/getconf/*
%endif
%{_slibdir}/ld-%{glibcversion}.so
%if %isarch i386
%{_slibdir}/ld-linux.so.2
%endif
%if %isarch %arm
%if %isarch armv7hl
%{_slibdir}/ld-linux-armhf.so.3
%endif
%{_slibdir}/ld-linux.so.3
%endif
%if %isarch x86_64
%{_slibdir}/ld-linux-x86-64.so.2
%endif
%if %isarch %mips
%{_slibdir}/ld.so.1
%endif
%{_slibdir}/lib*-[.0-9]*.so
%{_slibdir}/lib*.so.[0-9]*
%{_slibdir}/libSegFault.so
%if "%{name}" == "glibc"
%dir %{_libdir}/audit
%{_libdir}/audit/sotruss-lib.so
%dir %{_libdir}/gconv
%{_libdir}/gconv/*.so
%{_libdir}/gconv/gconv-modules
%ghost %{_libdir}/gconv/gconv-modules.cache
%{_bindir}/catchsegv
%{_bindir}/gencat
%{_bindir}/getconf
%{_bindir}/getent
%{_bindir}/iconv
%{_bindir}/ldd
%if %isarch i386
%{_bindir}/lddlibc4
%endif
%{_bindir}/locale
%{_bindir}/localedef
%{_bindir}/makedb
%{_bindir}/pldd
%{_bindir}/rpcgen
%{_bindir}/sotruss
%{_bindir}/sprof
%{_bindir}/tzselect
%{_sbindir}/iconvconfig
%{_sbindir}/glibc-post-wrapper
%endif

%if %{build_biarch}
%{_slibdir32}/ld-%{glibcversion}.so
%{_slibdir32}/ld-linux*.so.2
%{_slibdir32}/lib*-[.0-9]*.so
%{_slibdir32}/lib*.so.[0-9]*
%{_slibdir32}/libSegFault.so
%dir %{_prefix}/lib/audit
%{_prefix}/lib/audit/sotruss-lib.so
%dir %{_prefix}/lib/gconv
%{_prefix}/lib/gconv/*
%endif
%if %isarch mips mipsel
%{_slibdir}32/ld-%{glibcversion}.so
%{_slibdir}32/ld.so.1
%{_slibdir}32/lib*-[.0-9]*.so
%{_slibdir}32/lib*.so.[0-9]*
%{_slibdir}32/libSegFault.so
%dir %{_libdir}32/gconv
%{_libdir}32/gconv/*
%{_slibdir}64/ld-%{glibcversion}.so
%{_slibdir}64/ld.so.1
%{_slibdir}64/lib*-[.0-9]*.so
%{_slibdir}64/lib*.so.[0-9]*
%{_slibdir}64/libSegFault.so
%dir %{_libdir}64/gconv
%{_libdir}64/gconv/*
%endif

#
# ldconfig
#
%if "%{name}" == "glibc"
/sbin/ldconfig
%ghost %{_sysconfdir}/ld.so.cache
%dir %{_var}/cache/ldconfig
%ghost %{_var}/cache/ldconfig/aux-cache
%endif

#
# glibc-devel
#
%files devel -f devel.filelist
%doc README NEWS INSTALL BUGS PROJECTS CONFORMANCE
%doc COPYING COPYING.LIB
%doc documentation/*
%doc hesiod/README.hesiod
%doc crypt/README.ufc-crypt
%if "%{name}" == "glibc"
%{_mandir}/man3/*
%endif
%{_libdir}/libc_nonshared.a
%{_libdir}/libg.a
%{_libdir}/libieee.a
%{_libdir}/libmcheck.a
%if %isarch x86_64
%{_libdir}/libmvec.a
%{_libdir}/libmvec_nonshared.a
%endif
%{_libdir}/libpthread_nonshared.a
%if "%{name}" == "glibc"
%{_libdir}/librpcsvc.a
%endif

%if %{build_biarch}
%{_prefix}/lib/libc_nonshared.a
%{_prefix}/lib/libg.a
%{_prefix}/lib/libieee.a
%{_prefix}/lib/libmcheck.a
%{_prefix}/lib/libpthread_nonshared.a
%{_prefix}/lib/librpcsvc.a
%endif

%if %isarch mips mipsel
%{_libdir}32/libc_nonshared.a
%{_libdir}32/libg.a
%{_libdir}32/libieee.a
%{_libdir}32/libmcheck.a
%{_libdir}32/libpthread_nonshared.a
%if "%{name}" == "glibc"
%{_libdir}32/librpcsvc.a
%endif
%{_libdir}64/libc_nonshared.a
%{_libdir}64/libg.a
%{_libdir}64/libieee.a
%{_libdir}64/libmcheck.a
%{_libdir}64/libpthread_nonshared.a
%if "%{name}" == "glibc"
%{_libdir}64/librpcsvc.a
%endif
%endif

#
# glibc-static-devel
#
%files static-devel
%doc COPYING COPYING.LIB
%{_libdir}/libBrokenLocale.a
%{_libdir}/libanl.a
%{_libdir}/libc.a
%{_libdir}/libcrypt.a
%{_libdir}/libdl.a
%{_libdir}/libm.a
%{_libdir}/libnsl.a
%{_libdir}/libpthread.a
%{_libdir}/libresolv.a
%{_libdir}/librt.a
%{_libdir}/libutil.a

%if %{build_biarch}
%{_prefix}/lib/libBrokenLocale.a
%{_prefix}/lib/libanl.a
%{_prefix}/lib/libc.a
%{_prefix}/lib/libcrypt.a
%{_prefix}/lib/libdl.a
%{_prefix}/lib/libm.a
%{_prefix}/lib/libnsl.a
%{_prefix}/lib/libpthread.a
%{_prefix}/lib/libresolv.a
%{_prefix}/lib/librt.a
%{_prefix}/lib/libutil.a
%endif

%if %isarch mips mipsel
%{_libdir}32/libBrokenLocale.a
%{_libdir}32/libanl.a
%{_libdir}32/libc.a
%{_libdir}32/libcrypt.a
%{_libdir}32/libdl.a
%{_libdir}32/libm.a
%{_libdir}32/libnsl.a
%{_libdir}32/libpthread.a
%{_libdir}32/libresolv.a
%{_libdir}32/librt.a
%{_libdir}32/libutil.a

%{_libdir}64/libBrokenLocale.a
%{_libdir}64/libanl.a
%{_libdir}64/libc.a
%{_libdir}64/libcrypt.a
%{_libdir}64/libdl.a
%{_libdir}64/libm.a
%{_libdir}64/libnsl.a
%{_libdir}64/libpthread.a
%{_libdir}64/libresolv.a
%{_libdir}64/librt.a
%{_libdir}64/libutil.a
%endif

#
# glibc-doc
#
%if %{build_doc}
%files doc
%{_infodir}/libc.info*
%endif

#
# glibc-doc-pdf
#
%if %{build_pdf_doc}
%files doc-pdf
%doc manual/libc.pdf
%endif

#
# glibc-debug
#
%if %{build_debug}
%files debug
%dir %{_libdir}/debug
%{_libdir}/debug/*.so
%{_libdir}/debug/*.so.*
%if %isarch mips mipsel
%dir %{_libdir}/debug/lib32
%{_libdir}/debug/lib32/*.so
%{_libdir}/debug/lib32/*.so.*
%dir %{_libdir}/debug/lib64
%{_libdir}/debug/lib64/*.so
%{_libdir}/debug/lib64/*.so.*
%endif
%endif

#
# glibc-profile
#
%if %{build_profile}
%files profile
%{_libdir}/lib*_p.a
%if %{build_biarch}
%{_prefix}/lib/lib*_p.a
%endif
%if %isarch mips mipsel
%{_libdir}32/lib*_p.a
%{_libdir}64/lib*_p.a
%endif
%endif

#
# glibc-utils
#
%if %{build_utils}
%files utils
%if %{build_biarch}
%{_slibdir32}/libmemusage.so
%{_slibdir32}/libpcprofile.so
%endif
%{_slibdir}/libmemusage.so
%{_slibdir}/libpcprofile.so
%{_bindir}/memusage
%{_bindir}/memusagestat
%{_bindir}/mtrace
%{_bindir}/pcprofiledump
%{_bindir}/xtrace
%if %isarch mips mipsel
%{_slibdir}32/libmemusage.so
%{_slibdir}32/libpcprofile.so
%{_slibdir}64/libmemusage.so
%{_slibdir}64/libpcprofile.so
%endif
%endif

#
# nscd
#
%if %{build_nscd}
%files -n nscd
%config(noreplace) %{_sysconfdir}/nscd.conf
%{_sbindir}/nscd
%{_unitdir}/nscd.service
%{_unitdir}/nscd.socket
%{_tmpfilesdir}/nscd.conf
%dir %{_var}/db/nscd
%endif

#
# timezone
#
%if %{build_timezone}
%files -n timezone
%{_sbindir}/zdump
%{_sbindir}/zic
%dir %{_datadir}/zoneinfo
%{_datadir}/zoneinfo/*
%endif

#
# glibc-i18ndata
#
%if %{build_i18ndata}
%files i18ndata
%dir %{_datadir}/i18n
%dir %{_datadir}/i18n/charmaps
%{_datadir}/i18n/charmaps/*
%dir %{_datadir}/i18n/locales
%{_datadir}/i18n/locales/*
%{_datadir}/i18n/SUPPORTED
%endif


%changelog
* Sat Dec 16 2017 tmb <tmb> 6:2.22-26.mga6
+ Revision: 1182749
- fix CVE-2017-1213[23], CVE-2017-1567[01], CVE-2017-15804

* Sat Jun 24 2017 tmb <tmb> 6:2.22-25.mga6
+ Revision: 1108315
- sunrpc: xdr_bytes/xdr_string need to free buffer on error [BZ #21461]
  (CVE-2017-8804)
- Ignore LD_LIBRARY_PATH for AT_SECURE=1 programs [BZ #21624]
  (CVE-2017-1000366)
- ld.so: Reject overly long LD_PRELOAD path elements
- ld.so: Reject overly long LD_AUDIT path elements
- Ignore and remove LD_HWCAP_MASK for AT_SECURE programs (bug #21209)

* Tue Apr 25 2017 martinw <martinw> 6:2.22-24.mga6
+ Revision: 1097412
- use /bin/dash.static for glibc file trigger scriplets
  o removes circular dependency with bash (mga#20111)

* Tue Mar 28 2017 tmb <tmb> 6:2.22-23.mga6
+ Revision: 1095015
- rebuild with new gcc

* Sat Mar 25 2017 tmb <tmb> 6:2.22-22.mga6
+ Revision: 1094850
- Do not override objects in libc.a in other static libraries [BZ #20452]
- malloc: Avoid premature fallback to mmap [BZ #20284]
- arm: mark __startcontext as .cantunwind [BZ #20435] (CVE-2016-6323)
- Return proper status from _nss_nis_initgroups_dyn [BZ #20262]
- nss_db: Fix initialization of iteration position [BZ #20237]
- nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]
- fopencookie: Mangle function pointers stored on the heap [BZ #20222]
- argp: Do not override GCC keywords with macros [BZ #16907]
- nptl/tst-once5: Reduce time to expected failure
- Fixed x86_64 vector sincos/sincosf ABI [BZ #20024]
- Don't compile do_test with -mavx/-mavx2/-mavx512 [BZ #20384]
- resolv: Fix crash with internal QTYPE [BZ #18784] (CVE-2015-5180)

* Sat Oct 01 2016 akien <akien> 6:2.22-21.mga6
+ Revision: 1058004
- armv7hl: Add a ld-linux.so.3 compatibility symlink
  o Rationale: https://ml.mageia.org/l/arc/basesystem/2016-10/msg00000.html

* Sat Aug 06 2016 tmb <tmb> 6:2.22-20.mga6
+ Revision: 1044855
- malloc: Preserve arena free list/thread count invariant [BZ #20370]
- add note about CVE-2016-5417 fix

* Thu Jun 02 2016 tmb <tmb> 6:2.22-19.mga6
+ Revision: 1020035
- fork in libpthread cannot use IFUNC resolver [BZ #19861]

* Mon May 30 2016 tmb <tmb> 6:2.22-18.mga6
+ Revision: 1019403
- CVE-2016-4429: sunrpc: Do not use alloca in clntudp_call [BZ#20112]

* Wed May 11 2016 tmb <tmb> 6:2.22-17.mga6
+ Revision: 1013595
- glob: Simplify the interface for the GLOB_ALTDIRFUNC callback gl_readdir
- CVE-2016-1234: glob: Do not copy d_name field of struct dirent [BZ #19779]
  . CVE-2016-3706: getaddrinfo: stack overflow in hostent conversion [BZ #20010]
- hesiod: Remove RCS keywords
- hesiod: Always use thread-local resolver state [BZ #19573]

* Sat Apr 30 2016 tmb <tmb> 6:2.22-16.mga6
+ Revision: 1008243
- Gracefully handle incompatible locale data
- Handle overflow in __hcreate_r
- Improve check against integer wraparound in hcreate_r [BZ #18240]
- hsearch_r: Apply VM size limit in test case
- Fix x86_64 fma4 pow inappropriate contraction [BZ #19003]
- Use PIC relocation in ALIAS_IMPL
- Fix resource leak in resolver [BZ #19257]
- math: don't clobber old libm.so on install [BZ #19822]
- resolv: Always set *resplen2 out parameter in send_dg [BZ #19791]
- CVE-2016-3075: Stack overflow in _nss_dns_getnetbyname_r [BZ #19879]
- Increase internal precision of ldbl-128ibm decimal printf [BZ #19853]
- malloc: Prevent arena free_list from turning cyclic [BZ #19048]
- malloc: Fix attached thread reference count handling [BZ #19243]
- malloc: Fix list_lock/arena lock deadlock [BZ #19182]
- tst-malloc-thread-exit: Use fewer system resources

  + pterjan <pterjan>
    - Update flags and file list for armv7hl

* Thu Feb 18 2016 tmb <tmb> 6:2.22-15.mga6
+ Revision: 967163
- redo/rebase CVE-2015-7547 fix from upstream
- fix CVE-2015-7547 fix to apply properly
- drop P131, it is duplicate of P129
- rebase P130 for glibc 2.20
- move P203 to security fixes as P132
- drop P130, already applied as P119
- really apply patches

* Thu Feb 18 2016 shlomif <shlomif> 6:2.22-14.mga6
+ Revision: 966898
- Apply patches to MGA#17394.
  Taken from the commits of glibc to the 2.22 branch (as mentioned in the
  glibc bugzilla bugs) and one was taken from the Fedora package (thanks!).

* Sun Dec 20 2015 tv <tv> 6:2.22-13.mga6
+ Revision: 912596
- bump filetriggers priority (mga#17217)

* Sat Dec 12 2015 tmb <tmb> 6:2.22-12.mga6
+ Revision: 909747
- grantpt: trust the kernel about pty group and permission mode [BZ #19347]

* Fri Dec 04 2015 tmb <tmb> 6:2.22-11.mga6
+ Revision: 908057
- Corrected path to installed libmvec_nonshared.a

* Sun Nov 29 2015 tmb <tmb> 6:2.22-10.mga6
+ Revision: 907036
- fix filelist
- sync in upstream 2.22 branch fixes
  * Always enable pointer guard [BZ #18928]
  * Harden tls_dtor_list with pointer mangling [BZ #19018]
  * PowerPC: Fix a race condition when eliding a lock
  * Keep only ELF_RTYPE_CLASS_{PLT|COPY} bits for prelink
  * Add a test for prelink output
  * NaCl: Use open_resource API for shared objects
  * Run tst-prelink test for GLOB_DAT reloc
  * NaCl: Use allocate_code_data after dyncode_create
  * Better workaround for aliases of *_finite symbols in vector math library.

  + tv <tv>
    - switch to pkgconfig() BRs

* Thu Oct 22 2015 blino <blino> 6:2.22-9.mga6
+ Revision: 894038
- requires(post) grep for new file trigger

* Mon Oct 12 2015 tmb <tmb> 6:2.22-8.mga6
+ Revision: 889993
- Fix static dlopen default library search path [BZ #17250]
- strcoll: remove incorrect strdiff based optimization [[BZ#18589]
- sync stable patches with upsteam glibc 2.22 maintenance branch

* Thu Sep 17 2015 tmb <tmb> 6:2.22-7.mga6
+ Revision: 880068
- Fix opendir inverted o_directory_works test [BZ#18921]

* Tue Sep 08 2015 blino <blino> 6:2.22-6.mga6
+ Revision: 874242
- fix file location in crypt_blowfish_arm patch

* Sat Sep 05 2015 tv <tv> 6:2.22-5.mga6
+ Revision: 873133
- switch to new upstream file trigger syntax

* Sun Aug 30 2015 tmb <tmb> 6:2.22-4.mga6
+ Revision: 871360
- getmntent: fix memory corruption w/blank lines [BZ #18887]

* Thu Aug 20 2015 tmb <tmb> 6:2.22-3.mga6
+ Revision: 867007
- rebuild with new gcc

* Thu Aug 20 2015 tmb <tmb> 6:2.22-2.mga6
+ Revision: 866654
- rebuild with gcc 5.2.1

* Tue Aug 18 2015 tmb <tmb> 6:2.22-1.mga6
+ Revision: 865404
- glibc-devel: add virtual provides for devel(libm(64bit)) to ease
  rebuilding packages. Beginning with glibc 2.22 the new
  devel(libmvec(64bit)) is the preferred one.

* Mon Aug 17 2015 tmb <tmb> 6:2.22-0.7.mga6
+ Revision: 865346
- Readd O_LARGEFILE flag for openat64 [BZ #18781]
- clear DF_1_NODELETE flag only for failed to load library [BZ #18778]

* Sun Aug 16 2015 tmb <tmb> 6:2.22-0.6.mga6
+ Revision: 865126
- glibc-devel: remove requires on self-provided devel(libm*)

* Sun Aug 16 2015 tmb <tmb> 6:2.22-0.5.mga6
+ Revision: 865056
- fix i586 filelist
- buildfixes for owl sha and fresec crypt
- update filelists
- update crypt_blowfish to 1.3
- update crypt_freesec to 1.8
- rediff P26, P30, P33
- drop obsolete P46
- drop upstream merged patches
- update to 2.22

* Sun Aug 02 2015 tmb <tmb> 6:2.20-22.mga6
+ Revision: 860865
- rebuild with new binutils

* Sat Aug 01 2015 tmb <tmb> 6:2.20-21.mga6
+ Revision: 860200
- testbuild with new binutils

* Sat May 02 2015 tmb <tmb> 6:2.20-20.mga5
+ Revision: 821015
- Do not close NSS files database during iteration [BZ #18007] (CVE-2014-8121)

* Fri May 01 2015 tmb <tmb> 6:2.20-19.mga5
+ Revision: 821001
- resolv/nss_dns/dns-host.c buffer overflow (CVE-2015-1781) [BZ#18287]

* Sun Apr 19 2015 tmb <tmb> 6:2.20-18.mga5
+ Revision: 820468
- nscd needs /var/db/nscd (mga#15545)

* Sat Apr 18 2015 tmb <tmb> 6:2.20-17.mga5
+ Revision: 820464
- Fix _IO_wstr_overflow integer overflow (PR/BZ #17269)
- Fix read past end of pattern in fnmatch (PR/BZ #18032)

* Sat Feb 21 2015 tmb <tmb> 6:2.20-16.mga5
+ Revision: 816252
- sync with upstream glibc-2.20 maintenance branch:
  * Update Russian translation
  * Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266)
  * Update French translation
  * BZ#17460: Fix buffer overrun in nscd --help
  * MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference
  * AArch64: End frame record chain correctly
  * Make __extern_always_inline usable on clang++ again
  * Move findidx nested functions to top-level
  * Fix memory handling in strxfrm_l [BZ #16009] (CVE pending)
  * Use AVX unaligned memcpy only if AVX2 is available

* Sun Feb 08 2015 tmb <tmb> 6:2.20-15.mga5
+ Revision: 814068
- wscanf allocates too little memory (CVE-2015-1472, CVE-2015-1473)

* Sun Dec 21 2014 tmb <tmb> 6:2.20-14.mga5
+ Revision: 804687
- Fix stack overflow in vfprintf [BZ #16617] (CVE-2012-3406)
- Avoid infinite loop in nss_dns getnetbyname [BZ #17630] (CVE-2014-9402)

* Sat Nov 22 2014 tmb <tmb> 6:2.20-12.mga5
+ Revision: 798301
- posix wordexp fails to honour WRDE_NOCMD (CVE-2014-7817)

* Wed Oct 15 2014 tmb <tmb> 6:2.20-11.mga5
+ Revision: 751288
- elf/dl-load.c (open_path): Avoid writing to 'env_path_list'
  when none of the search directories exist. (BZ #15378)
- Fix infinite loop in check_pf (BZ #12926)
- disable lock elision again

* Fri Oct 10 2014 tmb <tmb> 6:2.20-10.mga5
+ Revision: 737970
- re-enable lock elision for now as disabling it triggesrs SIGILL traps

* Fri Oct 10 2014 tmb <tmb> 6:2.20-9.mga5
+ Revision: 737928
- add missing checks on ELIDE_UNLOCK for disabled lock elision (mga#14172)

* Fri Oct 10 2014 tmb <tmb> 6:2.20-8.mga5
+ Revision: 737868
- ensure adaptive elision in rwlocks is disabled (mga#14172)

* Thu Oct 09 2014 tv <tv> 6:2.20-7.mga5
+ Revision: 737764
- convert %%pretrans from dash to lua (one less Requires(pre), one less dep loop)
  (note that previous scriptlet was broken since UsrMove)

* Sun Sep 28 2014 tmb <tmb> 6:2.20-6.mga5
+ Revision: 731421
- disable lock-elision as glibc breaks on intel microcode update

* Thu Sep 25 2014 tmb <tmb> 6:2.20-5.mga5
+ Revision: 724574
- Fix memory leak in libio/wfileops.c do_ftell_wide [BZ #17370]
- Fix memory leak in error path of do_ftell_wide [BZ #17370]

  + tv <tv>
    - autoconvert to new prov/req excludes

* Sat Sep 13 2014 tmb <tmb> 6:2.20-4.mga5
+ Revision: 674978
- fix segfault in getifaddrs_internal [BZ#17371]
- malloc: additional unlink hardening for non-small bins [BZ#17344]
- Add new Linux 3.16 constants to netinet/udp.h

* Tue Sep 09 2014 tmb <tmb> 6:2.20-3.mga5
+ Revision: 674336
- submit to release

* Mon Sep 08 2014 tmb <tmb> 6:2.20-2.mga5
+ Revision: 673679
- hp-timing.c is dropped upstream
- rebase some patches so they apply
- dont use conditional patching for mips build
- drop old powerpc fix
- nptl is not an addon anymore, adjust build accordingly
- drop merged patches
- update to 2.20

* Thu Sep 04 2014 tmb <tmb> 6:2.19-12.mga5
+ Revision: 672173
- fix crashes on invalid input in IBM gconv modules [BZ #17325] (CVE-2014-6040)

* Thu Aug 28 2014 tmb <tmb> 6:2.19-11.mga5
+ Revision: 669052
- _gconv_translit_find: Disable function [BZ #17187]
  (CVE-2014-5119) (mga#13995)

* Sun Jul 27 2014 tmb <tmb> 6:2.19-10.mga5
+ Revision: 657579
- rebuild with fixed gcc

* Wed Jul 23 2014 tmb <tmb> 6:2.19-9.mga5
+ Revision: 656122
- setlocale: Use the heap for the copy of the locale argument
- _nl_find_locale: Improve handling of crafted locale names
  (BZ#17137, CVE-2014-0475)

* Wed Jul 23 2014 colin <colin> 6:2.19-8.mga5
+ Revision: 655883
- Rename ldconfig filetrigger to make sure it's run first

* Sun Jun 29 2014 tmb <tmb> 6:2.19-7.mga5
+ Revision: 640940
-  posix_spawn_file_actions_addopen needs to copy the path argument
   (BZ 17048, CVE-2014-4043)

* Tue May 13 2014 tmb <tmb> 6:2.19-6.mga5
+ Revision: 622540
- rebuild with gcc 4.9

* Wed May 07 2014 tmb <tmb> 6:2.19-3.mga5
+ Revision: 620910
- misc/sys/xattr.h: guard against linux uapi header inclusion

* Sat Mar 01 2014 tmb <tmb> 6:2.19-2.mga5
+ Revision: 598263
- Fix sign of input to bsloww1 (glibc #16623)
- Update x86_64 libm-test-ulps on AMD family 21h model 1 (glibc #16545)

* Mon Feb 17 2014 tmb <tmb> 6:2.19-1.mga5
+ Revision: 593923
- submit to /release

* Sat Feb 08 2014 tmb <tmb> 6:2.19-0.1.mga5
+ Revision: 585854
- drop P12, ancient  ppc fix
- dummy libbsd now removed upstream
- rediff P06, P11, P44
- drop merged patches
- update to 2.19

* Wed Feb 05 2014 tmb <tmb> 6:2.18-10.mga5
+ Revision: 582832
- x86: Disable x87 inline functions for SSE2 math

* Sun Jan 05 2014 tmb <tmb> 6:2.18-9.mga4
+ Revision: 564795
- malloc: Fix race in free() of fastbin chunk (Glibc BZ #15073)

* Wed Dec 04 2013 tmb <tmb> 6:2.18-8.mga4
+ Revision: 555189
- Print the reason why preloading failed in do_preload()
- Fix PI mutex check in pthread_cond_broadcast and pthread_cond_signal

* Fri Oct 25 2013 tmb <tmb> 6:2.18-7.mga4
+ Revision: 546939
- Fix stack overflow due to large AF_INET6 requests (CVE-2013-4458)

* Wed Oct 16 2013 tmb <tmb> 6:2.18-6.mga4
+ Revision: 501486
- rebuild with new gcc & binutils
- Fix handling LC_CTYPE nonascii-case fallback in i686 SSE4.2 and SSSE3
  strcasecmp/strncasecmp

* Sat Oct 12 2013 tmb <tmb> 6:2.18-5.mga4
+ Revision: 496066
- rebuild with new binutils & make

* Fri Oct 11 2013 tmb <tmb> 6:2.18-4.mga4
+ Revision: 495280
- allow building wit GNU Make 4
- (struct __dirstream): Fix alignment of directory block (broken by CVE-2013-4237 fix)

* Sun Oct 06 2013 tmb <tmb> 6:2.18-3.mga4
+ Revision: 492209
- initialize the pointer guard used for pointer mangling (CVE-2013-4788)

* Wed Sep 25 2013 tmb <tmb> 6:2.18-2.mga4
+ Revision: 486293
- inet: avoid redefinition of some structs in kernel

* Tue Sep 17 2013 tmb <tmb> 6:2.18-1.mga4
+ Revision: 480803
- malloc: check for integer overflows in pvalloc, valloc, memalign (CVE-2013-4332)
- make silent builds so only warnings and errors gets logged
- Correct the processing of '\x80' characters in crypt_freesec.c
- fix typo in nscd.service

* Sun Aug 25 2013 tmb <tmb> 6:2.18-0.5.mga4
+ Revision: 471565
- temporarily disable build_check as it eats i686 libs on i586 build
- remove more references to pt_chown
- enable lock elision support
- fix strcoll() integer overflow leading to buffer overflow (CVE-2012-4412),
  and alloca() stack overflow in the strcoll() interface (CVE-2012-4424)
  (fedora, P102)
- install a sanitized LinuxThreads <bits/libc-lock.h> (fedora)
- gcc >= 4.4 is needed to build glibc
- binutils >= 2.20 is needed to build glibc
- experimental-malloc is default since 2011-06-28
- drop obsolete TlsFlags
- fix segfault with __strstr_sse42 (P60)
- Fix cbrtl for ldbl-96 (P100)
- Fix CVE-2013-4237, BZ #14699: Buffer overflow in readdir_r (P101)
- drop minimal required kernel to 2.6.32 so it works in chroots on top
  of enterprise kernels
- pt_chown is disabled/removed as part of fix for CVE-2013-2207
- rediff P17, P38
- drop P18, P60, P61 (merged)
- update to 2.18

* Sun Aug 11 2013 tmb <tmb> 6:2.17-10.mga4
+ Revision: 465392
- rebuild with new gcc

* Thu Aug 01 2013 tmb <tmb> 6:2.17-9.mga4
+ Revision: 462088
- test gcc-4.8.2 build

* Fri Jul 26 2013 colin <colin> 6:2.17-8.mga4
+ Revision: 458507
- Add myhostname to the hosts config in the default nsswitch.conf

* Mon Jun 03 2013 fwang <fwang> 6:2.17-7.mga4
+ Revision: 435858
- rebuild for new libpng

* Mon May 27 2013 oden <oden> 6:2.17-6.mga4
+ Revision: 428749
- rebuilt against libgd.so.3

* Tue Apr 09 2013 tmb <tmb> 6:2.17-5.mga3
+ Revision: 409175
- Fix stack overflow in getaddrinfo with many results (CVE-2013-1914)
- remove duplicate cve patch reference

* Sun Mar 24 2013 colin <colin> 6:2.17-4.mga3
+ Revision: 404859
- Add systemd requires and general post/pre fixes (mga#9302)

  + fwang <fwang>
    - fix CVE-2013-0242

  + tmb <tmb>
    - re-enable checks disabled by mistake

* Wed Jan 09 2013 tmb <tmb> 6:2.17-2.mga3
+ Revision: 343961
- fix fhs-usrmove patch that broke util-linux mounting /proc
- fix install of nscd.conf for tempfiles
- fix rest of nscd to use /run directly

  + colin <colin>
    - Ensure tmpfiles is run to create /run/nscd dir on pkg install

  + nanardon <nanardon>
    - revert wrong fix for missing /var/run/nscd
    - provide need /var/run/nscd in nscd package otherwise nscd failed to start

* Tue Jan 01 2013 tmb <tmb> 6:2.17-1.mga3
+ Revision: 337371
- BR libstdc++-static-devel for testsuite
- update to 2.17
- drop upstream release screwup fix
- ports is now merged back with upstream glibc
- adapt P1 (path fixes) according to Mga and UsrMove setup
- rediff P2 (nss upgrade)
- drop P5 (assign global scope to RFC1918 adresses, fixed properly upstream)
- drop P10 (revert pthread_cond_wait change, merged upstream)
- rediff P26: nice priority fix
- rediff P30 (filter out multiarch headers)
- rediff P38 (disable parellel testusite on powerpc)
- rediff P42 (avx owl crypt)
- rediff P39 (freesec crypt support)
- drop P60, P61 (strncasecmp segfault fix, strtod integer buffer overflow
  fix, merged)

  + tv <tv>
    - nsswitch.conf: document all modules

* Mon Oct 15 2012 tmb <tmb> 6:2.16-13.mga3
+ Revision: 306734
- fix and re-enable P43: sha256-crypt and sha512 crypt support (#7793)

* Sat Oct 06 2012 tmb <tmb> 6:2.16-12.mga3
+ Revision: 303047
- require filesystem to get it in same transaction during install

* Wed Oct 03 2012 tmb <tmb> 6:2.16-11.mga3
+ Revision: 302587
- adapt for new dash.static

* Sun Sep 23 2012 tmb <tmb> 6:2.16-10.mga3
+ Revision: 296840
- Fix strtod integer/buffer overflow (P61, upstream BZ 14459)
- Fix segmentation fault in strncasecmp for i686 (P60, upstream)

* Tue Aug 28 2012 tv <tv> 6:2.16-9.mga3
+ Revision: 284978
- rebuild for new binutils

* Sun Aug 05 2012 fwang <fwang> 6:2.16-8.mga3
+ Revision: 278875
- force gb18030 charset for zh_CN locale

* Sat Aug 04 2012 tv <tv> 6:2.16-7.mga3
+ Revision: 278427
- rebuild with compressed debug info

* Thu Aug 02 2012 tv <tv> 6:2.16-6.mga3
+ Revision: 277892
- rebuild with mini debug info

* Sat Jul 28 2012 blino <blino> 6:2.16-5.mga3
+ Revision: 275516
- revert upstream pthread_cond_wait change that cause hangs in pulseaudio

* Sat Jul 28 2012 guillomovitch <guillomovitch> 6:2.16-4.mga3
+ Revision: 275194
- drop sysinit support

  + tmb <tmb>
    - rebuild for kernel 3.5 series

* Mon Jul 23 2012 blino <blino> 6:2.16-3.mga3
+ Revision: 273680
- add a nscd.conf file in tmpfiles.d to create the nscd dir in /var/run (now in tmpfs), from openSUSE

* Fri Jul 20 2012 tmb <tmb> 6:2.16-2.mga3
+ Revision: 272812
- obsolete nss_db as it got merged back in glibc-2.15
- drop old manpages in favour of the newer man-pages rpm
- drop P22 (old kernel bug workaround, already disabled in Mageia 2)
- convert nsswitch.conf patch (P7) to normal source (S8)
- drop obsolete glibc-redhat tarball
- add BR on hardlink as that was the only thing we used from
  the old glibc-redhat tarball

* Wed Jul 18 2012 tmb <tmb> 6:2.16-1.mga3
+ Revision: 272322
- merge glibc-2.16 branch:
  * update to 2.16.0
  * rediff P4, P6, P12, P28, P30, P31, P38, P44
  * drop P49 (rpc change revert) as its replaced by
    '--enable-obsolete-rpc' configure flag
  * drop P48, P60-P62 (merged upstream)
  * disable broken pdf doc build for now
  * update filelists
  * drop obsolete defattr and buildroot from spec

* Wed Jun 27 2012 tmb <tmb> 6:2.14.1-10.mga3
+ Revision: 264229
- rebuild with gcc-4.7.1

* Tue Jun 26 2012 tmb <tmb> 6:2.14.1-9.mga3
+ Revision: 263781
- BR: texinfo-tex
- Upstream fixes needed for upcoming gcc-4.7.1
  * Fix warnings in regex (P60)
  * Fix up regcomp/regexec (P61)
  * Fix regex incomplete multi-byte character (P62)

* Sat Apr 28 2012 tmb <tmb> 6:2.14.1-8.mga2
+ Revision: 233821
- nscd: Require rpm-helper >= 0.24.8-1 for systemd support

* Tue Apr 03 2012 colin <colin> 6:2.14.1-7.mga2
+ Revision: 227986
- Fix PIDFile location in nscd systemd unit.

* Mon Apr 02 2012 guillomovitch <guillomovitch> 6:2.14.1-6.mga2
+ Revision: 227855
- add systemd support for nscd

* Sat Mar 03 2012 tmb <tmb> 6:2.14.1-5.mga2
+ Revision: 217216
- rebuild with new gcc
- linux-userspace-headers is now kernel-userspace-headers

* Tue Dec 27 2011 anssi <anssi> 6:2.14.1-4.mga2
+ Revision: 188165
- use rpm-mageia-setup's new $EXCLUDE_FROM_FULL_STRIP to only strip
  debug symbols from ld.so, libpthread.so, libc.so instead of using
  EXCLUDE_FROM_STRIP and manual stripping with -g (from Mandriva)
  o fixes missing debug symbols in glibc-debug for libc.so and
    libpthread.so
  o fixes completely missing stripping of ld.so (it will now be
    stripped of debugging symbols only, to avoid issues with gdb)

* Mon Dec 05 2011 tmb <tmb> 6:2.14.1-3.mga2
+ Revision: 176926
- rebuild with new gcc-4.6.2 and binutils-2.22

  + rtp <rtp>
    - Fix crypt blowfish build failure on arm

* Mon Oct 24 2011 dmorgan <dmorgan> 6:2.14.1-2.mga2
+ Revision: 157664
- revert sunrpc removal ( P49)

* Fri Oct 21 2011 tmb <tmb> 6:2.14.1-1.mga2
+ Revision: 157233
- push to /release

* Thu Oct 20 2011 tmb <tmb> 6:2.14.1-0.4.mga2
+ Revision: 156969
- fix segfault at dl lookup (glibc bz #12871)
- fix glibc-ports setup
- drop P47 (already merged in glibc-ports-2.14.1)

* Tue Oct 18 2011 tmb <tmb> 6:2.14.1-0.2.mga2
+ Revision: 156310
- update filelists
- rediff P40, P41
- disable P22 (old tcsetattr kernel bug workaround)
- update crypt_freesec, add urls (pok, mdv)
- update crypt_blowfish to 1.2
- rediff P47 to apply cleanly
- set minimum/required kernel to 2.6.33
- drop ia64, ppc(64), sparc(64) support
- BR texlive
- drop merged patches, rediff P44
- update to 2.14.1

  + tv <tv>
    - make the huge doc subpackages be noarch

  + rtp <rtp>
    - remove native pt_chown when generating cross glibc for non-biarch/mips* case
      too
    - fix cross_program_prefix
    - move gnuext macro for build_cross case after isarch definition
    - doesn't create a ld.so.cache in build_cross case

* Tue Mar 22 2011 rtp <rtp> 6:2.12.1-11.mga1
+ Revision: 75374
- Add support for glibc-ports
- Add arm support
- Add early mips support
- Attempt to fix cross glibc generation

* Thu Feb 24 2011 misc <misc> 6:2.12.1-10.mga1
+ Revision: 58741
- rebuilt for removing various Conflicts and Obsoletes
- remove timezone links that are already present in upstream glibc
- do not hardcode our distro name
- clean old Obsoletes
- remove various Conflicts that are no longer relevant ( like on kernel 2.0.. )
- remove old conflict on rpm < 4.2.2 that date back to 5 years ago

* Mon Jan 10 2011 dmorgan <dmorgan> 6:2.12.1-9.mga1
+ Revision: 5255
- Rediff glibc-2.3.6-nsswitch.conf.patch

  + blino <blino>
    - add back wrongly removed endif
    - remove old comment
    - remove old ldconfig scriptlets

  + tmb <tmb>
    - imported package glibc