Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37792087
en ru br
Репозитории ALT
S:2.38.0.23.0e1ef6779a-alt1
5.1: 2.11.2-alt1.M51.1
4.1: 2.5.1-alt4.M41.2
4.0: 2.5-alt4.M40.2
3.0: 2.3.5-alt5
www.altlinux.org/Changes

Другие репозитории

Группа :: Система/Основа
Пакет: glibc

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%def_with optimization
%def_disable archopt
%def_enable langify

%ifdef __buildreqs
%def_disable check
%else
%def_enable check
%endif #__buildreqs

# Build arch-optimized subpackage only?

%if_enabled archopt

%define _optlevel 3
%def_disable profile
%def_without locales
%def_without debug

%else #disabled archopt

%def_enable profile
%def_with locales

%if %defined __buildreqs
%def_without debug
%else
%def_with debug
%endif #__buildreqs

%endif #disabled archopt

%define enablekernel 2.4.1
%define enablemask [01].*|2.[0-3]*|2.4.0*

%define basever 2.3.5
%define snapshot 200406160000
%define srcname %name-%version

Name: glibc
Version: %basever
Release: alt5
Serial: 6

Summary: The GNU libc libraries
License: LGPL
Group: System/Base
#Url: ftp://sources.redhat.com/pub/%name/releases
Url: http://www.gnu.org/software/%name/

Source0: ftp://ftp.gnu.org/gnu/%name/%name-%version.tar.bz2
Source1: ftp://ftp.gnu.org/gnu/%name/%name-linuxthreads-%version.tar.bz2
Source2: ftp://ftp.gnu.org/gnu/%name/%name-libidn-%version.tar.bz2

# RH

Source5: glibc-fedora-20050428T0846.tar.bz2

Source11: %name-helpers.tar
Source12: nscd.init
Source13: nsswitch.conf
Source14: ld.so.conf
Source15: find-provides.sh
Source16: find-requires.sh
Source17: %name-README-alpha
Source18: %name-README.ALT

# CVS

Patch0: glibc-2.3.5-cvs-20050427-2_3-branch.patch
Patch1: glibc-2.3.5-cvs-20050427-canonicalize.patch
Patch2: glibc-2.3.5-cvs-20050522-sendfile.patch

# RH

Patch101: glibc-2.3.5-fedora.patch

# SuSE

Patch201: glibc-2.3.4-suse-getconf-default_output.patch
Patch202: glibc-2.3.2-suse-localedef-archive.patch
Patch203: glibc-2.3-suse-fnmatch.patch
Patch204: glibc-2.3.3-suse-x86_64-string.patch
Patch205: glibc-2.3-suse-x86_64-fpu.patch
Patch206: glibc-2.3.3-suse-x86_64-fpu-s_ceil.patch
Patch207: glibc-2.3.5-suse-alt-version.patch
Patch208: glibc-2.3.3-glob-stale-symlinks.patch

# Debian

Patch251: glibc-deb-arm-ioperm.patch
Patch252: glibc-2.3.4-deb-timing.patch

# ALT/Owl

Patch301: glibc-2.3.5-obsd-alt-sys-queue.patch
Patch302: glibc-2.3.5-obsd-alt-strlcpy-strlcat.patch
Patch303: glibc-2.3.5-alt-texinfo.patch
Patch304: glibc-2.3.5-alt-doc-linuxthreads.patch
Patch305: glibc-2.3.5-alt-string2.patch
Patch306: glibc-2.3.5-alt-sys-mount.patch
Patch307: glibc-2.3.5-alt-getopt-optind.patch
Patch308: glibc-2.3.5-alt-tmpfile.patch
Patch309: glibc-2.3.5-alt-fts_palloc-cleanup.patch
Patch310: glibc-2.3.5-alt-asprintf.patch
Patch311: glibc-2.3.5-alt-libio-bound.patch
Patch312: glibc-2.3.5-owl-alt-syslog-ident.patch
Patch313: glibc-2.3.5-mjt-owl-alt-syslog-timestamp.patch
Patch314: glibc-2.3.5-owl-alt-res_randomid.patch
Patch315: glibc-2.3.5-alt-crypt.patch
Patch316: glibc-2.3.5-alt-iconv_prog-replace.patch
Patch317: glibc-2.3.5-alt-versioning.patch
Patch318: glibc-2.3.5-alt-ldconfig-exit-during-install.patch
Patch319: glibc-2.3.5-alt-i18n.patch
Patch320: glibc-2.3.5-alt-relocate-helper-libs.patch
Patch321: glibc-2.3.5-alt-xtrace-xvt.patch
Patch322: glibc-2.3.5-owl-alt-ldd.patch
Patch323: glibc-2.3.5-alt-ldconfig-search_dir.patch
Patch324: glibc-2.3.5-alt-linux-dl-execstack.patch
Patch325: glibc-2.3.5-alt-assume_kernel.patch
Patch326: glibc-2.3.5-alt-libgd.patch
Patch327: glibc-2.3.5-alt-tmp-scripts.patch
Patch328: glibc-2.3.5-owl-rpcgen-cpp.patch
Patch329: glibc-2.3.5-owl-alt-resolv-QFIXEDSZ-underfills.patch
Patch330: glibc-2.3.5-owl-alt-sanitize-env.patch
Patch331: glibc-2.3.5-alt-__locale_getenv.patch

