Accepting request 509776 from home:Andreas_Schwab:Factory

Reorganize spec file

OBS-URL: https://build.opensuse.org/request/show/509776
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=459
This commit is contained in:
Andreas Schwab 2017-07-12 13:21:16 +00:00 committed by Git OBS Bridge
parent fede245d46
commit fcaf5acc9a

View File

@ -23,28 +23,25 @@
%define crypt_bf_version 1.3
%define build_snapshot 0
%define utils_build ("@BUILD_FLAVOR@" == "utils")
%define testsuite_build ("@BUILD_FLAVOR@" == "testsuite")
%define normal_build !(%utils_build || %testsuite_build)
%bcond_with all
%define build_main 1
%define build_utils %{with all}
%define build_testsuite %{with all}
%if "@BUILD_FLAVOR@" == "utils"
%define build_main 0
%define build_utils 1
%define build_testsuite 0
%endif
%if "@BUILD_FLAVOR@" == "testsuite"
%define build_main 0
%define build_utils 0
%define build_testsuite 1
%endif
%if %normal_build
Name: glibc
Summary: Standard Shared Libraries (from the GNU C Library)
License: LGPL-2.1+ and SUSE-LGPL-2.1+-with-GCC-exception and GPL-2.0+
Group: System/Libraries
%endif
%if %utils_build
Name: glibc-utils
Summary: Development utilities from the GNU C Library
License: LGPL-2.1+
Group: Development/Languages/C and C++
%endif
%if %testsuite_build
Name: glibc-testsuite
Summary: Testsuite results from the GNU C Library
License: LGPL-2.1+
Group: Development/Languages/C and C++
%endif
BuildRequires: audit-devel
BuildRequires: fdupes
BuildRequires: libcap-devel
@ -53,14 +50,14 @@ BuildRequires: makeinfo
BuildRequires: pwdutils
BuildRequires: systemd-rpm-macros
BuildRequires: xz
%if %{testsuite_build}
%if %{build_testsuite}
BuildRequires: gcc-c++
BuildRequires: gdb
BuildRequires: glibc-devel-static
BuildRequires: libstdc++-devel
BuildRequires: python-pexpect
%endif
%if %{utils_build}
%if %{build_utils}
BuildRequires: gd-devel
%endif
%if "@BUILD_FLAVOR@" == "i686"
@ -77,7 +74,7 @@ BuildArch: i686
%define build_locales 1
%define build_html 0
%else
%if %{with fast_build} || %{utils_build}
%if %{with fast_build} || %{build_utils} && %{without all}
%define build_profile 0
%define build_locales 0
%define build_html 0
@ -89,7 +86,7 @@ BuildArch: i686
%endif
%endif
%define build_variants %{normal_build}
%define build_variants %{build_main}
%define disable_assert 0
%define enable_stackguard_randomization 1
@ -151,7 +148,6 @@ Source50: http://www.openwall.com/crypt/crypt_blowfish-%{crypt_bf_version}
# The sign key uses MD5 which is no longer accepted by gpg
#Source51: http://www.openwall.com/crypt/crypt_blowfish-%{crypt_bf_version}.tar.gz.sign
%if %{normal_build}
# ngpt was used in 8.1 and SLES8
Obsoletes: ngpt < 2.2.2
Obsoletes: ngpt-devel < 2.2.2
@ -173,10 +169,6 @@ Provides: ld-linux.so.3(GLIBC_2.4)
Requires(pre): filesystem
Recommends: glibc-extra
Provides: rtld(GNU_HASH)
%endif # %{normal_build}
%if %{utils_build}
Requires: glibc = %{version}
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%ifarch i686
# We need to avoid to have only the src rpm from i686 on the media,
@ -298,22 +290,31 @@ Patch2008: reinitialize-dl_load_write_lock.patch
Patch3000: manpages.patch
%description
%if %{normal_build}
The GNU C Library provides the most important standard libraries used
by nearly all programs: the standard C library, the standard math
library, and the POSIX thread library. A system is not functional
without these libraries.
%endif
%if %{utils_build}
%package utils
Summary: Development utilities from the GNU C Library
License: LGPL-2.1+
Group: Development/Languages/C and C++
Requires: glibc = %{version}
%description utils
The glibc-utils package contains mtrace, a memory leak tracer and
xtrace, a function call tracer which can be helpful during program
debugging.
If you are unsure if you need this, do not install this package.
%endif
%if %{testsuite_build}
This package runs the testsuite from the GNU C Library.
%endif
%package testsuite
Summary: Testsuite results from the GNU C Library
License: LGPL-2.1+
Group: Development/Languages/C and C++
%description testsuite
This package contains the testsuite results from the GNU C Library.
%package info
Summary: Info Files for the GNU C Library
@ -782,7 +783,7 @@ popd
#######################################################################
%check
%if %{testsuite_build}
%if %{build_testsuite}
# The testsuite will fail if asneeded is used
export SUSE_ASNEEDED=0
# Increase timeout
@ -824,7 +825,7 @@ make %{?_smp_mflags} -C cc-base check-abi
#######################################################################
%install
%if %{normal_build}
%if %{build_main}
# We don't want to strip the .symtab from our libraries in find-debuginfo.sh,
# certainly not from libpthread.so.* because it is used by libthread_db to find
# some non-exported symbols in order to detect if threading support
@ -1025,6 +1026,7 @@ ln -s ld-%{libversion}.so %{buildroot}/lib/ld-linux.so.3
mv %{buildroot}%{_bindir}/getconf %{buildroot}%{_libexecdir}/getconf/getconf
ln -s %{_libexecdir}/getconf/getconf %{buildroot}%{_bindir}/getconf
%if !%{build_utils}
# Remove unwanted files (packaged in glibc-utils)
rm -f %{buildroot}/%{_lib}/libmemusage*
rm -f %{buildroot}/%{_lib}/libpcprofile*
@ -1042,6 +1044,7 @@ rm -rf %{buildroot}%{_infodir} %{buildroot}%{_prefix}/share/i18n
rm -f %{buildroot}%{_bindir}/makedb %{buildroot}/var/lib/misc/Makefile
rm -f %{buildroot}%{_sbindir}/nscd
%endif # i686
%endif # !utils
# LSB
%ifarch %ix86
@ -1063,9 +1066,9 @@ ln -sf /%{_lib}/ld.so.1 $RPM_BUILD_ROOT/%{_lib}/ld-lsb-s390.so.3
ln -sf /%{_lib}/ld64.so.1 $RPM_BUILD_ROOT/%{_lib}/ld-lsb-s390x.so.3
%endif
%endif # %{normal_build}
%else # !main
%if %{utils_build}
%if %{build_utils}
make %{?_smp_mflags} install_root=%{buildroot} install -C cc-base \
subdirs='malloc debug elf'
@ -1078,7 +1081,9 @@ rm -f %{buildroot}%{_bindir}/{catchsegv,ldd*,sprof}
rm -rf %{buildroot}%{_mandir}/man*
rm -rf %{buildroot}/sbin %{buildroot}%{_includedir}
%endif # %{utils_build}
%endif # utils
%endif # !main
#######################################################################
###
@ -1086,13 +1091,9 @@ rm -rf %{buildroot}/sbin %{buildroot}%{_includedir}
###
#######################################################################
%if %{normal_build}
%post -p %{_sbindir}/glibc_post_upgrade
%postun -p /sbin/ldconfig
%endif # %{normal_build}
%post locale
for l in /usr/share/locale/locale.alias %{_libdir}/gconv/gconv-modules; do
[ -d "$l.d" ] || continue
@ -1129,7 +1130,7 @@ exit 0
%service_del_postun nscd.service
exit 0
%if %{normal_build}
%if %{build_main}
%files
#######################################################################
###
@ -1412,10 +1413,10 @@ exit 0
/var/lib/misc/Makefile
%endif # !i686
%endif # %{normal_build}
%endif # main
%if %{utils_build}
%files
%if %{build_utils}
%files utils
%defattr(-,root,root)
/%{_lib}/libmemusage.so
/%{_lib}/libpcprofile.so
@ -1428,6 +1429,6 @@ exit 0
%{_bindir}/sotruss
%{_bindir}/xtrace
%{_bindir}/pldd
%endif # %{utils_build}
%endif # utils
%changelog