Obsoletes: zoneinfo, libc-static, libc-devel, libc-profile, libc-headers,
Obsoletes: linuxthreads, gencat, ldconfig

%define libc_locales_list aa af am an ar az be bg bn br bs byn ca cs cy da de el en es et eu fa fi fo fr ga gd gez gl gu gv he hi hr hu id is it iw ja ka kk kl kn ko kw lg lo lt lv mi mk ml mn mr ms mt nb ne nl nn no oc om pa pl pt ro ru se sid sk sl so sq st sv ta te tg th ti tig tl tr tt uk ur uz vi wa xh yi zh zu
%define libc_locales %(for i in %libc_locales_list;do echo -n "locale-$i locales-$i ";done)
%define renamed_locales ru_RU.iso88595 ru_UA.koi8u uk_UA.koi8u

PreReq: %name-core = %serial:%version-%release
PreReq: %name-nss = %serial:%version-%release
PreReq: %name-locales = %serial:%version-%release
PreReq: %name-gconv-modules = %serial:%version-%release
PreReq: iconv = %serial:%version-%release
PreReq: %name-timezones = %serial:%version-%release
PreReq: %name-utils = %serial:%version-%release

BuildPreReq: rpm-build >= 4.0.4-alt10, binutils >= 2.14.90.0.8-alt1, glibc-kernheaders >= 2.4.25-alt2
#BuildConflicts: glibc-core-archopt

# This is required for building auxiliary programs.

BuildPreReq: libgd2-devel

# g++ is requires for test suit.

BuildPreReq: gcc3.4-c++

%define _gconvdir %_libdir/gconv
%define __find_provides %SOURCE15
%define __find_requires %SOURCE16

%package core
Summary: The GNU libc core libraries and utilities
Group: System/Libraries
AutoReq: no
PreReq: setup
Conflicts: %name < %serial:%version-%release
Provides: linuxthreads, ldconfig, /sbin/ldconfig, /sbin/post_ldconfig, /sbin/postun_ldconfig
Provides: /sbin/glibc_fix_nsswitch, /sbin/glibc_post_upgrade
Obsoletes: linuxthreads, ldconfig

%package nss
Summary: The GNU libc Name Service Switch subsystem
Group: System/Libraries
PreReq: %name-core = %serial:%version-%release
Conflicts: %name < %serial:%version-%release

%package locales
Summary: The GNU libc locales
Group: System/Internationalization
PreReq: %name-core = %serial:%version-%release
Provides: %name-locales-virtual = %serial:%version-%release
Provides: locale locales %libc_locales
Obsoletes: locale locales %libc_locales
Obsoletes: %name-locales-junior
Conflicts: %name < %serial:%version-%release

%package i18ndata
Summary: Files for building customized GNU libc locales
Group: System/Base
PreReq: %name-core = %serial:%version-%release
Obsoletes: %name-localedata
Provides: %name-localedata
Conflicts: %name < %serial:%version-%release
Conflicts: mutt < 1.3.22.1i

%package gconv-modules
Summary: The GNU libc charset conversion modules
Group: System/Base
PreReq: %name-core = %serial:%version-%release
Conflicts: %name < %serial:%version-%release
# hack
%ifarch x86_64
Provides: %(for n in CNS GB ISOIR165 JIS JISX0213 KSC; do echo -n "lib$n.so()(64bit) "; done)
Provides: %(for n in CNS GB ISOIR165 JIS JISX0213 KSC; do echo -n "%_libdir/gconv/lib$n.so()(64bit) "; done)
%else
Provides: %(for n in CNS GB ISOIR165 JIS JISX0213 KSC; do echo -n "lib$n.so "; done)
Provides: %(for n in CNS GB ISOIR165 JIS JISX0213 KSC; do echo -n "%_libdir/gconv/lib$n.so "; done)
%endif

%package -n iconv
Summary: The GNU libc charset conversion modules
Group: System/Base
PreReq: %name-core = %serial:%version-%release, %name-gconv-modules = %serial:%version-%release
Conflicts: %name < %serial:%version-%release
Provides: /usr/sbin/iconvconfig

%package timezones
Summary: The GNU libc timezones data
Group: System/Base
PreReq: %name-core = %serial:%version-%release
Conflicts: %name < %serial:%version-%release
Provides: zoneinfo
Obsoletes: zoneinfo

%package utils
Summary: The GNU libc misc utilities
Group: System/Base
PreReq: %name-core = %serial:%version-%release
Conflicts: %name < %serial:%version-%release
Requires: mktemp >= 1:1.3.1
Provides: gencat
Obsoletes: gencat

%package devel
Summary: Include and object files required for C development
Group: Development/C
Requires(post): %install_info
Requires(preun): %uninstall_info
Requires: %name = %serial:%version-%release, glibc-kernheaders >= 2.4.21-alt1, kernel-headers-common >= 1.1.4-alt1
Conflicts: texinfo < 3.11
%ifarch %ix86
# Earlier gcc's had atexit reference in crtendS.o, which does not
# work with this glibc where atexit is in libc_nonshared.a
Conflicts: gcc < 0:2.96-ipl9mdk
%endif
Obsoletes: libc-headers, libc-devel, linuxthreads-devel

%package devel-static
Summary: Static libraries for C development
Group: Development/C
Requires: %name-devel = %serial:%version-%release
Obsoletes: libc-static

%package profile
Summary: The GNU libc libraries, including support for gprof profiling
Group: Development/C
Requires: %name = %serial:%version-%release
Obsoletes: libc-profile

%package compat
Summary: The GNU libc 2.0 compatibility add-on
Group: System/Libraries
Requires: %name-core = %serial:%version-%release

%package debug
Summary: The GNU libc utilities for software debugging
Group: Development/C
Requires: %name-devel = %serial:%version-%release
Obsoletes: libc-debug

%package core-debug
Summary: The GNU libc core libraries with debugging information
Group: Development/C
AutoProv: yes, nolib
Requires: %name-core = %serial:%version-%release

%package nss-debug
Summary: The GNU libc Name Service Switch libraries with debugging information
Group: Development/C
AutoProv: yes, nolib
Requires: %name-nss = %serial:%version-%release, %name-core-debug = %serial:%version-%release

%package devel-debug
Summary: Static standard C libraries with debugging information
Group: Development/C
AutoProv: yes, nolib
Requires: %name-devel = %serial:%version-%release, %name-core-debug = %serial:%version-%release, %name-nss-debug = %serial:%version-%release

%package -n nscd
Summary: A Name Service Caching Daemon (nscd)
Group: System/Servers
Conflicts: kernel < 2.2.0
PreReq: chkconfig, shadow-utils
PreReq: %name-core = %serial:%version-%release

%package core-%_target_cpu
Summary: The GNU libc core libraries built with optimization for %_target_cpu processor
Group: System/Libraries
PreReq: %name-core = %serial:%version-%release
Provides: %name-core-archopt = %serial:%version-%release

%description
The GNU C library defines all of the library functions that are specified
by the ISO C standard, as well as additional features specific to POSIX
and other derivatives of the Unix operating system, and extensions
specific to the GNU system.

The GNU libc is a set of 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.

%description core
This package contains most essential GNU libc libraries and files,
including dynamic linker and its configurator, standard C library and
the standard math library.  Without these files a GNU/Linux system will
not function.

%description locales
This package contains GNU libc locales, files that tell your system
about your language, names of days and months, charset, and other
language/territory/charset specific things.

%description i18ndata
This package contains source files required for building locales.  Locales
are files, that tell your system about your language, names of days and
months, alphabet and other language/territory/charset specific things.

%description gconv-modules
This package contains helper modules necessary to convert data between
various charsets.

%description -n iconv
This package contains program that can convert text files between
various charsets.

%description timezones
This package contains files, utilities and databases for operating
timezones data in the system.

%description utils
This package contains miscellaneous non-essential %name utilities that
didn't fit in specific packages.

%description nss
NSS is a Name Service Switch subsystem.  The basic idea is to put the
implementation of the different services offered to access the databases
in separate modules.

%description devel
This 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.

%description devel-static
This package package contains the GNU libc static libraries necessary for
developing statically linked programs which use the standard C libraries.

%description profile
This 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 from this
package instead of the standard GNU libc libraries.

%description compat
This package includes the GNU libc 2.0 compatibility add-on-.

%description debug
The %name-debug package contains utilities for software debugging,
including:
+ memusage
+ memusagestat
+ pcprofiledump
+ xtrace

%description core-debug
This package contains GNU libc core shared libraries with debugging
information.  You need this if you want to step into C library routines
during debugging.  To use these libraries, you need to set
LD_LIBRARY_PATH=%_libdir/debug
in your environment before starting debugger.  If you want to see glibc
source files during debugging, you should
rpm -i glibc-%version-%release.src.rpm
rpm -bp %%_specdir/glibc.spec

%description nss-debug
This package contains GNU libc NSS libraries with debugging information.
You need this if you want to step into C library routines during
debugging.  To use these libraries, you need to set
LD_LIBRARY_PATH=%_libdir/debug
in your environment before starting debugger.  If you want to see glibc
source files during debugging, you should
rpm -i glibc-%version-%release.src.rpm
rpm -bp %%_specdir/glibc.spec

%description devel-debug
This package contains GNU libc static libraries with debugging
information.  You need this only if you want to step into C library
routines during debugging programs statically linked against one or
more of the standard C libraries.  To use this debugging information,
you need to link binaries with -L%_libdir/debug compiler option.
If you want to see glibc source files during debugging, you should
rpm -i glibc-%version-%release.src.rpm
rpm -bp %%_specdir/glibc.spec

%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.

%description core-%_target_cpu
This package contains most essential GNU libc libraries, optimized for
run on %_target_cpu processor.

%prep
%setup -q -a1 -a2 -a5 -a11

### CVS

# 20050427-2_3-branch
%patch0 -p0

# Fix realpath(3) to return NULL and set errno to ENOTDIR for such

# pathnames like "/path/to/existing-non-directory/".
%patch1 -p0

# Remove __nonnull from sendfile and sendfile64 declarations.

%patch2 -p0

### RH

# Usual glibc-fedora.patch
%patch101 -p0

### SuSE

# Add -a option to getconf.
%patch201 -p0

# Add new option --archive to localedef, change default to --no-archive.

%patch202 -p0

# Change fnmatch: if conversion to wide character fails, fall back to

# single byte matching.
%patch203 -p0

# Update x86_64 string functions.

%patch204 -p0

# Update x86_64 fpu functions.

%patch205 -p0 -E

# Fix ceil() for x86_64.

%patch206 -p0

# Include information about floating stack support into version output.

%patch207 -p1

# Revert incompatible change to glob(3).

%patch208 -p0 -R

### Debian

# Fix ioperm build error on arm.
%patch251 -p0

# Align rtld_global and rtld_global_ro sizes for using i686 optimized library.

%patch252 -p1

### ALT/Owl

# Backport sys/queue.h from OpenBSD.
%patch301 -p1

# Import strlcpy/strlcat from OpenBSD.

%patch302 -p1

# Fix texinfo documentation according to ALT info policy.

%patch303 -p1

# Fix linuxthreads documentation.

%patch304 -p1

# Fix -Wpointer-arith issue in string2.h

%patch305 -p1

# Fix sys/mount.h for gcc -pedantic support.

%patch306 -p1

# Set proper optind when argc < 1.

%patch307 -p1

# Allow tmpfile(3) to use $TMPDIR.

%patch308 -p1

# Minor io/fts.c cleanup.

%patch309 -p1

# Change asprintf/vasprintf error handling.

%patch310 -p1

# Check for potential integer overflow in fread*/fwrite*.

%patch311 -p1

# Don't blindly trust __progname for the syslog ident.

%patch312 -p1

# use ctime_r() instead of strftime_r() in syslog(3).

%patch313 -p1

# Improve res_randomid in the resolver.

%patch314 -p1

# Blowfish-crypt support (based on crypt_blowfish-0.4.5 by Solar Designer).

# Gensalt interface.
# Export UFC-crypt and MD5-crypt interface.
# Export MD5 library.
%patch315 -p1

# Add "--replace" option to iconv utility.

%patch316 -p1

# Export __libc_enable_secure.

%patch317 -p1

# Change ldconfig to exit during distribution install.

%patch318 -p1

# Support more ru_* locales.

%patch319 -p1

# Relocate helper libraries from /%_lib to %_libdir.

%patch320 -p1

# xtrace.sh: If `TERMINAL_PROG' is not set, set it to `xvt'.

%patch321 -p1

# ldd: Always execute traced object directly with dynamic linker.

%patch322 -p1

# ldconfig: Revert symlink handling changes in search_dir().

%patch323 -p1

# Fix mprotect return code handling in _dl_make_stack_executable().

%patch324 -p1

# Fix _dl_osversion_init(), _dl_non_dynamic_init() and

# dl_main() functions to not assume too old kernel version.
%patch325 -p1

# memusagestat: Fix linkage.

%patch326 -p1

# memusage, xtrace: Fix tmp file handling.

%patch327 -p1

# Avoid hardcoding of cpp binary, use execvp instead of execv.

%patch328 -p1

# Avoid potential reads beyond end of undersized DNS responses.

%patch329 -p1

# Sanitize the environment in a paranoid way.

%patch330 -p1

# Introduce and export __locale_getenv.

%patch331 -p1

%__install -p -m644 %SOURCE17 README-alpha
%__install -p -m644 %SOURCE18 README.ALT

find -type f -name \*.orig -delete -print

%if_enabled archopt
# Remove glibc-2.0 compat code.
%__rm -rf %name-compat
%endif

################################################################################

%build
%define buildtarget build-%_target

%if_without optimization
%define _optlevel %nil
%define optflags_optimization -O%_optlevel %optflags_debug
%if %undefined parallelmflags
%define parallelmflags %nil
%endif # parallelmflags
%else #with optimization

%if %undefined parallelmflags
%define parallelmflags -s
%endif # parallelmflags

%add_optflags -DNDEBUG=1

%endif #without optimization

#add_optflags -finline-limit=2000


%define _configure_script ../configure
%define _configure_target  --host=%_target_platform --build=%_target_platform

# workaround

unset LD_PRELOAD LD_ASSUME_KERNEL ||:

export CC=gcc CXX=g++

AddOns=`echo */configure |sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d'`

# If gcc supports __thread, test it even in --with-tls --without-__thread builds.

if echo '__thread int a;' |gcc -xc - -S -o /dev/null 2>/dev/null; then
%__subst -p 's/0 ||/1 ||/' elf/tst-tls10.h linuxthreads/tst-tls1.h
fi

%__rm -rf %buildtarget
mkdir %buildtarget
pushd %buildtarget

Pthreads=linuxthreads

%configure \
%{?_disable_profile:%_disable_profile} \
--without-cvs \
--enable-add-ons=$Pthreads$AddOns \
--without-tls --without-__thread \
--enable-kernel=%enablekernel \
#

%make_build -r PARALLELMFLAGS=%parallelmflags

%if_enabled check
# Increase timeouts
perl -pi -e 's/alarm \(TIMEOUT\)/alarm (TIMEOUT * 15 * '$NPROCS' < 600 ? TIMEOUT * 15 * '$NPROCS' : 600)/' \
../test-skeleton.c
%make_build -r PARALLELMFLAGS=%parallelmflags -k check ||:
%endif #enabled check

popd #%buildtarget

make -C %name-helpers

%if_with debug
%__rm -rf %buildtarget-debug
mkdir %buildtarget-debug
pushd %buildtarget-debug

export CFLAGS="$RPM_OPT_FLAGS %optflags_debug"
%configure \
--disable-profile \
--without-cvs \
--without-gd \
--enable-add-ons=$Pthreads$AddOns \
--without-tls --without-__thread \
--enable-kernel=%enablekernel \
#

%make_build -r PARALLELMFLAGS=%parallelmflags

popd #%buildtarget-debug
%endif #with debug

# The man pages for the linuxthreads require special attention.

make -C linuxthreads/man

################################################################################

%install
[ -n "$NPROCS" ] || NPROCS=%__nprocs
%make_install -j$NPROCS install install_root=$RPM_BUILD_ROOT -C %buildtarget

# Remove the files we don't want to distribute.

%__rm -fv $RPM_BUILD_ROOT%_libdir/{libnss_*.so.1,libNoVersion*}

# Relocate shared libraries used by catchsegv, memusage and xtrace.

%__mv $RPM_BUILD_ROOT/%_lib/lib{memusage,pcprofile,SegFault}.so \
$RPM_BUILD_ROOT%_libdir/ ||:

%if_with debug
%make_install install install_root=$RPM_BUILD_ROOT/debug -C %buildtarget-debug

%__rm -fv $RPM_BUILD_ROOT/debug%_libdir/{libnss_*.so.1,libNoVersion*}
%__rm -fv $RPM_BUILD_ROOT/debug/%_lib/lib{memusage,pcprofile,SegFault}.so

/bin/ls -1 $RPM_BUILD_ROOT/debug/%_lib/*.so* |
fgrep -v /%_lib/libnss1 |
fgrep -v libNoVersion |
egrep -v '/%_lib/libnss_([^f]|files\.so\.1)' |
%__sed -e "s|$RPM_BUILD_ROOT/debug/%_lib|%_libdir/debug|g" >core-debug.files

/bin/ls -1 $RPM_BUILD_ROOT/debug/%_lib/*.so* |
fgrep nss |
fgrep -v /%_lib/libnss_files-%basever.so |
fgrep -v /%_lib/libnss_files.so.2 |
%__sed -e "s|$RPM_BUILD_ROOT/debug/%_lib|%_libdir/debug|g" >nss-debug.files

/bin/ls -1 $RPM_BUILD_ROOT/debug%_libdir/lib*.so |
%__sed -e "s|$RPM_BUILD_ROOT/debug%_libdir|%_libdir/debug|g" >>devel-debug.files

%__mkdir_p $RPM_BUILD_ROOT%_libdir/debug
%__mv $RPM_BUILD_ROOT/debug/%_lib/* $RPM_BUILD_ROOT/debug%_libdir/*.{so,a,o}* \
$RPM_BUILD_ROOT%_libdir/debug/
%__rm -rf $RPM_BUILD_ROOT/debug
for f in $RPM_BUILD_ROOT%_libdir/debug/*.so; do
if [ -L "$f" ]; then
t=`readlink "$f"`
t=${t##*/}
%__ln_s -nf "$t" "$f"
fi
done
%endif #with debug

%if_enabled archopt

%__mkdir_p $RPM_BUILD_ROOT/%_lib/%_target_cpu
%__mv $RPM_BUILD_ROOT/%_lib/*.so* $RPM_BUILD_ROOT/%_lib/%_target_cpu/

%else #disabled archopt

# Install upgrade programs.

make -C %name-helpers install

%if_with locales
pushd %buildtarget
%make_build install-locales -C ../localedata \
install_root=$RPM_BUILD_ROOT \
objdir=`pwd`
popd

# Hardlink identical locale files together.

./%name-helpers/linkify -vc $RPM_BUILD_ROOT%_libdir/locale

# Convert these locale directories into symlinks.

for n in %renamed_locales; do
t=$RPM_BUILD_ROOT%_libdir/locale/"${n%.*}"
%__rm -rf "$t"
%__ln_s "$n" "$t"
done
%endif #with locales

# The man pages for the linuxthreads require special attention.

%__mkdir_p $RPM_BUILD_ROOT%_man3dir
install -p -m644 linuxthreads/man/*.3thr $RPM_BUILD_ROOT%_man3dir/

%__ln_s -f libbsd-compat.a $RPM_BUILD_ROOT%_libdir/libbsd.a

install -pD -m755 %SOURCE12 $RPM_BUILD_ROOT%_initdir/nscd
install -pD -m644 %SOURCE13 $RPM_BUILD_ROOT%_sysconfdir/nsswitch.conf
install -p -m644 nscd/nscd.conf $RPM_BUILD_ROOT%_sysconfdir/
%__mkdir_p -m711 $RPM_BUILD_ROOT/var/run/nscd
mksock $RPM_BUILD_ROOT/var/run/nscd/socket

# Include ld.so.conf and ld.so.conf.d

%__mkdir_p $RPM_BUILD_ROOT%_sysconfdir/ld.so.conf.d
%__install -pD -m644 %SOURCE14 $RPM_BUILD_ROOT%_sysconfdir/ld.so.conf

# Include %%ghost ld.so.cache

install -pD -m644 /dev/null $RPM_BUILD_ROOT%_sysconfdir/ld.so.cache

# Include gconv-modules.cache

install -pD -m644 /dev/null $RPM_BUILD_ROOT%_gconvdir/gconv-modules.cache

# %_sysconfdir/localtime - we're proud of our timezone.

%__rm -f $RPM_BUILD_ROOT%_sysconfdir/localtime
%__cp -pf $RPM_BUILD_ROOT%_datadir/zoneinfo/Europe/Moscow \
$RPM_BUILD_ROOT%_sysconfdir/localtime

# Get rid of duplicates.

%__rm -rf $RPM_BUILD_ROOT%_datadir/zoneinfo/{posix,right}

# The last bit: more documentation.

%__rm -rf documentation
%__mkdir documentation
# BUGS removed from the list
%__cp -pL LICENSES README* NEWS INSTALL FAQ NOTES PROJECTS ChangeLog* hesiod/README.hesiod \
documentation/
%__cp -pL linuxthreads/ChangeLog  documentation/ChangeLog.threads
%__cp -pL linuxthreads/Changes documentation/Changes.threads
%__cp -pL linuxthreads/README documentation/README.threads
%__cp -pL linuxthreads/FAQ.html documentation/FAQ-threads.html
%__cp -rpL linuxthreads/Examples documentation/examples.threads
%__cp -pL crypt/README.ufc-crypt documentation/README.ufc-crypt
%__cp -pL timezone/README documentation/README.timezone
%__bzip2 -9 documentation/{ChangeLog*,FAQ,NEWS,README.libm,INSTALL,NOTES}

>devel.files
>devel-static.files
for f in `/bin/ls -1 $RPM_BUILD_ROOT%_libdir/lib*.a |
 grep -v '_p.a$' |
 %__sed -e "s|$RPM_BUILD_ROOT||g"`; do
if [ -e "$RPM_BUILD_ROOT${f%.a}.so" ]; then
echo "$f" >>devel-static.files
else
echo "$f" >>devel.files
fi
done

%find_lang libc

%if_with locales
%if_enabled langify
(
cd $RPM_BUILD_ROOT%_libdir/locale
for f in *; do
n=${f%%%% at *}
n=${f%%%%.*}
n=${f%%%%_*}
echo "%lang($n) %attr(-,root,root) %_libdir/locale/$f"
done
) >>libc.lang
%endif #enabled langify

echo '%dir %_datadir/locale' >>libc.lang
for lang in %libc_locales_list; do
%__mkdir_p "$RPM_BUILD_ROOT%_datadir/locale/$lang"/LC_{MESSAGES,TIME}
echo "%lang($lang) %dir %_datadir/locale/$lang" >>libc.lang
echo "%lang($lang) %dir %_datadir/locale/$lang/LC_MESSAGES" >>libc.lang
echo "%lang($lang) %dir %_datadir/locale/$lang/LC_TIME" >>libc.lang
done
%endif #with locales

%endif #enabled archopt

%if_without optimization

%set_strip_method none

%else #with optimization

# Strip ld and libpthread but keep some symbols required for debugging.

find $RPM_BUILD_ROOT/lib -type f \( -name ld-\*.so -or -name libpthread-\*.so \) -print0 |
    xargs -r0 strip --strip-debug -R .comment --
%add_strip_skiplist */ld-*.so* */libpthread-*.so

%endif #without optimization

%if_enabled archopt
%post core-%_target_cpu -p /sbin/glibc_post_upgrade
%postun core-%_target_cpu
[ $1 -gt 0 ] || /sbin/glibc_post_upgrade
%endif #enabled archopt

%post core -p /sbin/glibc_post_upgrade
%postun core -p /sbin/postun_ldconfig

%post nss -p /sbin/post_ldconfig
%postun nss -p /sbin/postun_ldconfig

%post -n iconv
%_sbindir/iconvconfig

%pre locales
for n in %renamed_locales; do
f="%_libdir/locale/${n%.*}"
if [ -d "$f" -a ! -L "$f" ]; then
%__rm -rf "$f"
/bin/touch "$f.RPMLOCK"
fi
done

%post locales
for n in %renamed_locales; do
d="%_libdir/locale/$n"
f="%_libdir/locale/${n%.*}"
if [ -f "$f.RPMLOCK" -a -d "$f" -a ! -d "$d.RPMSAVE" ]; then
%__mv "$d" "$d.RPMSAVE"
%__rm -f "$f.RPMLOCK"
fi
done

%triggerpostun locales -- %name-locales, %name < 6:2.2.4-alt3
for n in %renamed_locales; do
d="%_libdir/locale/$n"
if [ -d "$d.RPMSAVE" -a ! -d "$d" ]; then
%__mv "$d.RPMSAVE" "$d"
fi
done

%post devel
%install_info libc.info

%pre devel
# This used to be a link and it is causing nightmares now.
if [ -L %_includedir/scsi ]; then
%__rm -f %_includedir/scsi
fi

%preun devel
%uninstall_info libc.info

%pre -n nscd
/usr/sbin/useradd -M -o -r -u 28 -d / -s /dev/null -c "NSCD Daemon" nscd ||:

%post -n nscd
%post_service nscd

%preun -n nscd
%preun_service nscd

%triggerpostun core -p /sbin/glibc_fix_nsswitch -- %name < 6:2.2.4-alt3, %name-nss < 6:2.2.4-alt4

%if_enabled archopt

%files core-%_target_cpu
/%_lib/%_target_cpu/ld*
/%_lib/%_target_cpu/lib[acdmpru]*

%else #disabled archopt

%files
%doc documentation/*

%files core
/%_lib/*.so*
%exclude /%_lib/libnss1_*
%exclude /%_lib/libnss_[a-eg-z]*
%exclude /%_lib/libnss_*.so.1
%exclude /%_lib/libNoVersion*
/sbin/glibc_post_upgrade
/sbin/glibc_fix_nsswitch*
/sbin/*ldconfig
%ghost %_sysconfdir/ld.so.cache
%dir %_sysconfdir/ld.so.conf.d
%config(noreplace) %_sysconfdir/ld.so.conf
%config(noreplace) %_sysconfdir/localtime
%config(noreplace) %_sysconfdir/nsswitch.conf
%config(noreplace) %_sysconfdir/rpc

%files nss
/%_lib/libnss_*.so*
%exclude /%_lib/libnss_f*
%exclude /%_lib/libnss_*.so.1

%if_with locales
%files locales -f libc.lang
%_bindir/locale*
%dir %_libdir/locale
%if_disabled langify
%_libdir/locale/*
%endif #disabled langify
%endif #with locales

%files gconv-modules
%dir %_gconvdir
%_gconvdir/*.so
%verify(not md5 size mtime) %config(noreplace) %_gconvdir/gconv-modules*

%files -n iconv
%_bindir/iconv*
%_sbindir/iconv*

%files timezones
%_datadir/zoneinfo
%_bindir/tzselect
%_sbindir/zdump
%_sbindir/zic

%files utils
/sbin/sln
%_sbindir/rpcinfo
%_bindir/*
%exclude %_bindir/iconv*
%exclude %_bindir/locale*
%exclude %_bindir/memusage*
%exclude %_bindir/pcprofiledump
%exclude %_bindir/tzselect
%exclude %_bindir/xtrace
%_libexecdir/getconf

%files devel -f devel.files
%_libdir/lib*.so
%exclude %_libdir/libnss1_*
%exclude %_libdir/libmemusage.so
%exclude %_libdir/libpcprofile.so
%_libdir/*.o
%_includedir/*
%_mandir/man?/*
%_infodir/*.info*

%files devel-static -f devel-static.files

%files compat
/%_lib/libnss1_*
/%_lib/libnss_*.so.1
/%_lib/libNoVersion*
%_libdir/libnss1_*

%if_enabled profile
%files profile
%_libdir/lib*_p.a
%endif #enabled profile

%files debug
%_bindir/memusage*
%_bindir/pcprofiledump
%_bindir/xtrace
%_libdir/libmemusage.so
%_libdir/libpcprofile.so

%files -n nscd
%config(noreplace) %_sysconfdir/nscd.conf
%_initdir/nscd
%_sbindir/nscd*
%attr(711,root,root) %dir /var/run/nscd
%attr(666,root,root) %ghost /var/run/nscd/socket

%files i18ndata
%_datadir/i18n

%if_with debug
%files core-debug -f core-debug.files
%files nss-debug -f nss-debug.files
%files devel-debug -f devel-debug.files
%_libdir/debug/*.o
%_libdir/debug/*.a
%endif #with debug

%endif #enabled archopt

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin